Support multiple destination operands on shader IR and shuffle predicates (#1964)

* Support multiple destination operands on shader IR and shuffle predicates

* Cache version change
This commit is contained in:
gdkchan 2021-01-27 20:59:47 -03:00 committed by GitHub
parent dcce407071
commit 4b7c7dab9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 199 additions and 79 deletions

View file

@ -118,25 +118,17 @@ namespace Ryujinx.Graphics.Shader.Instructions
Operand srcB = op.IsBImmediate ? Const(op.ImmediateB) : Register(op.Rb);
Operand srcC = op.IsCImmediate ? Const(op.ImmediateC) : Register(op.Rc);
Operand res = null;
switch (op.ShuffleType)
(Operand res, Operand valid) = op.ShuffleType switch
{
case ShuffleType.Indexed:
res = context.Shuffle(srcA, srcB, srcC);
break;
case ShuffleType.Up:
res = context.ShuffleUp(srcA, srcB, srcC);
break;
case ShuffleType.Down:
res = context.ShuffleDown(srcA, srcB, srcC);
break;
case ShuffleType.Butterfly:
res = context.ShuffleXor(srcA, srcB, srcC);
break;
}
ShuffleType.Indexed => context.Shuffle(srcA, srcB, srcC),
ShuffleType.Up => context.ShuffleUp(srcA, srcB, srcC),
ShuffleType.Down => context.ShuffleDown(srcA, srcB, srcC),
ShuffleType.Butterfly => context.ShuffleXor(srcA, srcB, srcC),
_ => (null, null)
};
context.Copy(GetDest(context), res);
context.Copy(pred, valid);
}
}
}