diff --git a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp index 985e102e3c..28a8967b9d 100644 --- a/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Common/FragmentProgramDecompiler.cpp @@ -585,9 +585,9 @@ bool FragmentProgramDecompiler::handle_tex_srb(u32 opcode) return true; } return false; - case RSX_FP_OPCODE_UP2: SetDst("unpackSnorm2x16(uint($0.x))"); return true; // TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478)) + case RSX_FP_OPCODE_UP2: SetDst("unpackSnorm2x16(uint($0.x)).xyxy"); return true; // TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478)) case RSX_FP_OPCODE_UP4: SetDst("unpackSnorm4x8(uint($0.x))"); return true; // TODO: More testing (Sonic The Hedgehog (NPUB-30442/NPEB-00478)) - case RSX_FP_OPCODE_UP16: SetDst("unpackHalf2x16(uint($0.x))"); return true; + case RSX_FP_OPCODE_UP16: SetDst("unpackHalf2x16(uint($0.x)).xyxy"); return true; case RSX_FP_OPCODE_UPB: SetDst("(unpackUnorm4x8(uint($0.x)) * 255.)"); return true; case RSX_FP_OPCODE_UPG: LOG_ERROR(RSX, "Unimplemented TEX_SRB instruction: UPG"); return true; } @@ -648,7 +648,10 @@ std::string FragmentProgramDecompiler::Decompile() { switch (opcode) { - case RSX_FP_OPCODE_BRK: AddFlowOp("break"); break; + case RSX_FP_OPCODE_BRK: + if (m_loop_count) AddFlowOp("break"); + else LOG_ERROR(RSX, "BRK opcode found outside of a loop"); + break; case RSX_FP_OPCODE_CAL: LOG_ERROR(RSX, "Unimplemented SIP instruction: CAL"); break; case RSX_FP_OPCODE_FENCT: forced_unit = FORCE_SCT; break; case RSX_FP_OPCODE_FENCB: forced_unit = FORCE_SCB; break; @@ -663,7 +666,7 @@ std::string FragmentProgramDecompiler::Decompile() case RSX_FP_OPCODE_LOOP: if (!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt) { - AddCode(fmt::format("$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //LOOP", + AddCode(fmt::format("//$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //LOOP", m_loop_count, src1.init_counter, m_loop_count, src1.end_counter, m_loop_count, src1.increment, src2.end_offset)); } else @@ -679,7 +682,7 @@ std::string FragmentProgramDecompiler::Decompile() case RSX_FP_OPCODE_REP: if (!src0.exec_if_eq && !src0.exec_if_gr && !src0.exec_if_lt) { - AddCode(fmt::format("$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //REP", + AddCode(fmt::format("//$ifcond for(int i%u = %u; i%u < %u; i%u += %u) {} //-> %u //REP", m_loop_count, src1.init_counter, m_loop_count, src1.end_counter, m_loop_count, src1.increment, src2.end_offset)); } else diff --git a/rpcs3/Emu/RSX/GL/GLHelpers.h b/rpcs3/Emu/RSX/GL/GLHelpers.h index f64a7fd842..bf6424fa40 100644 --- a/rpcs3/Emu/RSX/GL/GLHelpers.h +++ b/rpcs3/Emu/RSX/GL/GLHelpers.h @@ -133,7 +133,7 @@ namespace gl std::string vendor_string = (const char*)glGetString(GL_VENDOR); std::transform(vendor_string.begin(), vendor_string.end(), vendor_string.begin(), ::tolower); - if (vendor_string.find("intel")) + if (vendor_string.find("intel") != std::string::npos) { int version_major = 0; int version_minor = 0;