diff --git a/renderdoc/driver/d3d12/d3d12_postvs.cpp b/renderdoc/driver/d3d12/d3d12_postvs.cpp index 7fdf4d1f6..1b6c67cf9 100644 --- a/renderdoc/driver/d3d12/d3d12_postvs.cpp +++ b/renderdoc/driver/d3d12/d3d12_postvs.cpp @@ -978,6 +978,20 @@ void D3D12Replay::InitPostVSBuffers(uint32_t eventId) list->DrawInstanced(drawcall->numIndices, inst, drawcall->vertexOffset, drawcall->instanceOffset); } + + // Instanced draws with a wild number of instances can hang the GPU, sync after every 1000 + if((inst % 1000) == 0) + { + list->Close(); + + l = list; + m_pDevice->GetQueue()->ExecuteCommandLists(1, &l); + m_pDevice->GPUSync(); + + GetDebugManager()->ResetDebugAlloc(); + + list = GetDebugManager()->ResetDebugList(); + } } list->Close();