Switch a WebGL2 context to first-vertex flat sampling, if it can.
Idempotent and failure-tolerant by design: called once per PickingSystem, on a
context that may be WebGPU (no-op), may lack the extension (no-op), or may be a
unit-test double (no-op). A missing extension is normal, not an error — hence
log.info rather than a warning. Both arms log exactly once per session, which
is what makes a pick-id divergence diagnosable from a console dump alone.
Takes the RENDERER rather than its context so that every duck-type lives here:
getContext itself is absent on the partial renderer doubles the picking-system
unit tests construct, so a call site that dereferenced it would throw before
reaching any of the guards below.
Parameters
renderer: unknown
The renderer, or anything shaped unlike one.
Returns boolean
true when the convention was switched, false when left at the
platform default. Returned rather than inferred so a test can assert both arms.
Switch a WebGL2 context to first-vertex
flatsampling, if it can.Idempotent and failure-tolerant by design: called once per
PickingSystem, on a context that may be WebGPU (no-op), may lack the extension (no-op), or may be a unit-test double (no-op). A missing extension is normal, not an error — hencelog.inforather than a warning. Both arms log exactly once per session, which is what makes a pick-id divergence diagnosable from a console dump alone.Takes the RENDERER rather than its context so that every duck-type lives here:
getContextitself is absent on the partial renderer doubles the picking-system unit tests construct, so a call site that dereferenced it would throw before reaching any of the guards below.