[perf] Per-image dedicated alloc + leaked persistent staging buffer (ImageVulkan.cppm) #114
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#114
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 (confirmed real after a skeptic pass).
Location:
interfaces/Crafter.Graphics-ImageVulkan.cppm:99-131Severity: high · Effort: moderate · Category: memory
Problem
Each texture allocates a dedicated image
VkDeviceMemory(:130) plus a persistent HOST_VISIBLE stagingbuffer(:99) sizedw*h, kept mapped for the image lifetime — andDestroy()never freesbuffer, so it leaks. Static textures (e.g. Sponza albedo, uploaded once) pin host-visible / small-BAR memory forever.Fix
DeferredClearthe staging buffer after the copy (as the compressed path already does at:313), gated by astreamedflag so FontAtlas keeps its persistent staging. Optionally back image memory from the same suballocator (larger, lower priority).