From 22fecb41fc85f3c2ef6a3f1e1d422dd6b6e9a76b Mon Sep 17 00:00:00 2001 From: Robin Kertels Date: Sat, 29 Oct 2022 09:49:03 +0200 Subject: [PATCH] VideoBackends:D3D12: Don't query GPU descriptor handle for non-shader visible heap Fixes the following error in the D3D12 debug layer: D3D12 ERROR: ID3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart: GetGPUDescriptorHandleForHeapStart is invalid to call on a descriptor heap that does not have DESCRIPTOR_HEAP_FLAG_SHADER_VISIBLE set. If the heap is not supposed to be shader visible, then GetCPUDescriptorHandleForHeapStart would be the appropriate method to call. That call is valid both for shader visible and non shader visible descriptor heaps. [ STATE_GETTING ERROR #1315: DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE] --- Source/Core/VideoBackends/D3D12/DescriptorHeapManager.cpp | 3 +-- Source/Core/VideoBackends/D3D12/DescriptorHeapManager.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.cpp b/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.cpp index 97d0c8ce2e..9827057626 100644 --- a/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.cpp +++ b/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.cpp @@ -25,7 +25,6 @@ bool DescriptorHeapManager::Create(ID3D12Device* device, D3D12_DESCRIPTOR_HEAP_T return false; m_heap_base_cpu = m_descriptor_heap->GetCPUDescriptorHandleForHeapStart(); - m_heap_base_gpu = m_descriptor_heap->GetGPUDescriptorHandleForHeapStart(); m_num_descriptors = num_descriptors; m_descriptor_increment_size = device->GetDescriptorHandleIncrementSize(type); @@ -60,7 +59,7 @@ bool DescriptorHeapManager::Allocate(DescriptorHandle* handle) handle->index = index; handle->cpu_handle.ptr = m_heap_base_cpu.ptr + index * m_descriptor_increment_size; - handle->gpu_handle.ptr = m_heap_base_gpu.ptr + index * m_descriptor_increment_size; + handle->gpu_handle.ptr = 0; return true; } diff --git a/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.h b/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.h index 7ff42c8e5b..c7c00d518f 100644 --- a/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.h +++ b/Source/Core/VideoBackends/D3D12/DescriptorHeapManager.h @@ -41,7 +41,6 @@ private: u32 m_descriptor_increment_size = 0; D3D12_CPU_DESCRIPTOR_HANDLE m_heap_base_cpu = {}; - D3D12_GPU_DESCRIPTOR_HANDLE m_heap_base_gpu = {}; static constexpr u32 BITSET_SIZE = 1024; using BitSetType = std::bitset;