From a7e3d6bec9a5dcdd15bc0bb901382a96c9ac0c84 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 12 Apr 2020 20:24:30 +0200 Subject: [PATCH] Added CachedShader type --- .../Translation/Models/CachedShader{T}.cs | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/ComputeSharp.Shaders/Translation/Models/CachedShader{T}.cs diff --git a/src/ComputeSharp.Shaders/Translation/Models/CachedShader{T}.cs b/src/ComputeSharp.Shaders/Translation/Models/CachedShader{T}.cs new file mode 100644 index 00000000..3b0005e0 --- /dev/null +++ b/src/ComputeSharp.Shaders/Translation/Models/CachedShader{T}.cs @@ -0,0 +1,33 @@ +using Vortice.Direct3D12; + +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 ShaderBytecode Bytecode; + + /// + /// Creates a new instance with the specified parameters + /// + /// The instance with the shader metadata + /// The compiled shader bytecode + public CachedShader(ShaderLoader loader, ShaderBytecode bytecode) + { + Loader = loader; + Bytecode = bytecode; + } + } +}