[perf] No buffer suballocator — vkAllocateMemory per buffer (VulkanBuffer.cppm) #113
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#113
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Found by an adversarially-verified performance audit (finding confirmed real after a skeptic pass).
Location:
interfaces/Crafter.Graphics-VulkanBuffer.cppm:116-135Severity: high · Effort: large · Category: allocation
Problem
Every
Createissues a full create + getMemoryRequirements +vkAllocateMemory+ bind + getDeviceAddress, with oneVkDeviceMemoryper buffer.Mesh::Buildalone burns 4+ allocations per mesh.vkAllocateMemoryis kernel-heavy and the total live allocation count is capped bymaxMemoryAllocationCount(~4096 on many drivers), so many-mesh scenes hit a hard ceiling.Fix
VMA-style block suballocator: allocate large blocks and hand out
(offset, size)sub-ranges bound at non-zero offsets; persistently map one HOST_VISIBLE block and slice the pointer. Must thread offsets through bind/map/unmap, the device-address query,Resizein-place reuse, and the fence-keyed deletion queue.