Fixed incorrect for loop in ProcessDefragmetnations() that would lead to partial defragmentation passes being broken

This commit is contained in:
Sidney Just 2020-01-12 15:51:33 -08:00
parent d0e55f9b7f
commit f91dd04a1e

View File

@ -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();