/ src / Ryujinx.Graphics.Gpu / Shader / GpuChannelComputeState.cs
GpuChannelComputeState.cs
 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  
10          /// <summary>
11          /// Local group size X of the compute shader.
12          /// </summary>
13          public readonly int LocalSizeX;
14  
15          /// <summary>
16          /// Local group size Y of the compute shader.
17          /// </summary>
18          public readonly int LocalSizeY;
19  
20          /// <summary>
21          /// Local group size Z of the compute shader.
22          /// </summary>
23          public readonly int LocalSizeZ;
24  
25          /// <summary>
26          /// Local memory size of the compute shader.
27          /// </summary>
28          public readonly int LocalMemorySize;
29  
30          /// <summary>
31          /// Shared memory size of the compute shader.
32          /// </summary>
33          public readonly int SharedMemorySize;
34  
35          /// <summary>
36          /// Indicates that any storage buffer use is unaligned.
37          /// </summary>
38          public readonly bool HasUnalignedStorageBuffer;
39  
40          /// <summary>
41          /// Creates a new GPU compute state.
42          /// </summary>
43          /// <param name="localSizeX">Local group size X of the compute shader</param>
44          /// <param name="localSizeY">Local group size Y of the compute shader</param>
45          /// <param name="localSizeZ">Local group size Z of the compute shader</param>
46          /// <param name="localMemorySize">Local memory size of the compute shader</param>
47          /// <param name="sharedMemorySize">Shared memory size of the compute shader</param>
48          /// <param name="hasUnalignedStorageBuffer">Indicates that any storage buffer use is unaligned</param>
49          public GpuChannelComputeState(
50              int localSizeX,
51              int localSizeY,
52              int localSizeZ,
53              int localMemorySize,
54              int sharedMemorySize,
55              bool hasUnalignedStorageBuffer)
56          {
57              LocalSizeX = localSizeX;
58              LocalSizeY = localSizeY;
59              LocalSizeZ = localSizeZ;
60              LocalMemorySize = localMemorySize;
61              SharedMemorySize = sharedMemorySize;
62              HasUnalignedStorageBuffer = hasUnalignedStorageBuffer;
63          }
64      }
65  }