diff --git a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp index 6f8599cbff..d8fb2c1b5b 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.cpp @@ -276,7 +276,8 @@ void D3D12GSRender::ExecCMD(u32 cmd) { assert(cmd == NV4097_CLEAR_SURFACE); ID3D12GraphicsCommandList *commandList; - m_device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, m_commandAllocator, nullptr, IID_PPV_ARGS(&commandList)); + check(m_device->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, m_commandAllocator, nullptr, IID_PPV_ARGS(&commandList))); + m_inflightCommandList.push_back(commandList); D3D12_RESOURCE_BARRIER transition = {}; transition.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; @@ -711,5 +712,8 @@ void D3D12GSRender::Flip() WaitForSingleObject(gfxqueuecompletion, INFINITE); CloseHandle(gfxqueuecompletion); m_commandAllocator->Reset(); + for (ID3D12GraphicsCommandList *gfxCommandList : m_inflightCommandList) + gfxCommandList->Release(); + m_inflightCommandList.clear(); } #endif \ No newline at end of file diff --git a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.h b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.h index 929fa0a75e..31cdb433de 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12GSRender.h +++ b/rpcs3/Emu/RSX/D3D12/D3D12GSRender.h @@ -66,6 +66,7 @@ private: ID3D12CommandQueue *m_commandQueueCopy; ID3D12CommandQueue *m_commandQueueGraphic; ID3D12CommandAllocator *m_commandAllocator; + std::list m_inflightCommandList; struct IDXGISwapChain3 *m_swapChain; ID3D12Resource* m_backBuffer[2];