summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2019-04-16 04:41:20 +0000
committerEgor Yusov <egor.yusov@gmail.com>2019-04-16 04:41:20 +0000
commit079680f868c1ec09013e62efde42fdd95cc1347c (patch)
tree33c64b3199fe400fb0f59183e48cf5c5e35fbf00 /Graphics/GraphicsEngineVulkan
parentFixed Linux/Mac build error (diff)
downloadDiligentCore-079680f868c1ec09013e62efde42fdd95cc1347c.tar.gz
DiligentCore-079680f868c1ec09013e62efde42fdd95cc1347c.zip
Fixed issue with FenceVkImpl not waiting for Vulkan fences to signal when being destroyed, which causes Vulkan validation errors.
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp
index 12273300..3314598a 100644
--- a/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/FenceVkImpl.cpp
@@ -41,10 +41,15 @@ FenceVkImpl :: FenceVkImpl(IReferenceCounters* pRefCounters,
FenceVkImpl :: ~FenceVkImpl()
{
- // Do not dispose pending fences as the pool checks that the fence
- // is signaled, while pending fences may not be.
- // The pool will be destroyed next anyway, so it makes no difference.
- m_PendingFences.clear();
+ if (!m_PendingFences.empty())
+ {
+ LOG_INFO_MESSAGE("FenceVkImpl::~FenceVkImpl(): waiting for ", m_PendingFences.size(), " pending Vulkan ",
+ (m_PendingFences.size() > 1 ? "fences." : "fence."));
+ // Vulkan spec states that all queue submission commands that refer to
+ // a fence must have completed execution before the fence is destroyed.
+ // (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-vkDestroyFence-fence-01120)
+ Wait();
+ }
}
Uint64 FenceVkImpl :: GetCompletedValue()