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/StructuredIr/StructuredProgram.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs') diff --git a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs index 8c73e698..497cffc8 100644 --- a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs +++ b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs @@ -77,6 +77,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr bool isCall = inst == Instruction.Call; int sourcesCount = operation.SourcesCount; + int outDestsCount = operation.DestsCount != 0 ? operation.DestsCount - 1 : 0; List callOutOperands = new List(); @@ -93,7 +94,7 @@ namespace Ryujinx.Graphics.Shader.StructuredIr sourcesCount += callOutOperands.Count; } - IAstNode[] sources = new IAstNode[sourcesCount]; + IAstNode[] sources = new IAstNode[sourcesCount + outDestsCount]; for (int index = 0; index < operation.SourcesCount; index++) { @@ -110,6 +111,15 @@ namespace Ryujinx.Graphics.Shader.StructuredIr callOutOperands.Clear(); } + for (int index = 0; index < outDestsCount; index++) + { + AstOperand oper = context.GetOperandDef(operation.GetDest(1 + index)); + + oper.VarType = InstructionInfo.GetSrcVarType(inst, sourcesCount + index); + + sources[sourcesCount + index] = oper; + } + AstTextureOperation GetAstTextureOperation(TextureOperation texOp) { return new AstTextureOperation( -- cgit v1.2.3