mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-07 23:55:04 -06:00
d3d12: Fix gfxcommandlist leak
This commit is contained in:
parent
b1c3e09155
commit
2f5a6eb993
@ -276,7 +276,8 @@ void D3D12GSRender::ExecCMD(u32 cmd)
|
|||||||
{
|
{
|
||||||
assert(cmd == NV4097_CLEAR_SURFACE);
|
assert(cmd == NV4097_CLEAR_SURFACE);
|
||||||
ID3D12GraphicsCommandList *commandList;
|
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 = {};
|
D3D12_RESOURCE_BARRIER transition = {};
|
||||||
transition.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
|
transition.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
|
||||||
@ -711,5 +712,8 @@ void D3D12GSRender::Flip()
|
|||||||
WaitForSingleObject(gfxqueuecompletion, INFINITE);
|
WaitForSingleObject(gfxqueuecompletion, INFINITE);
|
||||||
CloseHandle(gfxqueuecompletion);
|
CloseHandle(gfxqueuecompletion);
|
||||||
m_commandAllocator->Reset();
|
m_commandAllocator->Reset();
|
||||||
|
for (ID3D12GraphicsCommandList *gfxCommandList : m_inflightCommandList)
|
||||||
|
gfxCommandList->Release();
|
||||||
|
m_inflightCommandList.clear();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -66,6 +66,7 @@ private:
|
|||||||
ID3D12CommandQueue *m_commandQueueCopy;
|
ID3D12CommandQueue *m_commandQueueCopy;
|
||||||
ID3D12CommandQueue *m_commandQueueGraphic;
|
ID3D12CommandQueue *m_commandQueueGraphic;
|
||||||
ID3D12CommandAllocator *m_commandAllocator;
|
ID3D12CommandAllocator *m_commandAllocator;
|
||||||
|
std::list<ID3D12GraphicsCommandList *> m_inflightCommandList;
|
||||||
struct IDXGISwapChain3 *m_swapChain;
|
struct IDXGISwapChain3 *m_swapChain;
|
||||||
ID3D12Resource* m_backBuffer[2];
|
ID3D12Resource* m_backBuffer[2];
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user