Narrow source.webgl from WebGLShaderSources | undefined to
WebGLShaderSources, throwing with a diagnostic message if the
source has no GLSL strings.
Use this at construction sites that intrinsically require the
GLSL backend (the GLSL ShaderMaterial wrappers in
picking-material.ts, the TSL↔GLSL parity harness). Production
shaders all ship webgl today, so the throw never fires in
practice — it's the runtime invariant that the optional type
doesn't express on its own.
Narrow
source.webglfromWebGLShaderSources | undefinedtoWebGLShaderSources, throwing with a diagnostic message if the source has no GLSL strings.Use this at construction sites that intrinsically require the GLSL backend (the GLSL
ShaderMaterialwrappers inpicking-material.ts, the TSL↔GLSL parity harness). Production shaders all shipwebgltoday, so the throw never fires in practice — it's the runtime invariant that the optional type doesn't express on its own.