mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2025-05-15 01:08:31 +00:00
Fixed budget management in VmaBlockVector::Allocate for cases when some of multi-page allocations fail
This commit is contained in:
parent
7e56c486fa
commit
a420c3d752
2 changed files with 9 additions and 5 deletions
|
@ -12773,9 +12773,13 @@ VkResult VmaBlockVector::Allocate(
|
|||
if(res != VK_SUCCESS)
|
||||
{
|
||||
// Free all already created allocations.
|
||||
const uint32_t heapIndex = m_hAllocator->MemoryTypeIndexToHeapIndex(m_MemoryTypeIndex);
|
||||
while(allocIndex--)
|
||||
{
|
||||
Free(pAllocations[allocIndex]);
|
||||
VmaAllocation_T* const alloc = pAllocations[allocIndex];
|
||||
const VkDeviceSize allocSize = alloc->GetSize();
|
||||
Free(alloc);
|
||||
m_hAllocator->m_Budget.RemoveAllocation(heapIndex, allocSize);
|
||||
}
|
||||
memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue