wgslType
On this page

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): string

Parameters

t ShaderType

Return value

string

Exceptions

SD0040

SD0040 if t is an f64 or vec64 type, or a matrix of f64. Those types exist only before the double-precision lowering pass (fp64Lower, which every emit runs) rewrites them to vec2<f32> and the DF64 struct 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

Edit this page Report a problem