diff options
| author | jduncanator <1518948+jduncanator@users.noreply.github.com> | 2020-03-06 11:09:49 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-06 11:09:49 +1100 |
| commit | 54501962f60b87d5ea0790302138c6db81cc2f23 (patch) | |
| tree | 28d2bcc5f075bfa42652ccee7ca313b0a3f42b5b /Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs | |
| parent | 68e15c1a7471e4b2844fc0d3c7385523e595521d (diff) | |
Fix branch with CC and predicate, and a case of SYNC propagation (#967)
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs')
| -rw-r--r-- | Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs index 0b96d751..4b058a84 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitFlow.cs @@ -145,10 +145,24 @@ namespace Ryujinx.Graphics.Shader.Instructions if (op is OpCodeBranch opBranch && opBranch.Condition != Condition.Always) { - pred = context.BitwiseAnd(pred, GetCondition(context, opBranch.Condition)); - } + Operand cond = GetCondition(context, opBranch.Condition); - if (op.Predicate.IsPT) + if (op.Predicate.IsPT) + { + pred = cond; + } + else if (op.InvertPredicate) + { + pred = context.BitwiseAnd(context.BitwiseNot(pred), cond); + } + else + { + pred = context.BitwiseAnd(pred, cond); + } + + context.BranchIfTrue(label, pred); + } + else if (op.Predicate.IsPT) { context.Branch(label); } |
