GpuChannelComputeState.cs 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. namespace Ryujinx.Graphics.Gpu.Shader
  2. {
  3. /// <summary>
  4. /// State used by the <see cref="GpuAccessor"/>.
  5. /// </summary>
  6. readonly struct GpuChannelComputeState
  7. {
  8. // New fields should be added to the end of the struct to keep disk shader cache compatibility.
  9. /// <summary>
  10. /// Local group size X of the compute shader.
  11. /// </summary>
  12. public readonly int LocalSizeX;
  13. /// <summary>
  14. /// Local group size Y of the compute shader.
  15. /// </summary>
  16. public readonly int LocalSizeY;
  17. /// <summary>
  18. /// Local group size Z of the compute shader.
  19. /// </summary>
  20. public readonly int LocalSizeZ;
  21. /// <summary>
  22. /// Local memory size of the compute shader.
  23. /// </summary>
  24. public readonly int LocalMemorySize;
  25. /// <summary>
  26. /// Shared memory size of the compute shader.
  27. /// </summary>
  28. public readonly int SharedMemorySize;
  29. /// <summary>
  30. /// Indicates that any storage buffer use is unaligned.
  31. /// </summary>
  32. public readonly bool HasUnalignedStorageBuffer;
  33. /// <summary>
  34. /// Creates a new GPU compute state.
  35. /// </summary>
  36. /// <param name="localSizeX">Local group size X of the compute shader</param>
  37. /// <param name="localSizeY">Local group size Y of the compute shader</param>
  38. /// <param name="localSizeZ">Local group size Z of the compute shader</param>
  39. /// <param name="localMemorySize">Local memory size of the compute shader</param>
  40. /// <param name="sharedMemorySize">Shared memory size of the compute shader</param>
  41. /// <param name="hasUnalignedStorageBuffer">Indicates that any storage buffer use is unaligned</param>
  42. public GpuChannelComputeState(
  43. int localSizeX,
  44. int localSizeY,
  45. int localSizeZ,
  46. int localMemorySize,
  47. int sharedMemorySize,
  48. bool hasUnalignedStorageBuffer)
  49. {
  50. LocalSizeX = localSizeX;
  51. LocalSizeY = localSizeY;
  52. LocalSizeZ = localSizeZ;
  53. LocalMemorySize = localMemorySize;
  54. SharedMemorySize = sharedMemorySize;
  55. HasUnalignedStorageBuffer = hasUnalignedStorageBuffer;
  56. }
  57. }
  58. }