---
title: "vec2u in WGSL, GLSL and TypeShade: shader type reference"
description: "vec2u is vec2<u32> in WGSL and uvec2 in GLSL ES 3.00. A two-component vector of u32."
url: https://typeshade.dev/reference/types/vec2u/
language: en
---

# `vec2u`

Type

A two-component vector of `u32`.

The signature, the sentence and any message are the compiler's own text at commit af54ddad5.

## Syntax

```ts
interface vec2u {
  readonly [vecTag]: readonly ['u32', 2]
  [index: number]: u32
  x: u32
  y: u32
  r: u32
  g: u32
  …
}
```

The `…` line stands for 56 more members, the swizzles. A swizzle reads two to four components as a new vector of the same element type. The components come in any order and may repeat, and their letters come from one set, `xyzw` or `rgba`.

## Examples

- [`gallery/integer-math/integer-math.shade.ts`](https://typeshade.dev/guide/examples/integer-math/)
- [`gallery/packing-bitcast/packing-bitcast.shade.ts`](https://typeshade.dev/guide/examples/packing-bitcast/)
- [`gallery/workgroup-tile-2d/workgroup-tile-2d.shade.ts`](https://typeshade.dev/guide/examples/workgroup-tile-2d/)

## See also

- [Types](https://typeshade.dev/reference/types/)
- [`vec2u()` in `typeshade/core/ir`](https://typeshade.dev/api/vec2u/)
