diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-03-21 16:07:03 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-03-21 16:07:03 +0000 |
| commit | ce85094a41d30853c37c42e17dc038d123ec7b9a (patch) | |
| tree | 0cd786d64007aeca76edc0fa95d980f56761d761 /Graphics/GraphicsEngineVulkan | |
| parent | Fixed few potential issues with waiting for fences in Vk backend (diff) | |
| download | DiligentCore-ce85094a41d30853c37c42e17dc038d123ec7b9a.tar.gz DiligentCore-ce85094a41d30853c37c42e17dc038d123ec7b9a.zip | |
Another minor fix for fence waiting
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
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; |
