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
|
@ -289,7 +289,6 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
|||
case Instruction.AtomicSwap:
|
||||
case Instruction.AtomicXor:
|
||||
case Instruction.Call:
|
||||
case Instruction.CallOutArgument:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -306,7 +305,9 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
|||
|
||||
for (int index = 0; index < node.DestsCount; index++)
|
||||
{
|
||||
if (node.GetDest(index).Type != OperandType.LocalVariable)
|
||||
Operand dest = node.GetDest(index);
|
||||
|
||||
if (dest != null && dest.Type != OperandType.LocalVariable)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -319,7 +320,9 @@ namespace Ryujinx.Graphics.Shader.Translation.Optimizations
|
|||
{
|
||||
for (int index = 0; index < node.DestsCount; index++)
|
||||
{
|
||||
if (node.GetDest(index).UseOps.Count != 0)
|
||||
Operand dest = node.GetDest(index);
|
||||
|
||||
if (dest != null && dest.UseOps.Count != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -299,21 +299,23 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
|
||||
var fru = frus[funcId.Value];
|
||||
|
||||
Operand[] regs = new Operand[fru.InArguments.Length];
|
||||
Operand[] inRegs = new Operand[fru.InArguments.Length];
|
||||
|
||||
for (int i = 0; i < fru.InArguments.Length; i++)
|
||||
{
|
||||
regs[i] = OperandHelper.Register(fru.InArguments[i]);
|
||||
inRegs[i] = OperandHelper.Register(fru.InArguments[i]);
|
||||
}
|
||||
|
||||
operation.AppendOperands(regs);
|
||||
operation.AppendSources(inRegs);
|
||||
|
||||
Operand[] outRegs = new Operand[1 + fru.OutArguments.Length];
|
||||
|
||||
for (int i = 0; i < fru.OutArguments.Length; i++)
|
||||
{
|
||||
Operation callOutArgOp = new Operation(Instruction.CallOutArgument, OperandHelper.Register(fru.OutArguments[i]));
|
||||
|
||||
node = block.Operations.AddAfter(node, callOutArgOp);
|
||||
outRegs[1 + i] = OperandHelper.Register(fru.OutArguments[i]);
|
||||
}
|
||||
|
||||
operation.AppendDests(outRegs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,7 +120,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
{
|
||||
Operand dest = operation.GetDest(index);
|
||||
|
||||
if (dest.Type == OperandType.Register)
|
||||
if (dest != null && dest.Type == OperandType.Register)
|
||||
{
|
||||
Operand local = Local();
|
||||
|
||||
|
|
|
@ -88,7 +88,6 @@ namespace Ryujinx.Graphics.Shader.Translation
|
|||
RegisterUsage.FixupCalls(cfg.Blocks, frus);
|
||||
|
||||
Dominance.FindDominators(cfg);
|
||||
|
||||
Dominance.FindDominanceFrontiers(cfg.Blocks);
|
||||
|
||||
Ssa.Rename(cfg.Blocks);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue