mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-23 15:06:32 +00:00
Reset command allocators each frame, after syncing GPU
This commit is contained in:
@@ -2783,6 +2783,13 @@ void WrappedID3D12Device::ReplayLog(uint32_t startEventID, uint32_t endEventID,
|
||||
m_Queues[i]->Signal(m_QueueFences[i], m_GPUSyncCounter);
|
||||
|
||||
FlushLists(true);
|
||||
|
||||
// take this opportunity to reset command allocators to ensure we don't steadily leak over time.
|
||||
if(m_DataUploadAlloc)
|
||||
m_DataUploadAlloc->Reset();
|
||||
|
||||
for(ID3D12CommandAllocator *alloc : m_CommandAllocators)
|
||||
alloc->Reset();
|
||||
}
|
||||
|
||||
if(!partial)
|
||||
|
||||
@@ -250,6 +250,8 @@ private:
|
||||
HANDLE m_GPUSyncHandle;
|
||||
UINT64 m_GPUSyncCounter;
|
||||
|
||||
std::vector<ID3D12CommandAllocator *> m_CommandAllocators;
|
||||
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE AllocRTV();
|
||||
void FreeRTV(D3D12_CPU_DESCRIPTOR_HANDLE handle);
|
||||
|
||||
|
||||
@@ -159,6 +159,8 @@ bool WrappedID3D12Device::Serialise_CreateCommandAllocator(SerialiserType &ser,
|
||||
{
|
||||
ret = new WrappedID3D12CommandAllocator(ret, this);
|
||||
|
||||
m_CommandAllocators.push_back(ret);
|
||||
|
||||
GetResourceManager()->AddLiveResource(pCommandAllocator, ret);
|
||||
|
||||
AddResource(pCommandAllocator, ResourceType::Pool, "Command Queue");
|
||||
|
||||
Reference in New Issue
Block a user