aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2023-08-07 12:20:37 -0300
committerGitHub <noreply@github.com>2023-08-07 12:20:37 -0300
commit42750a74f82ee69cabfaf3c5497af6a8ebc13eca (patch)
tree5d42a8945c0e692a0a96752752aac00666fe2c43 /src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs
parent3ab0a71c7bfb60b20008894db3fb6534436753e6 (diff)
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
Diffstat (limited to 'src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs')
-rw-r--r--src/Ryujinx.Graphics.Shader/Instructions/InstEmitFlowControl.cs14
1 files changed, 10 insertions, 4 deletions
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);
}
}