Fixed VmaBlockVector::MakePoolAllocationsLost (thanks @kennyalive! #18)

This commit is contained in:
Adam Sawicki 2018-01-24 12:43:00 +01:00
parent defbf3d975
commit 4cefd614dc

View File

@ -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;
}
}