|
@@ -51,9 +51,9 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
|
|
{
|
|
{
|
|
|
context.LeaveBlock(block, operation);
|
|
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;
|
|
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;
|
|
Instruction inst = operation.Inst;
|
|
|
|
|
|
|
|
- bool isCall = inst == Instruction.Call;
|
|
|
|
|
-
|
|
|
|
|
int sourcesCount = operation.SourcesCount;
|
|
int sourcesCount = operation.SourcesCount;
|
|
|
int outDestsCount = operation.DestsCount != 0 ? operation.DestsCount - 1 : 0;
|
|
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];
|
|
IAstNode[] sources = new IAstNode[sourcesCount + outDestsCount];
|
|
|
|
|
|
|
|
for (int index = 0; index < operation.SourcesCount; index++)
|
|
for (int index = 0; index < operation.SourcesCount; index++)
|
|
@@ -101,16 +82,6 @@ namespace Ryujinx.Graphics.Shader.StructuredIr
|
|
|
sources[index] = context.GetOperandUse(operation.GetSource(index));
|
|
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++)
|
|
for (int index = 0; index < outDestsCount; index++)
|
|
|
{
|
|
{
|
|
|
AstOperand oper = context.GetOperandDef(operation.GetDest(1 + index));
|
|
AstOperand oper = context.GetOperandDef(operation.GetDest(1 + index));
|