aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Shader/GpuChannelComputeState.cs
blob: d8cdbc3485ef01d72426f4a823616a354ca6c937 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
namespace Ryujinx.Graphics.Gpu.Shader
{
    /// <summary>
    /// State used by the <see cref="GpuAccessor"/>.
    /// </summary>
    readonly struct GpuChannelComputeState
    {
        // New fields should be added to the end of the struct to keep disk shader cache compatibility.

        /// <summary>
        /// Local group size X of the compute shader.
        /// </summary>
        public readonly int LocalSizeX;

        /// <summary>
        /// Local group size Y of the compute shader.
        /// </summary>
        public readonly int LocalSizeY;

        /// <summary>
        /// Local group size Z of the compute shader.
        /// </summary>
        public readonly int LocalSizeZ;

        /// <summary>
        /// Local memory size of the compute shader.
        /// </summary>
        public readonly int LocalMemorySize;

        /// <summary>
        /// Shared memory size of the compute shader.
        /// </summary>
        public readonly int SharedMemorySize;

        /// <summary>
        /// Indicates that any storage buffer use is unaligned.
        /// </summary>
        public readonly bool HasUnalignedStorageBuffer;

        /// <summary>
        /// Creates a new GPU compute state.
        /// </summary>
        /// <param name="localSizeX">Local group size X of the compute shader</param>
        /// <param name="localSizeY">Local group size Y of the compute shader</param>
        /// <param name="localSizeZ">Local group size Z of the compute shader</param>
        /// <param name="localMemorySize">Local memory size of the compute shader</param>
        /// <param name="sharedMemorySize">Shared memory size of the compute shader</param>
        /// <param name="hasUnalignedStorageBuffer">Indicates that any storage buffer use is unaligned</param>
        public GpuChannelComputeState(
            int localSizeX,
            int localSizeY,
            int localSizeZ,
            int localMemorySize,
            int sharedMemorySize,
            bool hasUnalignedStorageBuffer)
        {
            LocalSizeX = localSizeX;
            LocalSizeY = localSizeY;
            LocalSizeZ = localSizeZ;
            LocalMemorySize = localMemorySize;
            SharedMemorySize = sharedMemorySize;
            HasUnalignedStorageBuffer = hasUnalignedStorageBuffer;
        }
    }
}