From 44d8d6b8c3eaf48fc55de5321b56fce16fd0cbd1 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 22 Mar 2018 20:15:46 +0100 Subject: [PATCH] [dxvk] Fixed command buffer synchronization --- src/dxvk/dxvk_cmdlist.cpp | 1 - src/dxvk/dxvk_device.cpp | 20 +++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/dxvk/dxvk_cmdlist.cpp b/src/dxvk/dxvk_cmdlist.cpp index 0e64cb856..30f0471b6 100644 --- a/src/dxvk/dxvk_cmdlist.cpp +++ b/src/dxvk/dxvk_cmdlist.cpp @@ -40,7 +40,6 @@ namespace dxvk { DxvkCommandList::~DxvkCommandList() { - this->synchronize(); this->reset(); m_vkd->vkDestroyCommandPool(m_vkd->device(), m_pool, nullptr); diff --git a/src/dxvk/dxvk_device.cpp b/src/dxvk/dxvk_device.cpp index 17319a900..8a9119ec2 100644 --- a/src/dxvk/dxvk_device.cpp +++ b/src/dxvk/dxvk_device.cpp @@ -226,21 +226,23 @@ namespace dxvk { commandList->trackResource(wakeSync); } + VkResult status; + { // Queue submissions are not thread safe std::lock_guard lock(m_submissionLock); - const VkResult status = commandList->submit( + status = commandList->submit( m_graphicsQueue, waitSemaphore, wakeSemaphore); - - if (status != VK_SUCCESS) { - Logger::err(str::format( - "DxvkDevice: Command buffer submission failed: ", - status)); - } } - // Add this to the set of running submissions - m_submissionQueue.submit(commandList); + if (status == VK_SUCCESS) { + // Add this to the set of running submissions + m_submissionQueue.submit(commandList); + } else { + Logger::err(str::format( + "DxvkDevice: Command buffer submission failed: ", + status)); + } }