BufferDescriptor.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace Ryujinx.Graphics.Shader
  2. {
  3. public struct BufferDescriptor
  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 byte Slot;
  8. public readonly byte SbCbSlot;
  9. public readonly ushort SbCbOffset;
  10. public BufferUsageFlags Flags;
  11. public BufferDescriptor(int binding, int slot)
  12. {
  13. Binding = binding;
  14. Slot = (byte)slot;
  15. SbCbSlot = 0;
  16. SbCbOffset = 0;
  17. Flags = BufferUsageFlags.None;
  18. }
  19. public BufferDescriptor(int binding, int slot, int sbCbSlot, int sbCbOffset)
  20. {
  21. Binding = binding;
  22. Slot = (byte)slot;
  23. SbCbSlot = (byte)sbCbSlot;
  24. SbCbOffset = (ushort)sbCbOffset;
  25. Flags = BufferUsageFlags.None;
  26. }
  27. public BufferDescriptor SetFlag(BufferUsageFlags flag)
  28. {
  29. Flags |= flag;
  30. return this;
  31. }
  32. }
  33. }