Make debug sampler heap large enough and assert on sizes

This commit is contained in:
baldurk
2025-10-29 12:14:52 +00:00
parent 55d886a1d5
commit 346d437c50
2 changed files with 16 additions and 5 deletions
+11 -5
View File
@@ -146,7 +146,7 @@ D3D12DebugManager::D3D12DebugManager(WrappedID3D12Device *wrapper)
desc.NumDescriptors = rtvCount;
desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_RTV;
RDCCOMPILE_ASSERT(LAST_WIN_RTV < rtvCount, "Increase size of RTV heap");
RDCCOMPILE_ASSERT(MAX_RTV_SLOT < rtvCount, "Increase size of RTV heap");
hr = m_pDevice->CreateDescriptorHeap(&desc, __uuidof(ID3D12DescriptorHeap), (void **)&rtvHeap);
m_pDevice->InternalRef();
@@ -163,7 +163,7 @@ D3D12DebugManager::D3D12DebugManager(WrappedID3D12Device *wrapper)
desc.NumDescriptors = dsvCount;
desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV;
RDCCOMPILE_ASSERT(LAST_WIN_DSV < dsvCount, "Increase size of DSV heap");
RDCCOMPILE_ASSERT(MAX_DSV_SLOT < dsvCount, "Increase size of DSV heap");
hr = m_pDevice->CreateDescriptorHeap(&desc, __uuidof(ID3D12DescriptorHeap), (void **)&dsvHeap);
m_pDevice->InternalRef();
@@ -175,10 +175,12 @@ D3D12DebugManager::D3D12DebugManager(WrappedID3D12Device *wrapper)
rm->SetInternalResource(dsvHeap);
desc.NumDescriptors = 4096;
const uint32_t srvCount = 4096;
desc.NumDescriptors = srvCount;
desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV;
RDCCOMPILE_ASSERT(MAX_SRV_SLOT < 4096, "Increase size of CBV/SRV/UAV heap");
RDCCOMPILE_ASSERT(MAX_SRV_SLOT < srvCount, "Increase size of CBV/SRV/UAV heap");
hr = m_pDevice->CreateDescriptorHeap(&desc, __uuidof(ID3D12DescriptorHeap), (void **)&uavClearHeap);
m_pDevice->InternalRef();
@@ -203,9 +205,13 @@ D3D12DebugManager::D3D12DebugManager(WrappedID3D12Device *wrapper)
rm->SetInternalResource(cbvsrvuavHeap);
desc.NumDescriptors = 16;
const uint32_t samplerCount = 300;
desc.NumDescriptors = samplerCount;
desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER;
RDCCOMPILE_ASSERT(MAX_SAMPLER_SLOT < samplerCount, "Increase size of sampler heap");
hr = m_pDevice->CreateDescriptorHeap(&desc, __uuidof(ID3D12DescriptorHeap), (void **)&samplerHeap);
m_pDevice->InternalRef();
+5
View File
@@ -118,6 +118,8 @@ enum RTVSlot
LAST_TMP_RTV = FIRST_TMP_RTV + 16,
FIRST_WIN_RTV,
LAST_WIN_RTV = FIRST_WIN_RTV + 768,
MAX_RTV_SLOT,
};
enum SamplerSlot
@@ -128,6 +130,7 @@ enum SamplerSlot
SHADDEBUG_SAMPLER0,
LAST_SHADDEBUG_SAMPLER = SHADDEBUG_SAMPLER0 + ShaderDebugConstants::COUNT_SAMPLERS_PER_DEBUG *
ShaderDebugConstants::MAX_SHADER_DEBUG_QUEUED_OPS,
MAX_SAMPLER_SLOT,
};
enum DSVSlot
@@ -138,6 +141,8 @@ enum DSVSlot
TMP_DSV,
FIRST_WIN_DSV,
LAST_WIN_DSV = FIRST_WIN_DSV + 64,
MAX_DSV_SLOT
};
struct MeshDisplayPipelines