vec3u
On this page

vec3u()

Function in Builtins

A vec3<u32> constructor, WGSL-style: vec3u(x, y, z).

import { vec3u } from 'typeshade/core/ir'

This export returns an IR node. A "use typeshade" file calls the builtin itself: vec3u()

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

Syntax

const vec3u: (...a: NodeLike[]) => Node<"vec3<u32>">

Parameters

...a NodeLike[]

Return value

Node<'vec3<u32>'>

Description

Bare number components lift to u32, where vec3 lifts them to f32. It is the type of the compute global_invocation_id builtin, so this is how a workgroup coordinate is built by hand.

Examples

Example

import { vec3u } from 'typeshade/core/ir'
const origin = vec3u(0, 0, 0) // Node<'vec3<u32>'>

In the guide

See also

Source

src/core/ir/node.ts, line 2288, at commit af54ddad5

Edit this page Report a problem