From 44ae897149ffbd540e845c8dd28e7de835140bfe Mon Sep 17 00:00:00 2001 From: dreamsyntax Date: Sat, 14 Mar 2026 20:59:08 -0700 Subject: [PATCH 1/2] fix: fallback to UPLOAD heapType Fixes Intel iGPU (UMA architecture) bug (or any GPU without D3D12_HEAP_TYPE_GPU_UPLOAD) Previously even when gpuUploadHeapFallback = true it was still returning the heap with GPU_UPLOAD instead of UPLOAD. --- plume_d3d12.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plume_d3d12.cpp b/plume_d3d12.cpp index 2cdcf18..411faf0 100644 --- a/plume_d3d12.cpp +++ b/plume_d3d12.cpp @@ -465,7 +465,7 @@ namespace plume { } } - static D3D12_HEAP_TYPE toD3D12(RenderHeapType type) { + static D3D12_HEAP_TYPE toD3D12(RenderHeapType type, bool gpuUploadHeapFallback) { switch (type) { case RenderHeapType::DEFAULT: return D3D12_HEAP_TYPE_DEFAULT; @@ -474,6 +474,9 @@ namespace plume { case RenderHeapType::READBACK: return D3D12_HEAP_TYPE_READBACK; case RenderHeapType::GPU_UPLOAD: + if (gpuUploadHeapFallback) { + return D3D12_HEAP_TYPE_UPLOAD; + } return D3D12_HEAP_TYPE_GPU_UPLOAD; default: assert(false && "Unknown heap type."); @@ -2757,7 +2760,7 @@ namespace plume { D3D12MA::ALLOCATION_DESC allocationDesc = {}; allocationDesc.Flags = desc.committed ? D3D12MA::ALLOCATION_FLAG_COMMITTED : D3D12MA::ALLOCATION_FLAG_NONE; - allocationDesc.HeapType = toD3D12(desc.heapType); + allocationDesc.HeapType = toD3D12(desc.heapType, device->gpuUploadHeapFallback); allocationDesc.CustomPool = (pool != nullptr) ? pool->d3d : nullptr; HRESULT res = device->allocator->CreateResource(&allocationDesc, &resourceDesc, resourceStates, nullptr, &allocation, IID_PPV_ARGS(&d3d)); @@ -2931,7 +2934,7 @@ namespace plume { poolDesc.HeapProperties = device->d3d->GetCustomHeapProperties(0, D3D12_HEAP_TYPE_UPLOAD); } else { - poolDesc.HeapProperties.Type = toD3D12(desc.heapType); + poolDesc.HeapProperties.Type = toD3D12(desc.heapType, gpuUploadHeapFallback); } poolDesc.MinBlockCount = desc.minBlockCount; From fb38245c2456f71a52ad25e30780049c82d61ff5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dar=C3=ADo?= Date: Tue, 17 Mar 2026 08:55:18 -0300 Subject: [PATCH 2/2] Apply suggestion from @DarioSamo --- plume_d3d12.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plume_d3d12.cpp b/plume_d3d12.cpp index 411faf0..daea405 100644 --- a/plume_d3d12.cpp +++ b/plume_d3d12.cpp @@ -474,10 +474,7 @@ namespace plume { case RenderHeapType::READBACK: return D3D12_HEAP_TYPE_READBACK; case RenderHeapType::GPU_UPLOAD: - if (gpuUploadHeapFallback) { - return D3D12_HEAP_TYPE_UPLOAD; - } - return D3D12_HEAP_TYPE_GPU_UPLOAD; + return gpuUploadHeapFallback ? D3D12_HEAP_TYPE_UPLOAD : D3D12_HEAP_TYPE_GPU_UPLOAD; default: assert(false && "Unknown heap type."); return D3D12_HEAP_TYPE_DEFAULT;