[perf] TLAS instance/metadata buffers reallocated on instance-count change #64

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

Subsystem: RenderingElement3D / RT
Location: implementations/Crafter.Graphics-RenderingElement3D.cpp:90-97, 161-162
Impact: Low · Effort: Medium · Not hot path (gated behind topologyChanged)

Problem

TLAS instance/metadata buffers are reallocated on instance-count change. Gated behind topologyChanged; all shipped examples have stable instance counts after init, so steady state takes the cheap refit path.

Proposed fix

High-water-mark growth (removes only 2 of 4 reallocations).

Correctness caveat

Does not eliminate the AS rebuild that dominates. The whole frame is also drained by the wait-idle today, so no current UAF — but a frame-in-flight renderer would need fence-tracked lifetimes.

**Subsystem:** RenderingElement3D / RT **Location:** `implementations/Crafter.Graphics-RenderingElement3D.cpp:90-97, 161-162` **Impact:** Low · **Effort:** Medium · Not hot path (gated behind topologyChanged) ### Problem TLAS instance/metadata buffers are reallocated on instance-count change. Gated behind `topologyChanged`; all shipped examples have stable instance counts after init, so steady state takes the cheap refit path. ### Proposed fix High-water-mark growth (removes only 2 of 4 reallocations). ### Correctness caveat Does not eliminate the AS rebuild that dominates. The whole frame is also drained by the wait-idle today, so no current UAF — but a frame-in-flight renderer would need fence-tracked lifetimes.
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#64
No description provided.