aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-03-27 18:59:05 -0300
committerGitHub <noreply@github.com>2021-03-27 22:59:05 +0100
commita0b4799f1978ddb2cbd8d118380c29d9d15e158b (patch)
tree1e35b4bbe28ca3466f2d3f356f0aea55a7b8fb6d /Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
parente60bae1a942a393a6b8dd3bcc6116dfb7e90cb8d (diff)
Fix ZN flags set for shader instructions using RZ.CC dest (#2147)
* Fix ZN flags set for shader instructions using RZ.CC dest * Shader cache version bump and nits
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs19
1 files changed, 7 insertions, 12 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
index 37c17ecc..734d3aa7 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs
@@ -276,12 +276,11 @@ namespace Ryujinx.Graphics.Shader.Instructions
: context.IMaximumU32(srcA, srcB);
Operand pred = GetPredicate39(context);
+ Operand res = context.ConditionalSelect(pred, resMin, resMax);
- Operand dest = GetDest(context);
-
- context.Copy(dest, context.ConditionalSelect(pred, resMin, resMax));
+ context.Copy(GetDest(context), res);
- SetZnFlags(context, dest, op.SetCondCode);
+ SetZnFlags(context, res, op.SetCondCode);
// TODO: X flags.
}
@@ -461,11 +460,9 @@ namespace Ryujinx.Graphics.Shader.Instructions
EmitLopPredWrite(context, op, res, (ConditionalOperation)context.CurrOp.RawOpCode.Extract(44, 2));
- Operand dest = GetDest(context);
-
- context.Copy(dest, res);
+ context.Copy(GetDest(context), res);
- SetZnFlags(context, dest, op.SetCondCode, op.Extended);
+ SetZnFlags(context, res, op.SetCondCode, op.Extended);
}
public static void Lop3(EmitterContext context)
@@ -489,11 +486,9 @@ namespace Ryujinx.Graphics.Shader.Instructions
EmitLopPredWrite(context, op, res, (ConditionalOperation)context.CurrOp.RawOpCode.Extract(36, 2));
}
- Operand dest = GetDest(context);
-
- context.Copy(dest, res);
+ context.Copy(GetDest(context), res);
- SetZnFlags(context, dest, op.SetCondCode, op.Extended);
+ SetZnFlags(context, res, op.SetCondCode, op.Extended);
}
public static void Popc(EmitterContext context)