From 2eeb7295c8bad508d8f96cb3628bf2b08e4d37c5 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 9 Feb 2022 03:21:58 +0100 Subject: [PATCH] [d3d11] Increment sequence number when submitting command lists This does not do any tracking on deferred contexts just yet. --- src/d3d11/d3d11_cmdlist.cpp | 7 +++++-- src/d3d11/d3d11_cmdlist.h | 2 +- src/d3d11/d3d11_context_imm.cpp | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/d3d11/d3d11_cmdlist.cpp b/src/d3d11/d3d11_cmdlist.cpp index 0ce56211a..1dadcbe27 100644 --- a/src/d3d11/d3d11_cmdlist.cpp +++ b/src/d3d11/d3d11_cmdlist.cpp @@ -62,14 +62,17 @@ namespace dxvk { } - void D3D11CommandList::EmitToCsThread(DxvkCsThread* CsThread) { + uint64_t D3D11CommandList::EmitToCsThread(DxvkCsThread* CsThread) { + uint64_t seq = 0; + for (const auto& query : m_queries) query->DoDeferredEnd(); for (const auto& chunk : m_chunks) - CsThread->dispatchChunk(DxvkCsChunkRef(chunk)); + seq = CsThread->dispatchChunk(DxvkCsChunkRef(chunk)); MarkSubmitted(); + return seq; } diff --git a/src/d3d11/d3d11_cmdlist.h b/src/d3d11/d3d11_cmdlist.h index ce207aaf4..2b942a131 100644 --- a/src/d3d11/d3d11_cmdlist.h +++ b/src/d3d11/d3d11_cmdlist.h @@ -29,7 +29,7 @@ namespace dxvk { void EmitToCommandList( ID3D11CommandList* pCommandList); - void EmitToCsThread( + uint64_t EmitToCsThread( DxvkCsThread* CsThread); private: diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 5d77f2e60..0c2073282 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -212,7 +212,8 @@ namespace dxvk { // Dispatch command list to the CS thread and // restore the immediate context's state - commandList->EmitToCsThread(&m_csThread); + uint64_t csSeqNum = commandList->EmitToCsThread(&m_csThread); + m_csSeqNum = std::max(m_csSeqNum, csSeqNum); if (RestoreContextState) RestoreState();