From 19dbbe92c07fabc1c7f4d58d9c9c71982ec194b2 Mon Sep 17 00:00:00 2001 From: qbojj <105227351+qbojj@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:29:31 +0200 Subject: [PATCH 1/3] fix typo in specification of VmaAlignDown --- 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 c228173..dc116b0 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -3341,7 +3341,7 @@ static inline T VmaAlignUp(T val, T alignment) return (val + alignment - 1) & ~(alignment - 1); } -// Aligns given value down to nearest multiply of align value. For example: VmaAlignUp(11, 8) = 8. +// Aligns given value down to nearest multiply of align value. For example: VmaAlignDown(11, 8) = 8. // Use types like uint32_t, uint64_t as T. template static inline T VmaAlignDown(T val, T alignment) From 198127a0ee31e2be6081fb83ab4bb9507eaab0c0 Mon Sep 17 00:00:00 2001 From: Russell Greene Date: Thu, 27 Oct 2022 14:46:35 -0500 Subject: [PATCH 2/3] Fix build for iOS --- include/vk_mem_alloc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index dc116b0..9ccae2e 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -6468,10 +6468,10 @@ void VmaBlockMetadata::PrintDetailedMap_Begin(class VmaJsonWriter& json, json.WriteSize(unusedBytes); json.WriteString("Allocations"); - json.WriteSize(allocationCount); + json.WriteSize((uint64_t)allocationCount); json.WriteString("UnusedRanges"); - json.WriteSize(unusedRangeCount); + json.WriteSize((uint64_t)unusedRangeCount); json.WriteString("Suballocations"); json.BeginArray(); @@ -16012,7 +16012,7 @@ void VmaAllocator_T::PrintDetailedMap(VmaJsonWriter& json) { json.WriteString("Name"); json.BeginString(); - json.ContinueString_Size(index++); + json.ContinueString_Size((uint64_t)index++); if (pool->GetName()) { json.ContinueString(" - "); From f741604e0432a2f67933c4b5675e99e23858d9ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Riku=20Palom=C3=A4ki?= Date: Tue, 1 Nov 2022 10:08:23 +0200 Subject: [PATCH 3/3] Remove extra semicolons, fixes build with -Wextra-semi --- include/vk_mem_alloc.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 9ccae2e..62220ec 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -884,7 +884,7 @@ Use it as a unique identifier to virtual allocation within the single block. Use value `VK_NULL_HANDLE` to represent a null/invalid allocation. */ -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaVirtualAllocation); +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaVirtualAllocation) /** @} */ @@ -3126,7 +3126,7 @@ enum class VmaAllocationRequestType #ifndef _VMA_FORWARD_DECLARATIONS // Opaque handle used by allocation algorithms to identify single allocation in any conforming way. -VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaAllocHandle); +VK_DEFINE_NON_DISPATCHABLE_HANDLE(VmaAllocHandle) struct VmaMutexLock; struct VmaMutexLockRead; @@ -6781,7 +6781,7 @@ public: VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; } bool IsEmpty() const override { return (m_Suballocations.size() == 1) && (m_FreeCount == 1); } void Free(VmaAllocHandle allocHandle) override { FreeSuballocation(FindAtOffset((VkDeviceSize)allocHandle - 1)); } - VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; }; + VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; } void Init(VkDeviceSize size) override; bool Validate() const override; @@ -7618,7 +7618,7 @@ public: VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; } bool IsEmpty() const override { return GetAllocationCount() == 0; } - VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; }; + VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; } void Init(VkDeviceSize size) override; bool Validate() const override; @@ -9278,7 +9278,7 @@ public: VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize + GetUnusableSize(); } bool IsEmpty() const override { return m_Root->type == Node::TYPE_FREE; } VkResult CheckCorruption(const void* pBlockData) override { return VK_ERROR_FEATURE_NOT_PRESENT; } - VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; }; + VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return (VkDeviceSize)allocHandle - 1; } void DebugLogAllAllocations() const override { DebugLogAllAllocationNode(m_Root, 0); } void Init(VkDeviceSize size) override; @@ -9977,7 +9977,7 @@ public: size_t GetFreeRegionsCount() const override { return m_BlocksFreeCount + 1; } VkDeviceSize GetSumFreeSize() const override { return m_BlocksFreeSize + m_NullBlock->size; } bool IsEmpty() const override { return m_NullBlock->offset == 0; } - VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return ((Block*)allocHandle)->offset; }; + VkDeviceSize GetAllocationOffset(VmaAllocHandle allocHandle) const override { return ((Block*)allocHandle)->offset; } void Init(VkDeviceSize size) override; bool Validate() const override;