summaryrefslogtreecommitdiffstats
path: root/Graphics/GraphicsEngineVulkan
diff options
context:
space:
mode:
authorEgor Yusov <egor.yusov@gmail.com>2018-07-25 01:50:56 +0000
committerEgor Yusov <egor.yusov@gmail.com>2018-07-25 01:50:56 +0000
commit3259558b09d2579fe71799c12a37ea4dc38d34a7 (patch)
tree37e571267325176a6d094119228420b3b0db7602 /Graphics/GraphicsEngineVulkan
parentAdded extra debug checks to ~DeviceContextVkImpl() (diff)
downloadDiligentCore-3259558b09d2579fe71799c12a37ea4dc38d34a7.tar.gz
DiligentCore-3259558b09d2579fe71799c12a37ea4dc38d34a7.zip
Fixed another potential issue in ~DeviceContextVkImpl()
Diffstat (limited to 'Graphics/GraphicsEngineVulkan')
-rw-r--r--Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
index 39e7d744..1c8352d6 100644
--- a/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
+++ b/Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp
@@ -132,10 +132,12 @@ namespace Diligent
// There should be no outstanding commands, but we need to call Flush to discard all stale
// context resources to actually destroy them in the next call to ReleaseStaleContextResources()
Flush();
- // We must now wait for GPU to finish so that we can safely destroy all context resources
- pDeviceVkImpl->IdleGPU(true);
}
+ // We must now wait for GPU to finish so that we can safely destroy all context resources.
+ // We need to idle when destroying deferred contexts as well since some resources may still be in use.
+ pDeviceVkImpl->IdleGPU(true);
+
DisposeCurrentCmdBuffer(pDeviceVkImpl->GetNextFenceValue());
// There must be no resources in the stale resource list. For immediate context, all stale resources must have been