AstTextureOperation.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Ryujinx.Graphics.Shader.IntermediateRepresentation;
  2. namespace Ryujinx.Graphics.Shader.StructuredIr
  3. {
  4. class AstTextureOperation : AstOperation
  5. {
  6. public SamplerType Type { get; }
  7. public TextureFormat Format { get; }
  8. public TextureFlags Flags { get; }
  9. public int Set { get; }
  10. public int Binding { get; }
  11. public int SamplerSet { get; }
  12. public int SamplerBinding { get; }
  13. public bool IsSeparate => SamplerBinding >= 0;
  14. public AstTextureOperation(
  15. Instruction inst,
  16. SamplerType type,
  17. TextureFormat format,
  18. TextureFlags flags,
  19. int set,
  20. int binding,
  21. int samplerSet,
  22. int samplerBinding,
  23. int index,
  24. params IAstNode[] sources) : base(inst, StorageKind.None, false, index, sources, sources.Length)
  25. {
  26. Type = type;
  27. Format = format;
  28. Flags = flags;
  29. Set = set;
  30. Binding = binding;
  31. SamplerSet = samplerSet;
  32. SamplerBinding = samplerBinding;
  33. }
  34. public SetBindingPair GetTextureSetAndBinding()
  35. {
  36. return new SetBindingPair(Set, Binding);
  37. }
  38. public SetBindingPair GetSamplerSetAndBinding()
  39. {
  40. return new SetBindingPair(SamplerSet, SamplerBinding);
  41. }
  42. }
  43. }