From e821342782fdb15a4bc54b9ccd7dfe68b19bae7f Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Thu, 21 Oct 2021 13:37:10 +0200 Subject: [PATCH] Fixing logic of VmaDefragmentationAlgorithm_Fast::PostprocessMetadata broken by #201 Closes #202 --- include/vk_mem_alloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 4463be8..11b7840 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -13071,9 +13071,9 @@ void VmaDefragmentationAlgorithm_Fast::PostprocessMetadata() freeSize, // size VMA_NULL, // hAllocation VMA_SUBALLOCATION_TYPE_FREE }; + VmaSuballocationList::iterator precedingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc); if(freeSize >= VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) { - VmaSuballocationList::iterator precedingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc); pMetadata->m_FreeSuballocationsBySize.push_back(precedingFreeIt); } } @@ -13093,9 +13093,9 @@ void VmaDefragmentationAlgorithm_Fast::PostprocessMetadata() VMA_NULL, // hAllocation VMA_SUBALLOCATION_TYPE_FREE }; VMA_ASSERT(it == pMetadata->m_Suballocations.end()); + VmaSuballocationList::iterator trailingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc); if(freeSize > VMA_MIN_FREE_SUBALLOCATION_SIZE_TO_REGISTER) { - VmaSuballocationList::iterator trailingFreeIt = pMetadata->m_Suballocations.insert(it, suballoc); pMetadata->m_FreeSuballocationsBySize.push_back(trailingFreeIt); } }