From 42750a74f82ee69cabfaf3c5497af6a8ebc13eca Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 7 Aug 2023 12:20:37 -0300 Subject: Do not add more code after alpha test discard on fragment shader (#5529) * Do not add more code after alpha test discard on fragment shader * Shader cache version bump --- .../Instructions/InstEmitFlowControl.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs') diff --git a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs index fc1a696f..7462fc5a 100644 --- a/src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs +++ b/src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs @@ -162,8 +162,10 @@ namespace Ryujinx.Graphics.Shader.Instructions if (op.Ccc == Ccc.T) { - context.PrepareForReturn(); - context.Return(); + if (context.PrepareForReturn()) + { + context.Return(); + } } else { @@ -174,8 +176,12 @@ namespace Ryujinx.Graphics.Shader.Instructions { Operand lblSkip = Label(); context.BranchIfFalse(lblSkip, cond); - context.PrepareForReturn(); - context.Return(); + + if (context.PrepareForReturn()) + { + context.Return(); + } + context.MarkLabel(lblSkip); } } -- cgit v1.2.3