From 3259558b09d2579fe71799c12a37ea4dc38d34a7 Mon Sep 17 00:00:00 2001 From: Egor Yusov Date: Tue, 24 Jul 2018 18:50:56 -0700 Subject: Fixed another potential issue in ~DeviceContextVkImpl() --- Graphics/GraphicsEngineVulkan/src/DeviceContextVkImpl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'Graphics/GraphicsEngineVulkan') 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 -- cgit v1.2.3