From e97e9b6637761267203749c142d145319ca384cb Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 8 Aug 2017 11:40:31 +0200 Subject: [PATCH] Two fixes for "Portability issues" Issue #5 thanks @rextimmy! --- bin/VulkanSample_Release_2015.exe | Bin 88064 -> 88064 bytes src/vk_mem_alloc.h | 35 +++++++++++++++++------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/bin/VulkanSample_Release_2015.exe b/bin/VulkanSample_Release_2015.exe index c5e7ddc129132fc41d471e89901c54c40f597beb..9d9aea515dc1aafa978fa338cbfde585eb8c4043 100644 GIT binary patch delta 98 zcmZqJz}m2Zbpa#ujkeCs%#4ZutbvS31|VPp;#eRKkz-^CVPgadF~H<_fNT*U-U5`{ af{>d$|Gy;Ipxyu1vN5u3&tzkq9tZ%|&KdCl delta 98 zcmZqJz}m2Zbpa#uC)1A2%#4ZutbvS31|VPp;#eRKkz-^CVPgadF~H<_fNT*U-U5`{ af{>d$|Gy;Ipxyu1vN1Ak&tzkq9tZ%RM;O-t diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index 8abd528..eb5a471 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -836,11 +836,11 @@ remove them if not needed. #if VMA_STATS_STRING_ENABLED static inline void VmaUint32ToStr(char* outStr, size_t strLen, uint32_t num) { - snprintf(outStr, strLen, "%u", num); + snprintf(outStr, strLen, "%u", static_cast(num)); } static inline void VmaUint64ToStr(char* outStr, size_t strLen, uint64_t num) { - snprintf(outStr, strLen, "%llu", num); + snprintf(outStr, strLen, "%llu", static_cast(num)); } #endif @@ -2297,23 +2297,28 @@ private: ALLOCATION_TYPE m_Type; VmaSuballocationType m_SuballocationType; + // Allocation out of VmaBlock. + struct BlockAllocation + { + VmaBlock* m_Block; + VkDeviceSize m_Offset; + }; + + // Allocation for an object that has its own private VkDeviceMemory. + struct OwnAllocation + { + uint32_t m_MemoryTypeIndex; + VkDeviceMemory m_hMemory; + bool m_PersistentMap; + void* m_pMappedData; + }; + union { // Allocation out of VmaBlock. - struct BlockAllocation - { - VmaBlock* m_Block; - VkDeviceSize m_Offset; - } m_BlockAllocation; - + BlockAllocation m_BlockAllocation; // Allocation for an object that has its own private VkDeviceMemory. - struct OwnAllocation - { - uint32_t m_MemoryTypeIndex; - VkDeviceMemory m_hMemory; - bool m_PersistentMap; - void* m_pMappedData; - } m_OwnAllocation; + OwnAllocation m_OwnAllocation; }; };