using System.Runtime.CompilerServices;
using ComputeSharp.Graphics.Commands;
using ComputeSharp.Shaders.Translation.Interop;
namespace ComputeSharp.Shaders.Translation.Models
{
///
/// A that contains info on a cached shader.
///
/// The type of compute shader in use.
internal readonly struct CachedShader
where T : struct, IComputeShader
{
///
/// The instance with the shader metadata.
///
public readonly ShaderLoader Loader;
///
/// The compiled shader bytecode.
///
public readonly IDxcBlobObject Bytecode;
///
/// The map of cached instances for each GPU in use.
///
public readonly ConditionalWeakTable CachedPipelines;
///
/// Creates a new instance with the specified parameters.
///
/// The instance with the shader metadata.
/// The compiled shader bytecode.
public CachedShader(ShaderLoader loader, IDxcBlobObject bytecode)
{
Loader = loader;
Bytecode = bytecode;
CachedPipelines = new();
}
}
}