From 9926ff416e979bbe6d008f0d4dbae936717e6876 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sat, 28 Sep 2019 22:36:52 +0200 Subject: [PATCH] Minor code tweaks --- src/ComputeSharp.Graphics/DescriptorAllocator.cs | 8 ++++---- src/ComputeSharp.Graphics/GraphicsDevice.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ComputeSharp.Graphics/DescriptorAllocator.cs b/src/ComputeSharp.Graphics/DescriptorAllocator.cs index 38ffbb17..a1b92065 100644 --- a/src/ComputeSharp.Graphics/DescriptorAllocator.cs +++ b/src/ComputeSharp.Graphics/DescriptorAllocator.cs @@ -41,10 +41,10 @@ namespace ComputeSharp.Graphics /// /// Creates a new instance with the specified parameters /// - /// The instance to use - public DescriptorAllocator(GraphicsDevice device) + /// The instance to use + public DescriptorAllocator(ID3D12Device device) { - DescriptorSize = device.NativeDevice.GetDescriptorHandleIncrementSize(DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView); + DescriptorSize = device.GetDescriptorHandleIncrementSize(DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView); DescriptorHeapDescription descriptorHeapDescription = new DescriptorHeapDescription { @@ -53,7 +53,7 @@ namespace ComputeSharp.Graphics Type = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView }; - DescriptorHeap = device.NativeDevice.CreateDescriptorHeap(descriptorHeapDescription); + DescriptorHeap = device.CreateDescriptorHeap(descriptorHeapDescription); _RemainingHandles = DescriptorsPerHeap; _CurrentCpuHandle = DescriptorHeap.GetCPUDescriptorHandleForHeapStart(); diff --git a/src/ComputeSharp.Graphics/GraphicsDevice.cs b/src/ComputeSharp.Graphics/GraphicsDevice.cs index a2327892..4275c34e 100644 --- a/src/ComputeSharp.Graphics/GraphicsDevice.cs +++ b/src/ComputeSharp.Graphics/GraphicsDevice.cs @@ -63,7 +63,7 @@ namespace ComputeSharp.Graphics NativeCopyFence = NativeDevice.CreateFence(0); NativeDirectFence = NativeDevice.CreateFence(0); - ShaderResourceViewAllocator = new DescriptorAllocator(this); + ShaderResourceViewAllocator = new DescriptorAllocator(NativeDevice); } ///