[perf] VulkanBuffer::Resize always destroys+reallocates #63
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#63
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?
Subsystem: VulkanBuffer
Location:
interfaces/Crafter.Graphics-VulkanBuffer.cppm:112-117Impact: Low · Effort: Small · Not hot path (refit paths skip Resize)
Problem
VulkanBuffer::Resizealways destroys+reallocates. Every per-frame refit path is specifically engineered to skip Resize (UPDATE mode), so this is not a steady-state cost — but capacity-reuse is the safer direction.Proposed fix
Capacity-reuse when the buffer already fits.
Correctness caveat
Fix must guard on
(size-fits AND flags-match)— buffer usage flags are fixed at create. Once #40 pipelined frames, the destroy-when-it-cannot-reuse branch became a live UAF — handled by the deferred-deletion queue (#102).