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();