aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdk <gab.dark.100@gmail.com>2019-10-27 13:33:08 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commitd3fcab85112708707eacc4c71a8362b9c178218d (patch)
tree4e107b4570b65bdb460897f74474452f3e71a38b
parentf2e84ff566b824aeb5158fa8432d7b26e2f94a09 (diff)
Fix shader FMUL32I instruction saturation
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs
index 522875e5..1a7d4251 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitFArith.cs
@@ -87,7 +87,9 @@ namespace Ryujinx.Graphics.Shader.Instructions
{
IOpCodeFArith op = (IOpCodeFArith)context.CurrOp;
- bool negateB = !(op is OpCodeFArithImm32) && op.RawOpCode.Extract(48);
+ bool isImm32 = op is OpCodeFArithImm32;
+
+ bool negateB = !isImm32 && op.RawOpCode.Extract(48);
Operand srcA = GetSrcA(context);
@@ -109,7 +111,9 @@ namespace Ryujinx.Graphics.Shader.Instructions
Operand dest = GetDest(context);
- context.Copy(dest, context.FPSaturate(context.FPMultiply(srcA, srcB), op.Saturate));
+ bool saturate = isImm32 ? op.RawOpCode.Extract(55) : op.Saturate;
+
+ context.Copy(dest, context.FPSaturate(context.FPMultiply(srcA, srcB), saturate));
SetFPZnFlags(context, dest, op.SetCondCode);
}