diff options
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); } |
