Fixed bugs in VmaBlockMetadata_Linear::MakeAllocationsLost, VmaBlockVector::IsCorruptionDetectionEnabled.
This commit is contained in:
parent
fd366b60b4
commit
4d35a5d663
2 changed files with 3 additions and 1 deletions
|
@ -2550,7 +2550,7 @@ static void TestLinearAllocator()
|
||||||
{
|
{
|
||||||
vmaSetCurrentFrameIndex(g_hAllocator, ++g_FrameIndex);
|
vmaSetCurrentFrameIndex(g_hAllocator, ++g_FrameIndex);
|
||||||
|
|
||||||
size_t lostAllocCount = SIZE_MAX;
|
size_t lostAllocCount = 0;
|
||||||
vmaMakePoolAllocationsLost(g_hAllocator, pool, &lostAllocCount);
|
vmaMakePoolAllocationsLost(g_hAllocator, pool, &lostAllocCount);
|
||||||
TEST(lostAllocCount > 0);
|
TEST(lostAllocCount > 0);
|
||||||
|
|
||||||
|
|
|
@ -10174,6 +10174,7 @@ uint32_t VmaBlockMetadata_Linear::MakeAllocationsLost(uint32_t currentFrameIndex
|
||||||
suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
|
suballoc.type = VMA_SUBALLOCATION_TYPE_FREE;
|
||||||
suballoc.hAllocation = VK_NULL_HANDLE;
|
suballoc.hAllocation = VK_NULL_HANDLE;
|
||||||
++m_2ndNullItemsCount;
|
++m_2ndNullItemsCount;
|
||||||
|
m_SumFreeSize += suballoc.size;
|
||||||
++lostAllocationCount;
|
++lostAllocationCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11424,6 +11425,7 @@ bool VmaBlockVector::IsCorruptionDetectionEnabled() const
|
||||||
const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
const uint32_t requiredMemFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
|
||||||
return (VMA_DEBUG_DETECT_CORRUPTION != 0) &&
|
return (VMA_DEBUG_DETECT_CORRUPTION != 0) &&
|
||||||
(VMA_DEBUG_MARGIN > 0) &&
|
(VMA_DEBUG_MARGIN > 0) &&
|
||||||
|
(m_Algorithm == 0 || m_Algorithm == VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT) &&
|
||||||
(m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags & requiredMemFlags) == requiredMemFlags;
|
(m_hAllocator->m_MemProps.memoryTypes[m_MemoryTypeIndex].propertyFlags & requiredMemFlags) == requiredMemFlags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue