Skip to content

Commit c3c7a2c

Browse files
committed
Added missing mutex lock in VmaDefragmentationContext_T::DefragmentPassEnd
As proposed by @JustSid in GPUOpen-LibrariesAndSDKs#313
1 parent cc26b9f commit c3c7a2c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

include/vk_mem_alloc.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12377,7 +12377,11 @@ VkResult VmaDefragmentationContext_T::DefragmentPassEnd(VmaDefragmentationPassMo
1237712377
{
1237812378
case VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY:
1237912379
{
12380-
uint8_t mapCount = move.srcAllocation->SwapBlockAllocation(vector->m_hAllocator, move.dstTmpAllocation);
12380+
uint8_t mapCount = 0;
12381+
{
12382+
VmaMutexLockWrite swapLock(vector->GetMutex(), vector->GetAllocator()->m_UseMutex);
12383+
mapCount = move.srcAllocation->SwapBlockAllocation(vector->m_hAllocator, move.dstTmpAllocation);
12384+
}
1238112385
if (mapCount > 0)
1238212386
{
1238312387
allocator = vector->m_hAllocator;

0 commit comments

Comments
 (0)