Salieri: shader cache (#1701)
Here come Salieri, my implementation of a disk shader cache! "I'm sure you know why I named it that." "It doesn't really mean anything." This implementation collects shaders at runtime and cache them to be later compiled when starting a game.
This commit is contained in:
parent
7166e82c3c
commit
48f6570557
57 changed files with 3589 additions and 396 deletions
|
@ -0,0 +1,67 @@
|
|||
using System.Runtime.InteropServices;
|
||||
using Ryujinx.Graphics.Shader;
|
||||
|
||||
namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition
|
||||
{
|
||||
/// <summary>
|
||||
/// Host shader entry header used for binding information.
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x14)]
|
||||
struct HostShaderCacheEntryHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Count of constant buffer descriptors.
|
||||
/// </summary>
|
||||
public int CBuffersCount;
|
||||
|
||||
/// <summary>
|
||||
/// Count of storage buffer descriptors.
|
||||
/// </summary>
|
||||
public int SBuffersCount;
|
||||
|
||||
/// <summary>
|
||||
/// Count of texture descriptors.
|
||||
/// </summary>
|
||||
public int TexturesCount;
|
||||
|
||||
/// <summary>
|
||||
/// Count of image descriptors.
|
||||
/// </summary>
|
||||
public int ImagesCount;
|
||||
|
||||
/// <summary>
|
||||
/// Set to true if the shader uses instance id.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool UsesInstanceId;
|
||||
|
||||
/// <summary>
|
||||
/// Set to true if this entry is in use.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.I1)]
|
||||
public bool InUse;
|
||||
|
||||
/// <summary>
|
||||
/// Reserved / unused.
|
||||
/// </summary>
|
||||
public short Reserved;
|
||||
|
||||
/// <summary>
|
||||
/// Create a new host shader cache entry header.
|
||||
/// </summary>
|
||||
/// <param name="cBuffersCount">Count of constant buffer descriptors</param>
|
||||
/// <param name="sBuffersCount">Count of storage buffer descriptors</param>
|
||||
/// <param name="texturesCount">Count of texture descriptors</param>
|
||||
/// <param name="imagesCount">Count of image descriptors</param>
|
||||
/// <param name="usesInstanceId">Set to true if the shader uses instance id</param>
|
||||
public HostShaderCacheEntryHeader(int cBuffersCount, int sBuffersCount, int texturesCount, int imagesCount, bool usesInstanceId) : this()
|
||||
{
|
||||
CBuffersCount = cBuffersCount;
|
||||
SBuffersCount = sBuffersCount;
|
||||
TexturesCount = texturesCount;
|
||||
ImagesCount = imagesCount;
|
||||
UsesInstanceId = usesInstanceId;
|
||||
InUse = true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue