diff --git a/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp b/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp index 1382e2ce36..e724681399 100644 --- a/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp +++ b/rpcs3/Emu/GS/GL/GLFragmentProgram.cpp @@ -39,16 +39,21 @@ void GLFragmentDecompilerThread::SetDst(std::string code, bool append_mask) std::string dest; - if(dst.no_dest) + if (dst.no_dest) { - if(dst.set_cond) + if (dst.set_cond) { - dest = m_parr.AddParam(PARAM_NONE , "vec4", std::string(dst.fp16 ? "hc" : "rc") + std::to_string(src0.cond_reg_index)); + dest = m_parr.AddParam(PARAM_NONE, "vec4", "cc" + std::to_string(src0.cond_mod_reg_index)); } } else { dest = AddReg(dst.dest_reg, dst.fp16); + + if (dst.set_cond) + { + dest = m_parr.AddParam(PARAM_NONE, "vec4", "cc" + std::to_string(src0.cond_mod_reg_index)) + mask + " = " + dest; + } } AddCode(cond + (dest.length() ? dest + mask + " = " : "") + code + (append_mask ? mask : "") + ";"); @@ -87,9 +92,9 @@ bool GLFragmentDecompilerThread::HasReg(u32 index, int fp16) std::string(fp16 ? "h" : "r") + std::to_string(index)); } -std::string GLFragmentDecompilerThread::AddCond(int fp16) +std::string GLFragmentDecompilerThread::AddCond() { - return m_parr.AddParam(PARAM_NONE , "vec4", std::string(fp16 ? "hc" : "rc") + std::to_string(src0.cond_mod_reg_index)); + return m_parr.AddParam(PARAM_NONE , "vec4", "cc" + std::to_string(src0.cond_reg_index)); } std::string GLFragmentDecompilerThread::AddConst() @@ -178,7 +183,7 @@ std::string GLFragmentDecompilerThread::GetCond() cond = "equal"; } - return "any(" + cond + "(" + AddCond(dst.no_dest) + swizzle + ", vec4(0.0)))"; + return "any(" + cond + "(" + AddCond() + swizzle + ", vec4(0.0)))"; } template std::string GLFragmentDecompilerThread::GetSRC(T src) diff --git a/rpcs3/Emu/GS/GL/GLFragmentProgram.h b/rpcs3/Emu/GS/GL/GLFragmentProgram.h index 9148444886..3aba8fa7af 100644 --- a/rpcs3/Emu/GS/GL/GLFragmentProgram.h +++ b/rpcs3/Emu/GS/GL/GLFragmentProgram.h @@ -148,7 +148,7 @@ struct GLFragmentDecompilerThread : public ThreadBase void AddCode(const std::string& code); std::string AddReg(u32 index, int fp16); bool HasReg(u32 index, int fp16); - std::string AddCond(int fp16); + std::string AddCond(); std::string AddConst(); std::string AddTex(); std::string Format(std::string code);