From eb39cf4b11bc9e7501394da26ad83b437b383801 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Tue, 26 Jun 2018 15:33:43 +0200 Subject: [PATCH] [dxvk] Lock queue around acquireNextImage --- src/dxvk/dxvk_swapchain.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/dxvk/dxvk_swapchain.cpp b/src/dxvk/dxvk_swapchain.cpp index 36573346..d810a957 100644 --- a/src/dxvk/dxvk_swapchain.cpp +++ b/src/dxvk/dxvk_swapchain.cpp @@ -36,6 +36,10 @@ namespace dxvk { Rc DxvkSwapchain::getImageView( const Rc& wakeSync) { + // AcquireNextImage might interfere with the Vulkan + // device queue internally, so we should lock it + m_device->lockSubmission(); + VkResult status = this->acquireNextImage(wakeSync); if (status == VK_ERROR_OUT_OF_DATE_KHR) { @@ -43,6 +47,8 @@ namespace dxvk { status = this->acquireNextImage(wakeSync); } + m_device->unlockSubmission(); + if (status != VK_SUCCESS && status != VK_SUBOPTIMAL_KHR) throw DxvkError("DxvkSwapchain: Failed to acquire image");