diff --git a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs index d4ced7c8be..293fe86bbb 100644 --- a/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs +++ b/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs @@ -35,7 +35,7 @@ namespace Ryujinx.Graphics.Gpu.Shader /// /// Version of the codegen (to be changed when codegen or guest format change). /// - private const ulong ShaderCodeGenVersion = 2088; + private const ulong ShaderCodeGenVersion = 2147; // Progress reporting helpers private volatile int _shaderCount; diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitAlu.cs index 37c17ecc40..734d3aa73f 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(GetDest(context), res); - context.Copy(dest, context.ConditionalSelect(pred, resMin, resMax)); - - 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(GetDest(context), res); - context.Copy(dest, 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(GetDest(context), res); - context.Copy(dest, res); - - SetZnFlags(context, dest, op.SetCondCode, op.Extended); + SetZnFlags(context, res, op.SetCondCode, op.Extended); } public static void Popc(EmitterContext context) diff --git a/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs b/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs index df6b0839ae..a4c21c1d8d 100644 --- a/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs +++ b/Ryujinx.Graphics.Shader/Translation/EmitterContext.cs @@ -91,7 +91,7 @@ namespace Ryujinx.Graphics.Shader.Translation public void PrepareForReturn() { - if (Config.Stage == ShaderStage.Fragment) + if (!IsNonMain && Config.Stage == ShaderStage.Fragment) { if (Config.OmapDepth) {