From 91b089d90db73d7b30602314fea8fa740317c5fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 10 Dec 2017 14:22:35 +0100 Subject: [PATCH] Tweak logging and asserts in VulkanDeviceMemory::Destroy --- Common/Vulkan/VulkanMemory.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Common/Vulkan/VulkanMemory.cpp b/Common/Vulkan/VulkanMemory.cpp index df6770a5fc..3e72505f51 100644 --- a/Common/Vulkan/VulkanMemory.cpp +++ b/Common/Vulkan/VulkanMemory.cpp @@ -171,9 +171,13 @@ void VulkanDeviceAllocator::Destroy() { // Did anyone forget to free? for (auto pair : slab.allocSizes) { int slabUsage = slab.usage[pair.first]; - // If it's not 2 (queued), there's a problem. + // If it's not 2 (queued), there's a leak. // If it's zero, it means allocSizes is somehow out of sync. - _assert_msg_(G3D, slabUsage == 2, "Destroy: slabUsage has unexpected value %d", slabUsage); + if (slabUsage == 1) { + ERROR_LOG(G3D, "VulkanDeviceAllocator detected memory leak of size %d", (int)pair.second); + } else { + _dbg_assert_msg_(G3D, slabUsage == 2, "Destroy: slabUsage has unexpected value %d", slabUsage); + } } assert(slab.deviceMemory);