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
/// The stage of this shader.
public ShaderStage Stage;
/// Unused/reserved.
public byte Reserved1;
public byte Reserved2;
public byte Reserved3;
/// The size of the code section.
public int Size;
/// The size of the code2 section if present. (Vertex A)
public int SizeA;
/// Constant buffer 1 data size.
public int Cb1DataSize;
/// The header of the cached gpu accessor.
public GuestGpuAccessorHeader GpuAccessorHeader;
/// Create a new guest shader entry header.
/// <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="cb1DataSize">Constant buffer 1 data size</param>
/// <param name="gpuAccessorHeader">The header of the cached gpu accessor</param>
public GuestShaderCacheEntryHeader(ShaderStage stage, int size, int sizeA, int cb1DataSize, GuestGpuAccessorHeader gpuAccessorHeader) : this()
Stage = stage;
Size = size;
SizeA = sizeA;
Cb1DataSize = cb1DataSize;
GpuAccessorHeader = gpuAccessorHeader;
}