diff --git a/src/ComputeSharp.D3D12MemoryAllocator/D3D12MemoryAllocatorFactory.cs b/src/ComputeSharp.D3D12MemoryAllocator/D3D12MemoryAllocatorFactory.cs new file mode 100644 index 00000000..7c95646d --- /dev/null +++ b/src/ComputeSharp.D3D12MemoryAllocator/D3D12MemoryAllocatorFactory.cs @@ -0,0 +1,26 @@ +using ComputeSharp.Core.Extensions; +using ComputeSharp.D3D12MemoryAllocator.Interop; + +namespace ComputeSharp.D3D12MemoryAllocator; + +/// +/// The entry point to obtain ID3D12MemoryAllocatorFactory instances using D3D12MA. +/// +public static unsafe class D3D12MemoryAllocatorFactory +{ + /// + /// Creates a new ID3D12MemoryAllocatorFactory instance for D3D12MA. + /// + /// The resulting ID3D12MemoryAllocatorFactory instance for D3D12MA. + /// + /// This method should only be used to provide an argument for . + /// + public static void* CreateInstance() + { + ID3D12MemoryAllocatorFactoryImpl* allocatorFactory = null; + + ID3D12MemoryAllocatorFactoryImpl.Factory(&allocatorFactory).Assert(); + + return allocatorFactory; + } +}