Use multiple dest operands for shader call instructions (#1975)
* Use multiple dest operands for shader call instructions * Passing opNode is no longer needed
This commit is contained in:
parent
f93089a64f
commit
053dcfdb05
7 changed files with 40 additions and 45 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue