BufferTextureBinding.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. using Ryujinx.Graphics.GAL;
  2. using Ryujinx.Graphics.Gpu.Image;
  3. using Ryujinx.Graphics.Shader;
  4. namespace Ryujinx.Graphics.Gpu.Memory
  5. {
  6. /// <summary>
  7. /// A buffer binding to apply to a buffer texture.
  8. /// </summary>
  9. readonly struct BufferTextureBinding
  10. {
  11. /// <summary>
  12. /// Shader stage accessing the texture.
  13. /// </summary>
  14. public ShaderStage Stage { get; }
  15. /// <summary>
  16. /// The buffer texture.
  17. /// </summary>
  18. public ITexture Texture { get; }
  19. /// <summary>
  20. /// The base address of the buffer binding.
  21. /// </summary>
  22. public ulong Address { get; }
  23. /// <summary>
  24. /// The size of the buffer binding in bytes.
  25. /// </summary>
  26. public ulong Size { get; }
  27. /// <summary>
  28. /// The image or sampler binding info for the buffer texture.
  29. /// </summary>
  30. public TextureBindingInfo BindingInfo { get; }
  31. /// <summary>
  32. /// The image format for the binding.
  33. /// </summary>
  34. public Format Format { get; }
  35. /// <summary>
  36. /// Whether the binding is for an image or a sampler.
  37. /// </summary>
  38. public bool IsImage { get; }
  39. /// <summary>
  40. /// Create a new buffer texture binding.
  41. /// </summary>
  42. /// <param name="stage">Shader stage accessing the texture</param>
  43. /// <param name="texture">Buffer texture</param>
  44. /// <param name="address">Base address</param>
  45. /// <param name="size">Size in bytes</param>
  46. /// <param name="bindingInfo">Binding info</param>
  47. /// <param name="format">Binding format</param>
  48. /// <param name="isImage">Whether the binding is for an image or a sampler</param>
  49. public BufferTextureBinding(
  50. ShaderStage stage,
  51. ITexture texture,
  52. ulong address,
  53. ulong size,
  54. TextureBindingInfo bindingInfo,
  55. Format format,
  56. bool isImage)
  57. {
  58. Stage = stage;
  59. Texture = texture;
  60. Address = address;
  61. Size = size;
  62. BindingInfo = bindingInfo;
  63. Format = format;
  64. IsImage = isImage;
  65. }
  66. }
  67. }