From 3c9126d91f52f6a2ee624c627166c53ebac93de8 Mon Sep 17 00:00:00 2001 From: kd-11 Date: Wed, 8 Nov 2017 16:27:20 +0300 Subject: [PATCH] rsx: Ignore FENCE instruction as it seems like its ignored on realhw - This is likely a compiler hint for performance reasons and not a mandate --- .../RSX/Common/FragmentProgramDecompiler.cpp | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp index 110ff199ce..59c14cbc11 100644 --- a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp @@ -735,21 +735,12 @@ std::string FragmentProgramDecompiler::Decompile() if (SIP()) break; if (handle_tex_srb(opcode)) break; - if (forced_unit == FORCE_NONE) - { - if (handle_sct(opcode)) break; - if (handle_scb(opcode)) break; - } - else if (forced_unit == FORCE_SCT) - { - forced_unit = FORCE_NONE; - if (handle_sct(opcode)) break; - } - else if (forced_unit == FORCE_SCB) - { - forced_unit = FORCE_NONE; - if (handle_scb(opcode)) break; - } + //FENCT/FENCB do not actually reject instructions if they dont match the forced unit + //Tested with Dark Souls II where the repecting FENCX instruction will result in empty luminance averaging shaders + //TODO: More reasearch is needed to determine what real HW does + if (handle_sct(opcode)) break; + if (handle_scb(opcode)) break; + forced_unit = FORCE_NONE; LOG_ERROR(RSX, "Unknown/illegal instruction: 0x%x (forced unit %d)", opcode, prev_force_unit); break;