mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
rsx/fp: Fix precision clamping on MAD instruction
This commit is contained in:
parent
a8bca8b2ed
commit
37df3c6f96
1 changed files with 15 additions and 0 deletions
|
@ -644,6 +644,21 @@ template<typename T> std::string FragmentProgramDecompiler::GetSRC(T src)
|
|||
break;
|
||||
}
|
||||
|
||||
if (apply_precision_modifier && !src.neg)
|
||||
{
|
||||
if constexpr (!std::is_same<T, SRC0>::value)
|
||||
{
|
||||
if (dst.opcode == RSX_FP_OPCODE_MAD)
|
||||
{
|
||||
// Hardware tests show special behavior on MAD operation
|
||||
// Only src0 obeys precision modifier (sat tested)
|
||||
// Results: 1 * 100 + 0 = 100, 1 * 1 + 100 = 100, 100 * 1 + 0 = 1
|
||||
// NOTE: Neg modifier seems to break this rule; 1 * -100 + 0 = -1 not -99
|
||||
apply_precision_modifier = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static const char f[4] = { 'x', 'y', 'z', 'w' };
|
||||
|
||||
std::string swizzle;
|
||||
|
|
Loading…
Add table
Reference in a new issue