Fix branch with CC and predicate, and a case of SYNC propagation (#967)

This commit is contained in:
jduncanator 2020-03-06 11:09:49 +11:00 committed by GitHub
parent 68e15c1a74
commit 54501962f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 40 additions and 5 deletions

View file

@ -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);
}