aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Shader/Cache/Definition/GuestShaderCacheEntryHeader.cs
blob: 6d5bb28dcebd7cf0188a61ad51fe95d0f811366c (plain)
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
66
67
using Ryujinx.Graphics.Shader;
using System.Runtime.InteropServices;

namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition
{
    /// <summary>
    /// The header of a guest shader entry in a guest shader program.
    /// </summary>
    [StructLayout(LayoutKind.Sequential, Pack = 0x1, Size = 0x30)]
    struct GuestShaderCacheEntryHeader
    {
        /// <summary>
        /// The stage of this shader.
        /// </summary>
        public ShaderStage Stage;

        /// <summary>
        /// Unused/reserved.
        /// </summary>
        public byte Reserved1;

        /// <summary>
        /// Unused/reserved.
        /// </summary>
        public byte Reserved2;

        /// <summary>
        /// Unused/reserved.
        /// </summary>
        public byte Reserved3;

        /// <summary>
        /// The size of the code section.
        /// </summary>
        public int Size;

        /// <summary>
        /// The size of the code2 section if present. (Vertex A)
        /// </summary>
        public int SizeA;

        /// <summary>
        /// Unused/reserved.
        /// </summary>
        public int Reserved4;

        /// <summary>
        /// The header of the cached gpu accessor.
        /// </summary>
        public GuestGpuAccessorHeader GpuAccessorHeader;

        /// <summary>
        /// Create a new guest shader entry header.
        /// </summary>
        /// <param name="stage">The stage of this shader</param>
        /// <param name="size">The size of the code section</param>
        /// <param name="sizeA">The size of the code2 section if present (Vertex A)</param>
        /// <param name="gpuAccessorHeader">The header of the cached gpu accessor</param>
        public GuestShaderCacheEntryHeader(ShaderStage stage, int size, int sizeA, GuestGpuAccessorHeader gpuAccessorHeader) : this()
        {
            Stage = stage;
            Size  = size;
            SizeA = sizeA;
            GpuAccessorHeader = gpuAccessorHeader;
        }
    }
}