---
title: "vec2u(): IR builder function in typeshade/core/ir, TypeShade"
description: "vec2u, an IR builder function in typeshade/core/ir. A vec2<u32> constructor, WGSL-style: vec2u(x, y)."
url: https://typeshade.dev/api/vec2u/
language: en
---

# `vec2u()`

Function in Builtins

A `vec2<u32>` constructor, WGSL-style: `vec2u`(x, y).

`import { vec2u } from 'typeshade/core/ir'`

This export returns an IR node. A `"use typeshade"` file calls the builtin itself: [`vec2u()`](https://typeshade.dev/reference/functions/vec2u/)

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

## Syntax

```ts
const vec2u: (...a: NodeLike[]) => Node<"vec2<u32>">
```

## Parameters

**`...a` `NodeLike[]`**

## Return value

`Node<'vec2<u32>'>`

## Description

Bare number components lift to `u32`, where [`vec2`](https://typeshade.dev/api/vec2/) lifts them to `f32`. For unsigned pairs such as a pick-buffer coordinate.

## Examples

### Example

```ts
import { vec2u } from 'typeshade/core/ir'

const pick = vec2u(0, 0)  // Node<'vec2<u32>'>
```

## In the guide

- [Values and mutation](https://typeshade.dev/guide/internals/values-and-mutation/)
- [The CPU oracle](https://typeshade.dev/guide/internals/the-cpu-oracle/)

## See also

- [`vec2u()`](https://typeshade.dev/reference/functions/vec2u/)
- [`vec2`](https://typeshade.dev/api/vec2/)

## Source

[`src/core/ir/node.ts`, line 2258](https://github.com/typeshade/typeshade/blob/af54ddad5/src/core/ir/node.ts#L2258), at commit af54ddad5
