aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2021-01-31 21:13:38 -0300
committerGitHub <noreply@github.com>2021-02-01 11:13:38 +1100
commit053dcfdb0572da9c03d4343a82ac69ac44e3276b (patch)
tree07c381d42fe44c1bc7e7c5daa61bce3427ebf9e3 /Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
parentf93089a64f9586863e8a261af932d125e78230df (diff)
Use multiple dest operands for shader call instructions (#1975)
* Use multiple dest operands for shader call instructions * Passing opNode is no longer needed
Diffstat (limited to 'Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs')
-rw-r--r--Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs35
1 files changed, 3 insertions, 32 deletions
diff --git a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
index 497cffc8..4a0ea846 100644
--- a/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
+++ b/Ryujinx.Graphics.Shader/StructuredIr/StructuredProgram.cs
@@ -51,9 +51,9 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
{
context.LeaveBlock(block, operation);
}
- else if (operation.Inst != Instruction.CallOutArgument)
+ else
{
- AddOperation(context, opNode);
+ AddOperation(context, operation);
}
}
}
@@ -68,32 +68,13 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
return context.Info;
}
- private static void AddOperation(StructuredProgramContext context, LinkedListNode<INode> opNode)
+ private static void AddOperation(StructuredProgramContext context, Operation operation)
{
- Operation operation = (Operation)opNode.Value;
-
Instruction inst = operation.Inst;
- bool isCall = inst == Instruction.Call;
-
int sourcesCount = operation.SourcesCount;
int outDestsCount = operation.DestsCount != 0 ? operation.DestsCount - 1 : 0;
- List<Operand> callOutOperands = new List<Operand>();
-
- if (isCall)
- {
- LinkedListNode<INode> scan = opNode.Next;
-
- while (scan != null && scan.Value is Operation nextOp && nextOp.Inst == Instruction.CallOutArgument)
- {
- callOutOperands.Add(nextOp.Dest);
- scan = scan.Next;
- }
-
- sourcesCount += callOutOperands.Count;
- }
-
IAstNode[] sources = new IAstNode[sourcesCount + outDestsCount];
for (int index = 0; index < operation.SourcesCount; index++)
@@ -101,16 +82,6 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
sources[index] = context.GetOperandUse(operation.GetSource(index));
}
- if (isCall)
- {
- for (int index = 0; index < callOutOperands.Count; index++)
- {
- sources[operation.SourcesCount + index] = context.GetOperandDef(callOutOperands[index]);
- }
-
- callOutOperands.Clear();
- }
-
for (int index = 0; index < outDestsCount; index++)
{
AstOperand oper = context.GetOperandDef(operation.GetDest(1 + index));