From 58f6799d7d951726639b7eb8096f5d6d4233878e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Thu, 4 Aug 2022 15:17:44 +0200 Subject: [PATCH] Fix two allocations using D3D12MA without custom pools --- .../Graphics/Resources/Abstract/StructuredBuffer{T}.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs b/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs index 5ccda018..9ec2c94b 100644 --- a/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs +++ b/src/ComputeSharp/Graphics/Resources/Abstract/StructuredBuffer{T}.cs @@ -65,7 +65,7 @@ public abstract class StructuredBuffer : Buffer nint byteLength = count * sizeof(T); #if NET6_0_OR_GREATER - using ComPtr allocation = GraphicsDevice.Allocator->CreateResource(null, ResourceType.ReadBack, AllocationMode.Default, (ulong)byteLength); + using ComPtr allocation = GraphicsDevice.Allocator->CreateResource(GraphicsDevice.Pool, ResourceType.ReadBack, AllocationMode.Default, (ulong)byteLength); #else using ComPtr d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource( ResourceType.ReadBack, @@ -226,7 +226,7 @@ public abstract class StructuredBuffer : Buffer nint byteLength = length * sizeof(T); #if NET6_0_OR_GREATER - using ComPtr allocation = GraphicsDevice.Allocator->CreateResource(null, ResourceType.Upload, AllocationMode.Default, (ulong)byteLength); + using ComPtr allocation = GraphicsDevice.Allocator->CreateResource(GraphicsDevice.Pool, ResourceType.Upload, AllocationMode.Default, (ulong)byteLength); #else using ComPtr d3D12Resource = GraphicsDevice.D3D12Device->CreateCommittedResource( ResourceType.Upload,