isVec64()
Function in Types
Narrows a ShaderType to the emulated-double vector arm (vec2f64T and its 3- and 4-wide siblings).
import { isVec64 } from 'typeshade'import { isVec64 } from 'typeshade/core/ir'
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
const isVec64: ( t: ShaderType,) => t is Extract<ShaderType, { kind: "vec64"; }>Parameters
Return value
t is Extract<ShaderType, { kind: 'vec64' }>
Description
Narrows a ShaderType to the emulated-double vector arm (vec2f64T and its 3- and
4-wide siblings). It is distinct from isVec, which matches only the native vec kind
and is false for an emulated-double vector. Component access (.comp() and swizzles)
accepts either isVec(t) || isVec64(t), since both kinds support it, each through its own
emitted form.
Examples
Example
import { isVec64 } from 'typeshade'import { vec2f64T, vec2fT } from 'typeshade/core/ir'
isVec64(vec2f64T) // trueisVec64(vec2fT) // false: a native vec, use isVec for thatSee also
Source
src/core/ir/types/predicates.ts, line 101, at commit af54ddad5