Vertex index pairs [numSegments * 2]
Visibility mask [numSegments]
Start interpolation parameters [numSegments]
End interpolation parameters [numSegments]
Total number of segments
Total number of source vertices (bounds the touch tables)
Output start joint codes [visibleCount]
Output end joint codes [visibleCount]
Number of visible segments written
Per-endpoint joint code (drives the shader's join geometry and cap).
TypeScript reference for the Rust
compute_joint_codeskernel — see the Rust doc comment inwasm/rust/src/lines_clipping.rsfor the full rationale. This mirror is not just a WASM-missing fallback: it is the production backend forndim > 16, which the fixed-size Rust kernels cannot serve, so the two must agree exactly.Agreement is trivial here in a way it was not for the scalar this replaced: the output is integer index arithmetic, so there is no f32/f64 accumulation order to reconcile between the backends.
0-1-2+(slot + 1)slot, at that segment's START-(slot + 3)slot, at that segment's ENDslotis a storage slot in the line texture, so it survives the depth-sort worker's draw-order permutation without adjustment.