From 94656ac1e39dd8873547d52950a19f312a8d93fc Mon Sep 17 00:00:00 2001 From: kd-11 Date: Sat, 31 Aug 2019 14:31:12 +0300 Subject: [PATCH] rsx/vp: Warnings cleanup --- .../Emu/RSX/Common/VertexProgramDecompiler.cpp | 18 +++++++++--------- rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp index 0b62636f8a..a6f3dbd799 100644 --- a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp +++ b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.cpp @@ -288,7 +288,7 @@ std::string VertexProgramDecompiler::GetOptionalBranchCond() return "if (" + cond + ")"; } -void VertexProgramDecompiler::AddCodeCond(const std::string& dst, const std::string& src) +void VertexProgramDecompiler::AddCodeCond(const std::string& lhs, const std::string& rhs) { enum { @@ -299,21 +299,21 @@ void VertexProgramDecompiler::AddCodeCond(const std::string& dst, const std::str if (!d0.cond_test_enable || d0.cond == (lt | gt | eq)) { - AddCode(dst + " = " + src + ";"); + AddCode(lhs + " = " + rhs + ";"); return; } if (d0.cond == 0) { - AddCode("//" + dst + " = " + src + ";"); + AddCode("//" + lhs + " = " + rhs + ";"); return; } - // NOTE: dst = _select(dst, src, cond) is equivalent to dst = cond? src : dst; - const auto dst_var = ShaderVariable(dst); + // NOTE: x = _select(x, y, cond) is equivalent to x = cond? y : x; + const auto dst_var = ShaderVariable(lhs); const auto raw_cond = dst_var.add_mask(GetRawCond()); const auto cond = dst_var.match_size(raw_cond); - AddCode(dst + " = _select(" + dst + ", " + src + ", " + cond + ");"); + AddCode(lhs + " = _select(" + lhs + ", " + rhs + ", " + cond + ");"); } std::string VertexProgramDecompiler::AddAddrReg() @@ -714,16 +714,16 @@ std::string VertexProgramDecompiler::Decompile() break; } - case RSX_SCA_OPCODE_CLB: break; + case RSX_SCA_OPCODE_CLB: // works same as BRB AddCode("//CLB"); do_function_call("$ifbcond"); break; - case RSX_SCA_OPCODE_PSH: break; + case RSX_SCA_OPCODE_PSH: // works differently (PSH o[1].x A0;) LOG_ERROR(RSX, "Unimplemented sca_opcode PSH"); break; - case RSX_SCA_OPCODE_POP: break; + case RSX_SCA_OPCODE_POP: // works differently (POP o[1].x;) LOG_ERROR(RSX, "Unimplemented sca_opcode POP"); break; diff --git a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h index 666c2d4d5e..6c2888c659 100644 --- a/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h +++ b/rpcs3/Emu/RSX/Common/VertexProgramDecompiler.h @@ -81,7 +81,7 @@ struct VertexProgramDecompiler u32 GetAddr(); std::string Format(const std::string& code); - void AddCodeCond(const std::string& dst, const std::string& src); + void AddCodeCond(const std::string& lhs, const std::string& rhs); void AddCode(const std::string& code); void SetDST(bool is_sca, std::string value); void SetDSTVec(const std::string& code);