Files
Henrik RydgårdandClaude Opus 5.5 377fa492b3 Profiler: Record per-thread event timelines, and add timeline and graph windows
The frame profiler kept its state in 4 thread slots, and every thread after
the fourth shared the last one's nesting depth and stack without locking.
Several threads entering and leaving scopes at once corrupted the depth,
which then indexed outside the arrays and crashed.

Now each thread that enters a scope gets a lane of its own: a ring of begin
and end events that only it writes. A thread that exits hands its lane to the
next new one; lanes are never freed, so readers can walk them without locks,
and a reader checks that an event wasn't overwritten while it copied it. A
literal scope name is looked up once per call site.

The per-frame totals (time in each category, not counting nested scopes) are
worked out from the events at each frame end, so the on-screen overlay keeps
working. The ImGui debugger gets a CPU profiler window, with a zoomable
timeline of each thread's scopes and frame ends plus a table of per-frame
totals, and a Frame profile window with the overlay's graph, per thread.

The Vulkan render thread has scopes for rendering, submitting and presenting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 12:50:57 +01:00
..