vec2i()
Function in Builtins
A vec2<i32> constructor, WGSL-style: vec2i(x, y).
import { vec2i } from 'typeshade/core/ir'
This export returns an IR node. A "use typeshade" file calls the builtin itself: vec2i()
The signature, the description and the examples come from the compiler's own source at commit af54ddad5.
Syntax
const vec2i: (...a: NodeLike[]) => Node<"vec2<i32>">Parameters
...aNodeLike[]
Return value
Node<'vec2<i32>'>
Description
Bare number components lift to i32,
the type of the integer texel coordinate textureLoad takes
(vec2i(toI32(...), toI32(...))).
Examples
Example
import { vec2i, toI32, f32T, fn } from 'typeshade/core/ir'
const coord = fn('coord', { u: f32T, v: f32T }, ({ u, v }) => vec2i(toI32(u), toI32(v)))In the guide
See also
Source
src/core/ir/node.ts, line 2273, at commit af54ddad5