The line pixel-width scale, resY * |P11| (replacing the former CPU-pushed
perspective / ortho line-scale uniforms). Declared once as a vertex-stage global and assigned as
the FIRST statement of main() (luxarLineScale = uResolution.y * luxarProjectionSizeScale();), so every consumer — the line shader body and
the shared width/join helpers — reads it exactly where the uniform used to be
read, in the same expression shape (width * luxarLineScale / dist).
Inlining the product at each use site instead lets the compiler associate it
differently per site, a per-vertex rounding change measured at ~10x the flips
of a 1-ulp change in the scale itself (ANGLE/Metal, render gate).
luxarLineIsOrtho rides along the same way: assigned right after it
(luxarLineIsOrtho = luxarIsOrthoProjection();), it is the ortho branch of
the projection THIS draw uses — not a CPU-pushed camera-type flag, which a
draw through another projection (a cube-capture face, an embedder camera)
would contradict. A fragment stage that needs it re-derives it from the
same uniform (line visual) or receives it as a flat varying (line pick).
The line pixel-width scale, resY * |P11| (replacing the former CPU-pushed perspective / ortho line-scale uniforms). Declared once as a vertex-stage global and assigned as the FIRST statement of
main()(luxarLineScale = uResolution.y * luxarProjectionSizeScale();), so every consumer — the line shader body and the shared width/join helpers — reads it exactly where the uniform used to be read, in the same expression shape (width * luxarLineScale / dist). Inlining the product at each use site instead lets the compiler associate it differently per site, a per-vertex rounding change measured at ~10x the flips of a 1-ulp change in the scale itself (ANGLE/Metal, render gate).luxarLineIsOrthorides along the same way: assigned right after it (luxarLineIsOrtho = luxarIsOrthoProjection();), it is the ortho branch of the projection THIS draw uses — not a CPU-pushed camera-type flag, which a draw through another projection (a cube-capture face, an embedder camera) would contradict. A fragment stage that needs it re-derives it from the same uniform (line visual) or receives it as a flat varying (line pick).