From 4b7c7dab9e33faaf4eb58342f1f7ad8ada354591 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 27 Jan 2021 20:59:47 -0300 Subject: Support multiple destination operands on shader IR and shuffle predicates (#1964) * Support multiple destination operands on shader IR and shuffle predicates * Cache version change --- Ryujinx.Graphics.Shader/Translation/Ssa.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'Ryujinx.Graphics.Shader/Translation/Ssa.cs') diff --git a/Ryujinx.Graphics.Shader/Translation/Ssa.cs b/Ryujinx.Graphics.Shader/Translation/Ssa.cs index a4d763be..ff812e64 100644 --- a/Ryujinx.Graphics.Shader/Translation/Ssa.cs +++ b/Ryujinx.Graphics.Shader/Translation/Ssa.cs @@ -116,13 +116,18 @@ namespace Ryujinx.Graphics.Shader.Translation operation.SetSource(index, RenameLocal(operation.GetSource(index))); } - if (operation.Dest != null && operation.Dest.Type == OperandType.Register) + for (int index = 0; index < operation.DestsCount; index++) { - Operand local = Local(); + Operand dest = operation.GetDest(index); - localDefs[GetKeyFromRegister(operation.Dest.GetRegister())] = local; + if (dest.Type == OperandType.Register) + { + Operand local = Local(); + + localDefs[GetKeyFromRegister(dest.GetRegister())] = local; - operation.Dest = local; + operation.SetDest(index, local); + } } } @@ -185,9 +190,7 @@ namespace Ryujinx.Graphics.Shader.Translation return operand; } - LinkedListNode node = block.Operations.First; - - while (node != null) + for (LinkedListNode node = block.Operations.First; node != null; node = node.Next) { if (node.Value is Operation operation) { @@ -196,8 +199,6 @@ namespace Ryujinx.Graphics.Shader.Translation operation.SetSource(index, RenameGlobal(operation.GetSource(index))); } } - - node = node.Next; } } } -- cgit v1.2.3