StructuredFunction.cs 1.1 KB

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