From e4d027a79c202e40333b68820d267e2d538a71dc Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Fri, 23 May 2025 17:06:50 +0100 Subject: [PATCH] D3D12 ShaderDebugger reset the debug allocator after submits Performance win for shader debugger for ops run on the GPU (math, sample) Fixes GPU errors if the shader debugger does a very large amount of GPU ops --- renderdoc/driver/d3d12/d3d12_shaderdebug.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp index c88c7abfd..05e4ef4c9 100644 --- a/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp +++ b/renderdoc/driver/d3d12/d3d12_shaderdebug.cpp @@ -128,6 +128,7 @@ bool D3D12ShaderDebug::CalculateMathIntrinsic(bool dxil, WrappedID3D12Device *de ID3D12CommandList *l = cmdList; device->GetQueue()->ExecuteCommandLists(1, &l); device->InternalQueueWaitForIdle(); + device->GetDebugManager()->ResetDebugAlloc(); } D3D12_RANGE range = {0, sizeof(Vec4f) * 6}; @@ -373,6 +374,7 @@ bool D3D12ShaderDebug::CalculateSampleGather( ID3D12CommandList *l = cmdList; device->GetQueue()->ExecuteCommandLists(1, &l); device->InternalQueueWaitForIdle(); + device->GetDebugManager()->ResetDebugAlloc(); } rs = prevState; @@ -2314,6 +2316,7 @@ ShaderDebugTrace *D3D12Replay::DebugVertex(uint32_t eventId, uint32_t vertid, ui ID3D12CommandList *l = cmdList; m_pDevice->GetQueue()->ExecuteCommandLists(1, &l); m_pDevice->InternalQueueWaitForIdle(); + m_pDevice->GetDebugManager()->ResetDebugAlloc(); } { @@ -2917,6 +2920,7 @@ ShaderDebugTrace *D3D12Replay::DebugPixel(uint32_t eventId, uint32_t x, uint32_t ID3D12CommandList *l = cmdList; m_pDevice->GetQueue()->ExecuteCommandLists(1, &l); m_pDevice->InternalQueueWaitForIdle(); + m_pDevice->GetDebugManager()->ResetDebugAlloc(); } { @@ -3551,6 +3555,7 @@ ShaderDebugTrace *D3D12Replay::DebugThread(uint32_t eventId, ID3D12CommandList *l = cmdList; m_pDevice->GetQueue()->ExecuteCommandLists(1, &l); m_pDevice->InternalQueueWaitForIdle(); + m_pDevice->GetDebugManager()->ResetDebugAlloc(); } {