mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-25 13:30:05 +00:00
Small fix in VmaBlock::Free (thanks @dylanede for pointing this!)
This commit is contained in:
parent
7600059ae7
commit
0845f1c2e5
@ -2653,11 +2653,6 @@ void VmaAllocation::FreeSuballocation(VmaSuballocationList::iterator suballocIte
|
||||
|
||||
void VmaAllocation::Free(const VkMappedMemoryRange* pMemory)
|
||||
{
|
||||
// If suballocation to free has offset smaller than half of allocation size, search forward.
|
||||
// Otherwise search backward.
|
||||
const bool forwardDirection = pMemory->offset < (m_Size / 2);
|
||||
if(forwardDirection)
|
||||
{
|
||||
for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
|
||||
suballocItem != m_Suballocations.end();
|
||||
++suballocItem)
|
||||
@ -2671,23 +2666,6 @@ void VmaAllocation::Free(const VkMappedMemoryRange* pMemory)
|
||||
}
|
||||
}
|
||||
VMA_ASSERT(0 && "Not found!");
|
||||
}
|
||||
else
|
||||
{
|
||||
for(VmaSuballocationList::iterator suballocItem = m_Suballocations.begin();
|
||||
suballocItem != m_Suballocations.end();
|
||||
++suballocItem)
|
||||
{
|
||||
VmaSuballocation& suballoc = *suballocItem;
|
||||
if(suballoc.offset == pMemory->offset)
|
||||
{
|
||||
FreeSuballocation(suballocItem);
|
||||
VMA_HEAVY_ASSERT(Validate());
|
||||
return;
|
||||
}
|
||||
}
|
||||
VMA_ASSERT(0 && "Not found!");
|
||||
}
|
||||
}
|
||||
|
||||
#if VMA_STATS_STRING_ENABLED
|
||||
|
Loading…
Reference in New Issue
Block a user