wgslType()
Function in Emit
Spell a ShaderType as WGSL type syntax.
import { wgslType } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
function wgslType(t: ShaderType): stringParameters
Return value
string
Exceptions
SD0040SD0040iftis anf64orvec64type, or a matrix off64. Those types exist only before the double-precision lowering pass (fp64Lower, which every emit runs) rewrites them tovec2<f32>and theDF64struct types. Reaching one here means that pass did not run, and the error is raised so a shader never ships with its double precision quietly reduced to single precision.
See also
Source
src/core/backends/wgsl.ts, line 59, at commit 26de7be8