diff options
| author | Egor Yusov <egor.yusov@gmail.com> | 2019-03-21 15:55:54 +0000 |
|---|---|---|
| committer | Egor Yusov <egor.yusov@gmail.com> | 2019-03-21 15:55:54 +0000 |
| commit | 3ed3f21fb67f4a724fd3c622108fe0f9b7b92223 (patch) | |
| tree | 2286231bcc45fbd3361b87622c0c4bc9b84946dc /Graphics/GraphicsEngineVulkan | |
| parent | Fixed one more Vulkan validation error re destroying a fence being in use (diff) | |
| download | DiligentCore-3ed3f21fb67f4a724fd3c622108fe0f9b7b92223.tar.gz DiligentCore-3ed3f21fb67f4a724fd3c622108fe0f9b7b92223.zip | |
Fixed few potential issues with waiting for fences in Vk backend
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp | 2 | ||||
| -rw-r--r-- | Graphics/GraphicsEngineVulkan/src/SwapChainVkImpl.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
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); } } |
