2020-11-12 23:15:34 +00:00
|
|
|
|
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>
|
2021-08-11 19:59:42 +01:00
|
|
|
|
/// Constant buffer 1 data size.
|
2020-11-12 23:15:34 +00:00
|
|
|
|
/// </summary>
|
2021-08-11 19:59:42 +01:00
|
|
|
|
public int Cb1DataSize;
|
2020-11-12 23:15:34 +00:00
|
|
|
|
|
|
|
|
|
/// <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>
|
2021-08-11 19:59:42 +01:00
|
|
|
|
/// <param name="cb1DataSize">Constant buffer 1 data size</param>
|
2020-11-12 23:15:34 +00:00
|
|
|
|
/// <param name="gpuAccessorHeader">The header of the cached gpu accessor</param>
|
2021-08-11 19:59:42 +01:00
|
|
|
|
public GuestShaderCacheEntryHeader(ShaderStage stage, int size, int sizeA, int cb1DataSize, GuestGpuAccessorHeader gpuAccessorHeader) : this()
|
2020-11-12 23:15:34 +00:00
|
|
|
|
{
|
|
|
|
|
Stage = stage;
|
2021-08-11 19:59:42 +01:00
|
|
|
|
Size = size;
|
2020-11-12 23:15:34 +00:00
|
|
|
|
SizeA = sizeA;
|
2021-08-11 19:59:42 +01:00
|
|
|
|
Cb1DataSize = cb1DataSize;
|
2020-11-12 23:15:34 +00:00
|
|
|
|
GpuAccessorHeader = gpuAccessorHeader;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|