From 15b16f88b9ea43ac391fa406e8088bc8e64e7590 Mon Sep 17 00:00:00 2001 From: Ellie Hermaszewska Date: Fri, 14 Jan 2022 16:40:40 +0800 Subject: [PATCH 1/2] Add missing length annotation to pBudgets parameter in vmaGetHeapBudgets --- include/vk_mem_alloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index ac1701a..188e888 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -1453,7 +1453,7 @@ become outdated. */ VMA_CALL_PRE void VMA_CALL_POST vmaGetHeapBudgets( VmaAllocator VMA_NOT_NULL allocator, - VmaBudget* VMA_NOT_NULL pBudgets); + VmaBudget* VMA_NOT_NULL VMA_LEN_IF_NOT_NULL("VkPhysicalDeviceMemoryProperties::memoryHeapCount") pBudgets); /** \brief Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo. From f333006465ce59478fe72ee3efe898d6713d98cf Mon Sep 17 00:00:00 2001 From: Tiago Chaves Date: Fri, 14 Jan 2022 11:31:30 -0300 Subject: [PATCH 2/2] Fix MSVC warning C4505 for VmaCreateStringCopy --- include/vk_mem_alloc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 188e888..6df3e40 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -3256,6 +3256,7 @@ static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char return VMA_NULL; } +#if VMA_STATS_STRING_ENABLED static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char* srcStr, size_t strLen) { if (srcStr != VMA_NULL) @@ -3267,6 +3268,7 @@ static char* VmaCreateStringCopy(const VkAllocationCallbacks* allocs, const char } return VMA_NULL; } +#endif // VMA_STATS_STRING_ENABLED static void VmaFreeString(const VkAllocationCallbacks* allocs, char* str) {