From c0aa0ad54c5e7bdeaee7a2ade95007ea6ce3010a Mon Sep 17 00:00:00 2001 From: Tiago Chaves Date: Sun, 30 Jan 2022 16:40:32 -0300 Subject: [PATCH] Fix VMA_STATS_STRING_ENABLED 0 with VMA_DEBUG_LOG --- include/vk_mem_alloc.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index a566858..0cb7e43 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -6048,6 +6048,8 @@ void VmaBlockMetadata::DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size VmaAllocation allocation = reinterpret_cast(userData); userData = allocation->GetUserData(); + +#if VMA_STATS_STRING_ENABLED if (userData != VMA_NULL && allocation->IsUserDataString()) { VMA_DEBUG_LOG("UNFREED ALLOCATION; Offset: %llu; Size: %llu; UserData: %s; Type: %s; Usage: %u", @@ -6062,6 +6064,18 @@ void VmaBlockMetadata::DebugLogAllocation(VkDeviceSize offset, VkDeviceSize size VMA_SUBALLOCATION_TYPE_NAMES[allocation->GetSuballocationType()], allocation->GetBufferImageUsage()); } +#else + if (userData != VMA_NULL && allocation->IsUserDataString()) + { + VMA_DEBUG_LOG("UNFREED ALLOCATION; Offset: %llu; Size: %llu; UserData: %s", + offset, size, reinterpret_cast(userData)); + } + else + { + VMA_DEBUG_LOG("UNFREED ALLOCATION; Offset: %llu; Size: %llu; UserData: %p", + offset, size, userData); + } +#endif // VMA_STATS_STRING_ENABLED } }