mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-12 22:14:58 +00:00
rsx: Decompiler fixups for conditional execution
- Cond actually obeys vector mask
This commit is contained in:
parent
f9aea076ae
commit
fe6ff8622a
@ -460,7 +460,9 @@ void FragmentProgramDecompiler::AddCodeCond(const std::string& dst, const std::s
|
||||
}
|
||||
|
||||
// NOTE: dst = _select(dst, src, cond) is equivalent to dst = cond? src : dst;
|
||||
const auto cond = ShaderVariable(dst).match_size(GetRawCond());
|
||||
const auto dst_var = ShaderVariable(dst);
|
||||
const auto raw_cond = dst_var.add_mask(GetRawCond());
|
||||
const auto cond = dst_var.match_size(raw_cond);
|
||||
AddCode(dst + " = _select(" + dst + ", " + src_prefix + src + ", " + cond + ");");
|
||||
}
|
||||
|
||||
|
@ -311,6 +311,16 @@ public:
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
std::string add_mask(const std::string& other_var) const
|
||||
{
|
||||
if (swizzles.back() != "xyzw")
|
||||
{
|
||||
return other_var + "." + swizzles.back();
|
||||
}
|
||||
|
||||
return other_var;
|
||||
}
|
||||
};
|
||||
|
||||
struct vertex_reg_info
|
||||
|
@ -310,7 +310,9 @@ void VertexProgramDecompiler::AddCodeCond(const std::string& dst, const std::str
|
||||
}
|
||||
|
||||
// NOTE: dst = _select(dst, src, cond) is equivalent to dst = cond? src : dst;
|
||||
const auto cond = ShaderVariable(dst).match_size(GetRawCond());
|
||||
const auto dst_var = ShaderVariable(dst);
|
||||
const auto raw_cond = dst_var.add_mask(GetRawCond());
|
||||
const auto cond = dst_var.match_size(raw_cond);
|
||||
AddCode(dst + " = _select(" + dst + ", " + src + ", " + cond + ");");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user