[perf][LOW] Per-descriptor write flushes all numFrames heap copies whole-size #61

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

Subsystem: UI descriptor registration
Location: implementations/Crafter.Graphics-UI.cpp:275-302, 315-318
Impact: LOW · Effort: Small · Not hot path (setup-time registration APIs)

Problem

WriteBufferDescriptor/WriteSampledImageDescriptor/RegisterSampler each FlushDevice() every per-frame heap copy whole-size after writing one few-byte descriptor.

Proposed fix

Flush only the written descriptor byte range (destination address+size already known); batch into a single flush after multiple writes.

Correctness caveat

Ranged flush must respect nonCoherentAtomSize alignment (the WHOLE_SIZE call currently sidesteps this). "Skip if coherent" requires real coherence detection (see FlushDevice issue) — a blanket skip is a bug on non-coherent memory.

**Subsystem:** UI descriptor registration **Location:** `implementations/Crafter.Graphics-UI.cpp:275-302, 315-318` **Impact:** LOW · **Effort:** Small · Not hot path (setup-time registration APIs) ### Problem `WriteBufferDescriptor`/`WriteSampledImageDescriptor`/`RegisterSampler` each `FlushDevice()` every per-frame heap copy whole-size after writing one few-byte descriptor. ### Proposed fix Flush only the written descriptor byte range (destination address+size already known); batch into a single flush after multiple writes. ### Correctness caveat Ranged flush must respect `nonCoherentAtomSize` alignment (the WHOLE_SIZE call currently sidesteps this). "Skip if coherent" requires real coherence detection (see FlushDevice issue) — a blanket skip is a bug on non-coherent memory.
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#61
No description provided.