diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index e356c77b..f21ed6f2 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -895,7 +895,7 @@ namespace dxvk { cSubmissionId = submissionId ] (DxvkContext* ctx) { ctx->signal(cSubmissionFence, cSubmissionId); - ctx->flushCommandList(); + ctx->flushCommandList(nullptr); }); FlushCsChunk(); diff --git a/src/d3d11/d3d11_initializer.cpp b/src/d3d11/d3d11_initializer.cpp index 44c16e56..d965921c 100644 --- a/src/d3d11/d3d11_initializer.cpp +++ b/src/d3d11/d3d11_initializer.cpp @@ -278,7 +278,7 @@ namespace dxvk { void D3D11Initializer::FlushInternal() { - m_context->flushCommandList(); + m_context->flushCommandList(nullptr); m_transferCommands = 0; m_transferMemory = 0; diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index fbe78a5b..a28978cd 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -415,7 +415,7 @@ namespace dxvk { cCommandList = m_context->endRecording() ] (DxvkContext* ctx) { cCommandList->setWsiSemaphores(cSync); - m_device->submitCommandList(cCommandList); + m_device->submitCommandList(cCommandList, nullptr); if (cHud != nullptr && !cFrameId) cHud->update(); @@ -630,7 +630,8 @@ namespace dxvk { subresources, VK_IMAGE_LAYOUT_UNDEFINED); m_device->submitCommandList( - m_context->endRecording()); + m_context->endRecording(), + nullptr); } diff --git a/src/d3d9/d3d9_device.cpp b/src/d3d9/d3d9_device.cpp index 3291f7e8..3a9fcaf3 100644 --- a/src/d3d9/d3d9_device.cpp +++ b/src/d3d9/d3d9_device.cpp @@ -5253,7 +5253,7 @@ namespace dxvk { // Add commands to flush the threaded // context, then flush the command list EmitCs([](DxvkContext* ctx) { - ctx->flushCommandList(); + ctx->flushCommandList(nullptr); }); FlushCsChunk(); diff --git a/src/d3d9/d3d9_format_helpers.cpp b/src/d3d9/d3d9_format_helpers.cpp index f12592da..f0cdd2b6 100644 --- a/src/d3d9/d3d9_format_helpers.cpp +++ b/src/d3d9/d3d9_format_helpers.cpp @@ -142,7 +142,7 @@ namespace dxvk { void D3D9FormatHelper::FlushInternal() { - m_context->flushCommandList(); + m_context->flushCommandList(nullptr); m_transferCommands = 0; } diff --git a/src/d3d9/d3d9_initializer.cpp b/src/d3d9/d3d9_initializer.cpp index a44674f9..26dae412 100644 --- a/src/d3d9/d3d9_initializer.cpp +++ b/src/d3d9/d3d9_initializer.cpp @@ -153,7 +153,7 @@ namespace dxvk { void D3D9Initializer::FlushInternal() { - m_context->flushCommandList(); + m_context->flushCommandList(nullptr); m_transferCommands = 0; m_transferMemory = 0; diff --git a/src/d3d9/d3d9_swapchain.cpp b/src/d3d9/d3d9_swapchain.cpp index 89c356fb..b65f3ee7 100644 --- a/src/d3d9/d3d9_swapchain.cpp +++ b/src/d3d9/d3d9_swapchain.cpp @@ -730,7 +730,7 @@ namespace dxvk { cCommandList = m_context->endRecording() ] (DxvkContext* ctx) { cCommandList->setWsiSemaphores(cSync); - m_device->submitCommandList(cCommandList); + m_device->submitCommandList(cCommandList, nullptr); if (cHud != nullptr && !cFrameId) cHud->update(); @@ -927,7 +927,8 @@ namespace dxvk { } m_device->submitCommandList( - m_context->endRecording()); + m_context->endRecording(), + nullptr); } diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index b0f03a6e..dce568a5 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -101,9 +101,9 @@ namespace dxvk { } - void DxvkContext::flushCommandList() { + void DxvkContext::flushCommandList(DxvkSubmitStatus* status) { m_device->submitCommandList( - this->endRecording()); + this->endRecording(), status); this->beginRecording( m_device->createCommandList()); diff --git a/src/dxvk/dxvk_context.h b/src/dxvk/dxvk_context.h index 2da97d97..8a2ab090 100644 --- a/src/dxvk/dxvk_context.h +++ b/src/dxvk/dxvk_context.h @@ -6,6 +6,7 @@ #include "dxvk_context_state.h" #include "dxvk_data.h" #include "dxvk_objects.h" +#include "dxvk_queue.h" #include "dxvk_resource.h" #include "dxvk_util.h" #include "dxvk_marker.h" @@ -63,8 +64,9 @@ namespace dxvk { * * Transparently submits the current command * buffer and allocates a new one. + * \param [out] status Submission feedback */ - void flushCommandList(); + void flushCommandList(DxvkSubmitStatus* status); /** * \brief Begins generating query data diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index a6b403ab..a14f428f 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -256,10 +256,11 @@ namespace dxvk { void DxvkDevice::submitCommandList( - const Rc& commandList) { + const Rc& commandList, + DxvkSubmitStatus* status) { DxvkSubmitInfo submitInfo = { }; submitInfo.cmdList = commandList; - m_submissionQueue.submit(submitInfo); + m_submissionQueue.submit(submitInfo, status); std::lock_guard statLock(m_statLock); m_statCounters.merge(commandList->statCounters()); diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h index 5f5037a9..f967a5bb 100644 --- a/src/dxvk/dxvk_device.h +++ b/src/dxvk/dxvk_device.h @@ -452,9 +452,11 @@ namespace dxvk { * Submits the given command list to the device using * the given set of optional synchronization primitives. * \param [in] commandList The command list to submit + * \param [out] status Submission feedback */ void submitCommandList( - const Rc& commandList); + const Rc& commandList, + DxvkSubmitStatus* status); /** * \brief Locks submission queue diff --git a/src/dxvk/dxvk_queue.cpp b/src/dxvk/dxvk_queue.cpp index 79762f65..f6585231 100644 --- a/src/dxvk/dxvk_queue.cpp +++ b/src/dxvk/dxvk_queue.cpp @@ -26,7 +26,7 @@ namespace dxvk { } - void DxvkSubmissionQueue::submit(DxvkSubmitInfo submitInfo) { + void DxvkSubmissionQueue::submit(DxvkSubmitInfo submitInfo, DxvkSubmitStatus* status) { std::unique_lock lock(m_mutex); m_finishCond.wait(lock, [this] { @@ -34,6 +34,7 @@ namespace dxvk { }); DxvkSubmitEntry entry = { }; + entry.status = status; entry.submit = std::move(submitInfo); m_pending += 1; diff --git a/src/dxvk/dxvk_queue.h b/src/dxvk/dxvk_queue.h index 294d2792..14f1e21b 100644 --- a/src/dxvk/dxvk_queue.h +++ b/src/dxvk/dxvk_queue.h @@ -110,10 +110,12 @@ namespace dxvk { * Queues a command list for submission on the * dedicated submission thread. Use this to take * the submission overhead off the calling thread. - * \param [in] submitInfo Submission parameters + * \param [in] submitInfo Submission parameters + * \param [out] status Submission feedback */ void submit( - DxvkSubmitInfo submitInfo); + DxvkSubmitInfo submitInfo, + DxvkSubmitStatus* status); /** * \brief Presents an image synchronously @@ -122,7 +124,7 @@ namespace dxvk { * and then presents the current swap chain image * of the presenter. May stall the calling thread. * \param [in] present Present parameters - * \returns Status of the operation + * \param [out] status Submission feedback */ void present( DxvkPresentInfo presentInfo,