/ src / Ryujinx.Graphics.Shader / StructuredIr / StructuredFunction.cs
StructuredFunction.cs
 1  using Ryujinx.Graphics.Shader.Translation;
 2  using System.Collections.Generic;
 3  
 4  namespace Ryujinx.Graphics.Shader.StructuredIr
 5  {
 6      class StructuredFunction
 7      {
 8          public AstBlock MainBlock { get; }
 9  
10          public string Name { get; }
11  
12          public AggregateType ReturnType { get; }
13  
14          public AggregateType[] InArguments { get; }
15          public AggregateType[] OutArguments { get; }
16  
17          public HashSet<AstOperand> Locals { get; }
18  
19          public StructuredFunction(
20              AstBlock mainBlock,
21              string name,
22              AggregateType returnType,
23              AggregateType[] inArguments,
24              AggregateType[] outArguments)
25          {
26              MainBlock = mainBlock;
27              Name = name;
28              ReturnType = returnType;
29              InArguments = inArguments;
30              OutArguments = outArguments;
31  
32              Locals = new HashSet<AstOperand>();
33          }
34  
35          public AggregateType GetArgumentType(int index)
36          {
37              return index >= InArguments.Length
38                  ? OutArguments[index - InArguments.Length]
39                  : InArguments[index];
40          }
41      }
42  }