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(); + } + } +}