From 1bf44b7ca30101e9737f185355180b3447cb4d73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 3 Dec 2017 11:02:49 +0100 Subject: [PATCH] Shutdown fix. --- Common/Vulkan/VulkanMemory.cpp | 9 ++++----- GPU/Vulkan/GPU_Vulkan.cpp | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Common/Vulkan/VulkanMemory.cpp b/Common/Vulkan/VulkanMemory.cpp index 08d832ebca..be56e9b51a 100644 --- a/Common/Vulkan/VulkanMemory.cpp +++ b/Common/Vulkan/VulkanMemory.cpp @@ -169,11 +169,10 @@ void VulkanDeviceAllocator::Destroy() { for (Slab &slab : slabs_) { // Did anyone forget to free? for (auto pair : slab.allocSizes) { - if (slab.usage[pair.first] != 2) { - // If it's not 2 (queued), there's a problem. - // If it's zero, it means allocSizes is somehow out of sync. - Crash(); - } + int slabUsage = slab.usage[pair.first]; + // If it's not 2 (queued), there's a problem. + // If it's zero, it means allocSizes is somehow out of sync. + _assert_msg_(G3D, slabUsage == 2, "Destroy: slabUsage has unexpected value %d", slabUsage); } assert(slab.deviceMemory); diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index c89c589c82..696e9b70b8 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -168,6 +168,7 @@ GPU_Vulkan::~GPU_Vulkan() { framebufferManagerVulkan_->DestroyAllFBOs(); vulkan2D_.Shutdown(); depalShaderCache_.Clear(); + drawEngine_.DeviceLost(); delete textureCacheVulkan_; delete pipelineManager_; delete shaderManagerVulkan_;