[perf][LOW] Refit re-uploads immutable index buffer on UPDATE #68

Closed
opened 2026-06-16 16:51:34 +02:00 by jorijnvdgraaf · 0 comments

Subsystem: Mesh / RT refit
Location: implementations/Crafter.Graphics-Mesh.cpp:362-367
Impact: Low · Effort: Small · Genuinely per-frame for deforming meshes

Problem

Refit re-uploads the index buffer on UPDATE — one extra memcpy + flush + barrier of immutable index data per refit.

Proposed fix

Skip the index memcpy + its FlushDevice on the UPDATE branch (a hardware AS UPDATE cannot change topology).

Correctness caveat

Slightly changes the API contract — a bitwise-different-but-equivalent index array on refit would be ignored; consistent with the documented "may only move vertex positions."

**Subsystem:** Mesh / RT refit **Location:** `implementations/Crafter.Graphics-Mesh.cpp:362-367` **Impact:** Low · **Effort:** Small · Genuinely per-frame for deforming meshes ### Problem `Refit` re-uploads the index buffer on UPDATE — one extra memcpy + flush + barrier of immutable index data per refit. ### Proposed fix Skip the index memcpy + its `FlushDevice` on the UPDATE branch (a hardware AS UPDATE cannot change topology). ### Correctness caveat Slightly changes the API contract — a bitwise-different-but-equivalent index array on refit would be ignored; consistent with the documented "may only move vertex positions."
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Catcrafts/Crafter.Graphics#68
No description provided.