diff --git a/src/d3d11/d3d11_swapchain.cpp b/src/d3d11/d3d11_swapchain.cpp index 74105b2c6..d97ed50f5 100644 --- a/src/d3d11/d3d11_swapchain.cpp +++ b/src/d3d11/d3d11_swapchain.cpp @@ -205,9 +205,6 @@ namespace dxvk { auto immediateContext = static_cast(deviceContext.ptr()); immediateContext->Flush(); - if (!m_device->hasAsyncPresent()) - immediateContext->SynchronizeCsThread(); - // Wait for the sync event so that we respect the maximum frame latency auto syncEvent = m_dxgiDevice->GetFrameSyncEvent(m_desc.BufferCount); syncEvent->wait(); @@ -321,34 +318,22 @@ namespace dxvk { void D3D11SwapChain::SubmitPresent( D3D11ImmediateContext* pContext, const vk::PresenterSync& Sync) { - if (m_device->hasAsyncPresent()) { - // Present from CS thread so that we don't - // have to synchronize with it first. - m_presentStatus.result = VK_NOT_READY; + // Present from CS thread so that we don't + // have to synchronize with it first. + m_presentStatus.result = VK_NOT_READY; - pContext->EmitCs([this, - cSync = Sync, - cCommandList = m_context->endRecording() - ] (DxvkContext* ctx) { - m_device->submitCommandList(cCommandList, - cSync.acquire, cSync.present); + pContext->EmitCs([this, + cSync = Sync, + cCommandList = m_context->endRecording() + ] (DxvkContext* ctx) { + m_device->submitCommandList(cCommandList, + cSync.acquire, cSync.present); - m_device->presentImage(m_presenter, - cSync.present, &m_presentStatus); - }); - - pContext->FlushCsChunk(); - } else { - // Safe path, present from calling thread - m_device->submitCommandList( - m_context->endRecording(), - Sync.acquire, Sync.present); - m_device->presentImage(m_presenter, - Sync.present, &m_presentStatus); + cSync.present, &m_presentStatus); + }); - SynchronizePresent(); - } + pContext->FlushCsChunk(); } diff --git a/src/dxvk/dxvk_device.h b/src/dxvk/dxvk_device.h index ef0115f1e..7565b3404 100644 --- a/src/dxvk/dxvk_device.h +++ b/src/dxvk/dxvk_device.h @@ -401,17 +401,6 @@ namespace dxvk { VkSemaphore waitSync, VkSemaphore wakeSync); - /** - * \brief Checks for async presentation support - * - * If this is \c false, synchronize with the - * present call immediately after submitting it. - * \returns \c true if async present is enabled - */ - bool hasAsyncPresent() const { - return m_submissionQueue.hasAsyncPresent(); - } - /** * \brief Locks submission queue * diff --git a/src/dxvk/dxvk_options.cpp b/src/dxvk/dxvk_options.cpp index 603000b60..904082f6e 100644 --- a/src/dxvk/dxvk_options.cpp +++ b/src/dxvk/dxvk_options.cpp @@ -6,7 +6,6 @@ namespace dxvk { enableStateCache = config.getOption ("dxvk.enableStateCache", true); enableOpenVR = config.getOption ("dxvk.enableOpenVR", true); numCompilerThreads = config.getOption ("dxvk.numCompilerThreads", 0); - asyncPresent = config.getOption("dxvk.asyncPresent", Tristate::Auto); useRawSsbo = config.getOption("dxvk.useRawSsbo", Tristate::Auto); useEarlyDiscard = config.getOption("dxvk.useEarlyDiscard", Tristate::Auto); hud = config.getOption("dxvk.hud", ""); diff --git a/src/dxvk/dxvk_options.h b/src/dxvk/dxvk_options.h index 35de1e16a..6843c16fb 100644 --- a/src/dxvk/dxvk_options.h +++ b/src/dxvk/dxvk_options.h @@ -18,9 +18,6 @@ namespace dxvk { /// when using the state cache int32_t numCompilerThreads; - /// Asynchronous presentation - Tristate asyncPresent; - /// Shader-related options Tristate useRawSsbo; Tristate useEarlyDiscard; diff --git a/src/dxvk/dxvk_queue.cpp b/src/dxvk/dxvk_queue.cpp index 8daa0267a..01dc70574 100644 --- a/src/dxvk/dxvk_queue.cpp +++ b/src/dxvk/dxvk_queue.cpp @@ -7,12 +7,7 @@ namespace dxvk { : m_device(device), m_submitThread([this] () { submitCmdLists(); }), m_finishThread([this] () { finishCmdLists(); }) { - // Asynchronous presentation seems to increase the - // likelyhood of hangs on Nvidia for some reason. - m_asyncPresent = !m_device->adapter()->matchesDriver( - DxvkGpuVendor::Nvidia, VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR, 0, 0); - applyTristate(m_asyncPresent, m_device->config().asyncPresent); } @@ -48,21 +43,12 @@ namespace dxvk { void DxvkSubmissionQueue::present(DxvkPresentInfo presentInfo, DxvkSubmitStatus* status) { std::unique_lock lock(m_mutex); - if (m_asyncPresent) { - DxvkSubmitEntry entry = { }; - entry.status = status; - entry.present = std::move(presentInfo); + DxvkSubmitEntry entry = { }; + entry.status = status; + entry.present = std::move(presentInfo); - m_submitQueue.push(std::move(entry)); - m_appendCond.notify_all(); - } else { - m_submitCond.wait(lock, [this] { - return m_submitQueue.empty(); - }); - - VkResult result = presentInfo.presenter->presentImage(presentInfo.waitSync); - status->result.store(result); - } + m_submitQueue.push(std::move(entry)); + m_appendCond.notify_all(); } diff --git a/src/dxvk/dxvk_queue.h b/src/dxvk/dxvk_queue.h index 8e7b7b161..f8da9a3ff 100644 --- a/src/dxvk/dxvk_queue.h +++ b/src/dxvk/dxvk_queue.h @@ -104,14 +104,6 @@ namespace dxvk { return m_lastError.load(); } - /** - * \brief Checks whether asynchronous presentation is supported - * \returns \c true if presentation is asynchronous - */ - bool hasAsyncPresent() const { - return m_asyncPresent; - } - /** * \brief Submits a command list asynchronously * @@ -175,7 +167,6 @@ namespace dxvk { private: DxvkDevice* m_device; - bool m_asyncPresent; std::atomic m_lastError = { VK_SUCCESS };