From ce85094a41d30853c37c42e17dc038d123ec7b9a Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Thu, 21 Mar 2019 09:07:03 -0700 Subject: Another minor fix for fence waiting --- Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') diff --git a/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp index bcf6832d..726cdd41 100644 --- a/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp +++ b/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp @@ -83,14 +83,13 @@ void FenceVkImpl :: Wait() const auto& LogicalDevice = m_pDevice->GetLogicalDevice(); for (auto& val_fence : m_PendingFences) { - while (LogicalDevice.GetFenceStatus(val_fence.second) == VK_NOT_READY) + auto status = LogicalDevice.GetFenceStatus(val_fence.second); + if (status == VK_NOT_READY) { VkFence FenceToWait = val_fence.second; - auto res = LogicalDevice.WaitForFences(1, &FenceToWait, VK_TRUE, UINT64_MAX); - VERIFY_EXPR(res == VK_SUCCESS); (void)res; + status = LogicalDevice.WaitForFences(1, &FenceToWait, VK_TRUE, UINT64_MAX); } - auto status = LogicalDevice.GetFenceStatus(val_fence.second); DEV_CHECK_ERR(status == VK_SUCCESS, "All pending fences must now be complete!"); (void)status; if (val_fence.first > m_LastCompletedFenceValue) m_LastCompletedFenceValue = val_fence.first; -- cgit v1.2.3