From f91dd04a1e0484c838e931c5a84a924afaa26313 Mon Sep 17 00:00:00 2001 From: Sidney Just Date: Sun, 12 Jan 2020 15:51:33 -0800 Subject: [PATCH] Fixed incorrect for loop in ProcessDefragmetnations() that would lead to partial defragmentation passes being broken --- src/vk_mem_alloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index 7017014..72cb358 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -13019,9 +13019,9 @@ uint32_t VmaBlockVector::ProcessDefragmentations( const uint32_t moveCount = std::min(uint32_t(pCtx->defragmentationMoves.size()) - pCtx->defragmentationMovesProcessed, maxMoves); - for(uint32_t i = pCtx->defragmentationMovesProcessed; i < moveCount; ++ i) + for(uint32_t i = 0; i < moveCount; ++ i) { - VmaDefragmentationMove& move = pCtx->defragmentationMoves[i]; + VmaDefragmentationMove& move = pCtx->defragmentationMoves[pCtx->defragmentationMovesProcessed + i]; pMove->allocation = move.hAllocation; pMove->memory = move.pDstBlock->GetDeviceMemory();