mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 19:45:20 +00:00
rsx/fp: Do not apply input mods to all types of inputs
- Temp registers are confirmed to be affected - Const registers are confirmed to be unaffected - Varying inputs are not confirmed yet
This commit is contained in:
parent
3bfdcf698d
commit
4d75e98647
1 changed files with 6 additions and 1 deletions
|
@ -334,6 +334,7 @@ void FragmentProgramDecompiler::AddCodeCond(const std::string& dst, const std::s
|
|||
template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
|
||||
{
|
||||
std::string ret;
|
||||
bool apply_precision_modifier = !!src1.input_prec_mod;
|
||||
|
||||
switch (src.reg_type)
|
||||
{
|
||||
|
@ -352,6 +353,8 @@ template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
|
|||
"ssa"
|
||||
};
|
||||
|
||||
//TODO: Investigate effect of input modifier on this type
|
||||
|
||||
switch (dst.src_attr_reg_num)
|
||||
{
|
||||
case 0x00: ret += reg_table[0]; break;
|
||||
|
@ -373,6 +376,7 @@ template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
|
|||
|
||||
case RSX_FP_REGISTER_TYPE_CONSTANT:
|
||||
ret += AddConst();
|
||||
apply_precision_modifier = false;
|
||||
break;
|
||||
|
||||
case RSX_FP_REGISTER_TYPE_UNKNOWN: // ??? Used by a few games, what is it?
|
||||
|
@ -380,6 +384,7 @@ template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
|
|||
dst.opcode, dst.HEX, src0.HEX, src1.HEX, src2.HEX);
|
||||
|
||||
ret += AddType3();
|
||||
apply_precision_modifier = false;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -400,7 +405,7 @@ template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
|
|||
|
||||
//Warning: Modifier order matters. e.g neg should be applied after precision clamping (tested with Naruto UNS)
|
||||
if (src.abs) ret = "abs(" + ret + ")";
|
||||
if (src1.input_prec_mod) ret = ClampValue(ret, src1.input_prec_mod);
|
||||
if (apply_precision_modifier) ret = ClampValue(ret, src1.input_prec_mod);
|
||||
if (src.neg) ret = "-" + ret;
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue