Static ReadonlyMAX_Toggle live. When false, writesFor returns undefined so passes run without timestampWrites and the whole path costs nothing.
EMA-smoothed sum of all bracketed passes' GPU time this frame (ms).
StaticcreateCreate a profiler, or null if the adapter lacks 'timestamp-query'.
Reset the per-frame slot cursor. Call once at the top of execute().
Timestamp-writes descriptor for one render/compute pass, or undefined when profiling is off or the per-frame capacity is exhausted (the pass then runs untimed). The same shape satisfies both render and compute pass descriptors.
Record the query-set resolve + copy into a readback buffer. Call after all
passes are encoded and before encoder.finish(). No-op when nothing was
bracketed or no readback buffer is free (that frame's timings are skipped).
Kick off the async map of the buffer captured by resolve. Call once
after queue.submit(). The map completes a frame or two later; when it does
the per-pass EMA is updated and the buffer returned to the pool.
Per-pass timings, sorted most-expensive first.
Max passes bracketed per frame. Crafty runs ~30-40; leaves headroom.