[perf] Per-frame whole-buffer flush of TLAS instance+metadata buffers (RenderingElement3D.cpp) #121
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#121
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:
implementations/Crafter.Graphics-RenderingElement3D.cpp:161-173Severity: low · Effort: moderate · Category: memory
Problem
Both
FlushDevicecalls resolve toVK_WHOLE_SIZE, flushing the full high-water capacity every frame regardless of dirty bytes (steady state never callsResize, so the span is capacity, notprimitiveCount*stride). Self-gates to a no-op on HOST_COHERENT memory, so cost only materializes on non-coherent BAR/VRAM.Fix
Use the existing ranged
FlushDevice(offset, bytes)(VulkanBuffer.cppm:336) over[0, primitiveCount*stride), ideally only dirty sub-ranges.Merged into #118 — the TLAS host rebuild and the whole-buffer flush act on the same instance+metadata buffers; one dirty-set drives both the copy and the ranged flush, so they're a single deliverable.