rsx/vp: Warnings cleanup

This commit is contained in:
kd-11 2019-08-31 14:31:12 +03:00 committed by kd-11
parent 0ee9d7b46d
commit 94656ac1e3
2 changed files with 10 additions and 10 deletions

View file

@ -288,7 +288,7 @@ std::string VertexProgramDecompiler::GetOptionalBranchCond()
return "if (" + cond + ")"; 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 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)) if (!d0.cond_test_enable || d0.cond == (lt | gt | eq))
{ {
AddCode(dst + " = " + src + ";"); AddCode(lhs + " = " + rhs + ";");
return; return;
} }
if (d0.cond == 0) if (d0.cond == 0)
{ {
AddCode("//" + dst + " = " + src + ";"); AddCode("//" + lhs + " = " + rhs + ";");
return; return;
} }
// NOTE: dst = _select(dst, src, cond) is equivalent to dst = cond? src : dst; // NOTE: x = _select(x, y, cond) is equivalent to x = cond? y : x;
const auto dst_var = ShaderVariable(dst); const auto dst_var = ShaderVariable(lhs);
const auto raw_cond = dst_var.add_mask(GetRawCond()); const auto raw_cond = dst_var.add_mask(GetRawCond());
const auto cond = dst_var.match_size(raw_cond); 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() std::string VertexProgramDecompiler::AddAddrReg()
@ -714,16 +714,16 @@ std::string VertexProgramDecompiler::Decompile()
break; break;
} }
case RSX_SCA_OPCODE_CLB: break; case RSX_SCA_OPCODE_CLB:
// works same as BRB // works same as BRB
AddCode("//CLB"); AddCode("//CLB");
do_function_call("$ifbcond"); do_function_call("$ifbcond");
break; break;
case RSX_SCA_OPCODE_PSH: break; case RSX_SCA_OPCODE_PSH:
// works differently (PSH o[1].x A0;) // works differently (PSH o[1].x A0;)
LOG_ERROR(RSX, "Unimplemented sca_opcode PSH"); LOG_ERROR(RSX, "Unimplemented sca_opcode PSH");
break; break;
case RSX_SCA_OPCODE_POP: break; case RSX_SCA_OPCODE_POP:
// works differently (POP o[1].x;) // works differently (POP o[1].x;)
LOG_ERROR(RSX, "Unimplemented sca_opcode POP"); LOG_ERROR(RSX, "Unimplemented sca_opcode POP");
break; break;

View file

@ -81,7 +81,7 @@ struct VertexProgramDecompiler
u32 GetAddr(); u32 GetAddr();
std::string Format(const std::string& code); 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 AddCode(const std::string& code);
void SetDST(bool is_sca, std::string value); void SetDST(bool is_sca, std::string value);
void SetDSTVec(const std::string& code); void SetDSTVec(const std::string& code);