The tracer's top-level buffer: header, instance records, nodes. Bind it as bvhTraceTopLevel.
True while a shape that adds or removes instances is being built or waits to be swapped in. Quality checks don't count.
Records in the current shape (instances rays can see once traced, hidden ones included).
Levels of the current shape.
GPU bytes this top level holds.
Increments when buffer is replaced (rebuild bind groups then).
Whether slot holds a merged static group's record.
StaticisCompiles the gather and the refit, and starts the shape worker (so its module loads while they compile).
Puts an instance in slot (adding it, or replacing what the slot held), or
removes it (null). Adding or removing needs a new shape (built off the
frame, so the instance appears a frame or two later); replacing one with
the same slot only rewrites its entry. Throws for a merged instance whose
transform isn't the identity, or that would replace a merged one with
another transform.
A mesh's object box, which shape builds use until its tree is placed (and after, unless the tree gives another).
A mesh's tree was placed (or replaced), or released (null). The mesh table reaches the GPU at the next update.
Moves an instance. Throws for a merged static group's record: its transform is baked into its mesh.
The build input: every occupied slot (hidden ones too, with visible 0 while not traced).
Brings the top level up to this frame: writes the changed instance and
mesh entries, swaps in an arrived shape, starts a build or quality check
if one is due, and records the refit pass (gather, then refit) when
anything it depends on changed. Call before anything traces in encoder.
Resolves once no shape build is pending (the last may still wait for the next update to be swapped in).
Relative SAH cost of the refit tree: from the last quality check, or the diagnostics readback when on.