diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-01-31 21:13:38 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-01 11:13:38 +1100 |
| commit | 053dcfdb0572da9c03d4343a82ac69ac44e3276b (patch) | |
| tree | 07c381d42fe44c1bc7e7c5daa61bce3427ebf9e3 /Ryujinx.Graphics.Shader/IntermediateRepresentation | |
| parent | f93089a64f9586863e8a261af932d125e78230df (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/IntermediateRepresentation')
| -rw-r--r-- | Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs | 1 | ||||
| -rw-r--r-- | Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs | 23 |
2 files changed, 22 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs index c0356e46..13fd55ec 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Instruction.cs @@ -32,7 +32,6 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation BranchIfFalse, BranchIfTrue, Call, - CallOutArgument, Ceiling, Clamp, ClampU32, diff --git a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs index 4f0801b7..955beafd 100644 --- a/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs +++ b/Ryujinx.Graphics.Shader/IntermediateRepresentation/Operation.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; namespace Ryujinx.Graphics.Shader.IntermediateRepresentation { @@ -96,7 +97,27 @@ namespace Ryujinx.Graphics.Shader.IntermediateRepresentation Index = index; } - public void AppendOperands(params Operand[] operands) + public void AppendDests(Operand[] operands) + { + int startIndex = _dests.Length; + + Array.Resize(ref _dests, startIndex + operands.Length); + + for (int index = 0; index < operands.Length; index++) + { + Operand dest = operands[index]; + + if (dest != null && dest.Type == OperandType.LocalVariable) + { + Debug.Assert(dest.AsgOp == null); + dest.AsgOp = this; + } + + _dests[startIndex + index] = dest; + } + } + + public void AppendSources(Operand[] operands) { int startIndex = _sources.Length; |
