From 4cefd614dc69fa4272ad3663d75f9d4f22c4f369 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 24 Jan 2018 12:43:00 +0100 Subject: [PATCH] Fixed VmaBlockVector::MakePoolAllocationsLost (thanks @kennyalive! #18) --- src/vk_mem_alloc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index e587c51..d135114 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -6382,12 +6382,16 @@ void VmaBlockVector::MakePoolAllocationsLost( size_t* pLostAllocationCount) { VmaMutexLock lock(m_Mutex, m_hAllocator->m_UseMutex); - + size_t lostAllocationCount = 0; for(uint32_t blockIndex = 0; blockIndex < m_Blocks.size(); ++blockIndex) { VmaDeviceMemoryBlock* const pBlock = m_Blocks[blockIndex]; VMA_ASSERT(pBlock); - pBlock->m_Metadata.MakeAllocationsLost(currentFrameIndex, m_FrameInUseCount); + lostAllocationCount += pBlock->m_Metadata.MakeAllocationsLost(currentFrameIndex, m_FrameInUseCount); + } + if(pLostAllocationCount != VMA_NULL) + { + *pLostAllocationCount = lostAllocationCount; } }