[perf] Mesh::Refit re-uploads the full vertex buffer every frame (Mesh.cpp) #119
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics#119
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-Mesh.cpp:407-409Severity: medium · Effort: moderate · Category: memory
Problem
Deforming-mesh
Mesh::RefitUploadDeviceLocals the entire vertex array each frame (full host write + flush + barrier; full re-stage + copy on the staged path), even when only a few vertices moved.Fix
Add a dirty-range upload (offset+count) so a refit copies/stages/barriers only the changed sub-range. Requires a caller-facing contract change since
Refitcurrently takes a span of all vertices.