From bc1384b7b4eb6c36b8d288829d61a6d81cd9199e Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 29 Jun 2018 12:44:52 +0200 Subject: [PATCH] [d3d11] Issue warning when using a command list more than once The way buffers are invalidated can cause issues when the same command list is submitted multiple times. Games don't seem to need this right now. --- src/d3d11/d3d11_cmdlist.cpp | 13 +++++++++++++ src/d3d11/d3d11_cmdlist.h | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/src/d3d11/d3d11_cmdlist.cpp b/src/d3d11/d3d11_cmdlist.cpp index b46c9419b..274ee4e2e 100644 --- a/src/d3d11/d3d11_cmdlist.cpp +++ b/src/d3d11/d3d11_cmdlist.cpp @@ -52,12 +52,25 @@ namespace dxvk { for (const auto& chunk : m_chunks) cmdList->m_chunks.push_back(chunk); + + MarkSubmitted(); } void D3D11CommandList::EmitToCsThread(DxvkCsThread* CsThread) { for (const auto& chunk : m_chunks) CsThread->dispatchChunk(Rc(chunk)); + + MarkSubmitted(); + } + + + void D3D11CommandList::MarkSubmitted() { + if (m_submitted.exchange(true) && !m_warned.exchange(true)) { + Logger::warn( + "D3D11: Command list submitted multiple times.\n" + " This is currently not supported."); + } } } \ No newline at end of file diff --git a/src/d3d11/d3d11_cmdlist.h b/src/d3d11/d3d11_cmdlist.h index d15419ccb..4f7fcef43 100644 --- a/src/d3d11/d3d11_cmdlist.h +++ b/src/d3d11/d3d11_cmdlist.h @@ -38,6 +38,11 @@ namespace dxvk { UINT const m_contextFlags; std::vector> m_chunks; + + std::atomic m_submitted = { false }; + std::atomic m_warned = { false }; + + void MarkSubmitted(); };