Scalar
Type in Types
The four native scalar kinds: the ones WGSL and GLSL ES 3.00 both represent directly in hardware, and the set a ShaderType of kind: 'scalar' can carry.
import type { Scalar } from 'typeshade'import type { Scalar } from 'typeshade/core/ir'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
type Scalar = 'f32' | 'i32' | 'u32' | 'bool';Description
When a binary operator
mixes two of them, the result follows the native promotion order f32 > i32 > u32. Emulated double precision is a separate ShaderType kind, f64T, so it never enters
native promotion and every code path that switches on the scalar kind decides about it
separately (see ShaderType).
See also
Source
src/core/ir/types/shader-type.ts, line 12, at commit af54ddad5