TextureDescriptor.cs 940 B

12345678910111213141516171819202122232425262728293031323334
  1. namespace Ryujinx.Graphics.Shader
  2. {
  3. public struct TextureDescriptor
  4. {
  5. // New fields should be added to the end of the struct to keep disk shader cache compatibility.
  6. public readonly int Binding;
  7. public readonly SamplerType Type;
  8. public readonly TextureFormat Format;
  9. public readonly int CbufSlot;
  10. public readonly int HandleIndex;
  11. public TextureUsageFlags Flags;
  12. public TextureDescriptor(int binding, SamplerType type, TextureFormat format, int cbufSlot, int handleIndex)
  13. {
  14. Binding = binding;
  15. Type = type;
  16. Format = format;
  17. CbufSlot = cbufSlot;
  18. HandleIndex = handleIndex;
  19. Flags = TextureUsageFlags.None;
  20. }
  21. public TextureDescriptor SetFlag(TextureUsageFlags flag)
  22. {
  23. Flags |= flag;
  24. return this;
  25. }
  26. }
  27. }