Stats readback, part 2: after encode, copies this refit's stats
out unless an earlier copy is still being read. Does nothing unless
diagnostics is on.
Records the refit into pass: the clear, the climb and the repair
(which returns at once unless the climb gave up). tree holds
the nodes at the shape's nodeWordOffset; primitiveBoxes holds
PRIMITIVE_BOX_FLOATS floats per primitive and must be written
by an earlier dispatch or command.
StaticisThe refit needs subgroups; without them a caller uses its declared fallback (a CPU build).
Stats readback, part 1, without ever waiting: call at the start of a
frame. It maps the copy copyStats recorded in an earlier frame
(the host has submitted that frame by now); latestStats updates when
the mapping resolves.
Compiles the kernels (asynchronously, so the main thread doesn't stall), or waits for the shared ones.
Moves the tree the shape refits to another place in the node buffer (nodeWordOffset), keeping the shape.
Takes a new tree shape. Its buffers are written with queue.writeBuffer, so they are in place for the next submit.
Owns the refit's pipelines and its own buffers (topology, scratch, stats, parameters). The tree and the primitive boxes belong to the caller.