Validate that every vertex index referenced by segments falls inside
the position buffer, and that any optional per-vertex attributes cover
up through the maximum referenced vertex.
Lines uniquely have an indirection (segments index into vertex data)
that validateProjectionInputs can't catch: positions might
have ≥ ndim entries but a malformed segments[i] could still reach
past the end. WASM clip / interpolate primitives index by segments[i]
with no bounds check, so this validation runs before every entry
point that touches segments. Cost is O(numSegments) — small relative
to the WASM call that follows.
Validate that every vertex index referenced by
segmentsfalls inside the position buffer, and that any optional per-vertex attributes cover up through the maximum referenced vertex.Lines uniquely have an indirection (segments index into vertex data) that validateProjectionInputs can't catch: positions might have ≥ ndim entries but a malformed segments[i] could still reach past the end. WASM clip / interpolate primitives index by segments[i] with no bounds check, so this validation runs before every entry point that touches segments. Cost is O(numSegments) — small relative to the WASM call that follows.