From 3ed3f21fb67f4a724fd3c622108fe0f9b7b92223 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 21 Mar 2019 08:55:54 -0700 Subject: Fixed few potential issues with waiting for fences in Vk backend --- Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp | 2 +- Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp index 70894dc3..bcf6832d 100644 --- a/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp @@ -83,7 +83,7 @@ void FenceVkImpl :: Wait() const auto& LogicalDevice = m_pDevice->GetLogicalDevice(); for (auto& val_fence : m_PendingFences) { - while (LogicalDevice.GetFenceStatus(val_fence.second) != VK_SUCCESS) + while (LogicalDevice.GetFenceStatus(val_fence.second) == VK_NOT_READY) { VkFence FenceToWait = val_fence.second; auto res = LogicalDevice.WaitForFences(1, &FenceToWait, VK_TRUE, UINT64_MAX); diff --git a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp index 523f0896..befa0db4 100644 --- a/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp @@ -445,7 +445,7 @@ VkResult SwapChainVkImpl::AcquireNextImage(DeviceContextVkImpl* pDeviceCtxVk) if (m_ImageAcquiredFenceSubmitted[OldestSubmittedImageFenceInd]) { VkFence OldestSubmittedFence = m_ImageAcquiredFences[OldestSubmittedImageFenceInd]; - if (LogicalDevice.GetFenceStatus(OldestSubmittedFence) != VK_SUCCESS) + if (LogicalDevice.GetFenceStatus(OldestSubmittedFence) == VK_NOT_READY) { auto res = LogicalDevice.WaitForFences(1, &OldestSubmittedFence, VK_TRUE, UINT64_MAX); VERIFY_EXPR(res == VK_SUCCESS); (void)res; @@ -570,7 +570,7 @@ void SwapChainVkImpl::WaitForImageAcquiredFences() if (m_ImageAcquiredFenceSubmitted[i]) { VkFence vkFence = m_ImageAcquiredFences[i]; - if (LogicalDevice.GetFenceStatus(vkFence) != VK_SUCCESS) + if (LogicalDevice.GetFenceStatus(vkFence) == VK_NOT_READY) LogicalDevice.WaitForFences(1, &vkFence, VK_TRUE, UINT64_MAX); } } -- cgit v1.2.3