From 145fc5817e0168ebecc0e629c3ce3c830bdac35f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 17 Nov 2020 02:29:23 +0100 Subject: [PATCH] Added IDxcBlobObject type --- .../Translation/Interop/IDxcBlobObject.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/ComputeSharp.Shaders/Translation/Interop/IDxcBlobObject.cs diff --git a/src/ComputeSharp.Shaders/Translation/Interop/IDxcBlobObject.cs b/src/ComputeSharp.Shaders/Translation/Interop/IDxcBlobObject.cs new file mode 100644 index 00000000..fe2c4ab2 --- /dev/null +++ b/src/ComputeSharp.Shaders/Translation/Interop/IDxcBlobObject.cs @@ -0,0 +1,36 @@ +using ComputeSharp.Core.Interop; +using TerraFX.Interop; + +namespace ComputeSharp.Shaders.Translation.Interop +{ + /// + /// An object wrapping an instance. + /// + internal sealed unsafe class IDxcBlobObject : NativeObject + { + /// + /// The instance currently in use. + /// + private ComPtr dxcBlob; + + /// + /// Creates a new instance with the specified parameters. + /// + /// The instance to wrap. + public IDxcBlobObject(ComPtr dxcBlob) + { + this.dxcBlob = dxcBlob; + } + + /// + /// Gets a raw pointer to the instance in use. + /// + public IDxcBlob* DxcBlob => this.dxcBlob; + + /// + protected override void OnDispose() + { + this.dxcBlob.Dispose(); + } + } +}