Added TerraFX shader runner

このコミットが含まれているのは:
Sergio Pedri committed 2020-11-17 13:37:58 +01:00
1 親 b5f3bf07e3
コミット 124645fde1
2ファイル変更
+246

検索条件に一致するファイルはありません

+42
ファイルの表示
@@ -0,0 +1,42 @@
using System.Runtime.CompilerServices;
using ComputeSharp.Graphics;
using ComputeSharp.Graphics.Commands;
using ComputeSharp.Shaders.Translation.Interop;
namespace ComputeSharp.Shaders.Translation.Models
{
/// <summary>
/// A <see langword="struct"/> that contains info on a cached shader.
/// </summary>
/// <typeparam name="T">The type of compute shader in use.</typeparam>
internal readonly struct CachedShader2<T>
where T : struct, IComputeShader
{
/// <summary>
/// The <see cref="ShaderLoader2{T}"/> instance with the shader metadata.
/// </summary>
public readonly ShaderLoader2<T> Loader;
/// <summary>
/// The compiled shader bytecode.
/// </summary>
public readonly IDxcBlobObject Bytecode;
/// <summary>
/// The map of cached <see cref="PipelineData"/> instances for each GPU in use.
/// </summary>
public readonly ConditionalWeakTable<GraphicsDevice2, PipelineData> CachedPipelines;
/// <summary>
/// Creates a new <see cref="CachedShader{T}"/> instance with the specified parameters.
/// </summary>
/// <param name="loader">The <see cref="ShaderLoader{T}"/> instance with the shader metadata.</param>
/// <param name="bytecode">The compiled shader bytecode.</param>
public CachedShader2(ShaderLoader2<T> loader, IDxcBlobObject bytecode)
{
Loader = loader;
Bytecode = bytecode;
CachedPipelines = new();
}
}
}