GpuChannelPoolState.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. using System;
  2. namespace Ryujinx.Graphics.Gpu.Shader
  3. {
  4. /// <summary>
  5. /// State used by the <see cref="GpuAccessor"/>.
  6. /// </summary>
  7. readonly struct GpuChannelPoolState : IEquatable<GpuChannelPoolState>
  8. {
  9. /// <summary>
  10. /// GPU virtual address of the texture pool.
  11. /// </summary>
  12. public readonly ulong TexturePoolGpuVa;
  13. /// <summary>
  14. /// Maximum ID of the texture pool.
  15. /// </summary>
  16. public readonly int TexturePoolMaximumId;
  17. /// <summary>
  18. /// Constant buffer slot where the texture handles are located.
  19. /// </summary>
  20. public readonly int TextureBufferIndex;
  21. /// <summary>
  22. /// Creates a new GPU texture pool state.
  23. /// </summary>
  24. /// <param name="texturePoolGpuVa">GPU virtual address of the texture pool</param>
  25. /// <param name="texturePoolMaximumId">Maximum ID of the texture pool</param>
  26. /// <param name="textureBufferIndex">Constant buffer slot where the texture handles are located</param>
  27. public GpuChannelPoolState(ulong texturePoolGpuVa, int texturePoolMaximumId, int textureBufferIndex)
  28. {
  29. TexturePoolGpuVa = texturePoolGpuVa;
  30. TexturePoolMaximumId = texturePoolMaximumId;
  31. TextureBufferIndex = textureBufferIndex;
  32. }
  33. /// <summary>
  34. /// Check if the pool states are equal.
  35. /// </summary>
  36. /// <param name="other">Pool state to compare with</param>
  37. /// <returns>True if they are equal, false otherwise</returns>
  38. public bool Equals(GpuChannelPoolState other)
  39. {
  40. return TexturePoolGpuVa == other.TexturePoolGpuVa &&
  41. TexturePoolMaximumId == other.TexturePoolMaximumId &&
  42. TextureBufferIndex == other.TextureBufferIndex;
  43. }
  44. }
  45. }