diff options
author | gdkchan <gab.dark.100@gmail.com> | 2021-01-27 20:59:47 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 10:59:47 +1100 |
commit | 4b7c7dab9e33faaf4eb58342f1f7ad8ada354591 (patch) | |
tree | d912e9e3434fb3ba53afad5fee216eadde731cc6 /Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs | |
parent | dcce4070719a3798bb96d3aa02b9ba02a7fecc16 (diff) |
Support multiple destination operands on shader IR and shuffle predicates (#1964)
* Support multiple destination operands on shader IR and shuffle predicates
* Cache version change
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs')
-rw-r--r-- | Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs index 264c732d..085325ee 100644 --- a/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs +++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitMove.cs @@ -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); } } }
\ No newline at end of file |