[VMA] Phase 2 — switch suballocator to VMA Virtual Blocks, add budget-aware reclaim & safer commit #345
No reviewers
Labels
No labels
android
audio
bug
ci
cmake
confirmed
core
desktop
duplicate
enhancement
frontend
fw
git
graphics
loader
nv gpu
ui
vulkan
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
eden-emu/eden!345
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "VMA_Changes_v1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[V2]
Replace the custom suballocator (std::vector + gap scan) with VMA Virtual Blocks
Suballocator architecture
Old code used, commits vector of ranges + FindFreeRegion() linear scan whereas the new uses per-block VmaVirtualBlock with vmaVirtualAllocate/Free.
Similarly,
the MemoryAllocation::Commit(size, alignment) now uses VB.
MemoryAllocation::Free(begin) → vmaVirtualFree() by stored handle.
TLDR,
Introduce VmaVirtualBlock in MemoryAllocation; RAII destruction in dtor and all the corresponding handling changes to VB.
And all the previous goodies from V1.
[V1]
This patch makes VMA suballocation smarter under pressure and fixes a masking bug when RenderDoc is attached.
Adds a budget-aware check (via vmaGetHeapBudgets) and attempts to reclaim empty internal blocks before allocating new device memory blocks.
Implements a bounded OOM recovery ladder (retry, trim empty blocks, relax DEVICE_LOCAL, fall back to a smaller chunk, then fail).
This is phase one of the VMA changes and after testing, phase 2 shall roll out.
@ -303,0 +369,4 @@}}throw vk::Exception(VK_ERROR_OUT_OF_DEVICE_MEMORY);Sadpath codegen for stack unwinding is not optimal for exceptions
Maybe exploring not having to use them?
we can leave it as it is since if we are oom, we have bigger issues than making code optimal for exception.
@ -286,0 +309,4 @@}void MemoryAllocator::FreeEmptyAllocations() {std::vector<MemoryAllocation*> to_release;boost::container::small_vector
solved it by not using it
oh wait i am blind
[VMA] phase 1: Budget aware sub allocation, "Actual" Robust OOM handling.to [VMA] Phase 2 — switch suballocator to VMA Virtual Blocks, add budget-aware reclaim & safer commit0942ea1cc969de851e84Request closed since it has been superseded by a better and more complete implementation. See Pr 362
Pull request closed