Luxar Viewer API Documentation - v2026.10.19
    Preparing search index...

    Function writeSortedIndexIdentity

    • Fill aSortedIndex[0..count) with identity ordering and register a single collapsed prefix update range. Ranges accumulate across commits while a mesh is not drawn (no backend merges them at flush), so every write collapses the pending set to one [0, max-end) range.

      Also re-homes the geometry on SLOT 0, which is what makes the split ownership of the swap safe. The slot lives on the geometry (so it survives the pool's release/re-acquire with the buffers it describes) while the selector uniform lives on the material, and the pool re-pairs the two freely: a geometry a sorted tenant left on slot 1, handed to a node whose fresh material defaults to slot 0, would draw the PREVIOUS tenant's permutation over a different element count — and an order-independent tenant is never tracked by the coordinator, so nothing would push the slot to its uniform. A full identity write is precisely the fresh-start signal, so normalising here means a default uniform is always correct and untracked nodes need no sync at all.

      Appends do not call it: they HOLD the draw at the previous population until the grown one is sorted (holdSortedIndexDrawForAppend).

      Parameters

      • geometry: InstancedBufferGeometry
      • count: number

      Returns void