vec2i
On this page

vec2i()

Function in Builtins

A vec2<i32> constructor, WGSL-style: vec2i(x, y).

import { vec2i } from 'typeshade'

The signature, the description and the examples come from the compiler's own source at commit 26de7be8.

Syntax

const vec2i: (...a: NodeLike[]) => Node<"vec2<i32>">

Parameters

...a NodeLike[]

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'
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 2548, at commit 26de7be8

Edit this page Report a problem