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

# `vec2i`

Type

A two-component vector of `i32`.

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

## Syntax

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

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/msaa-resolve/msaa-resolve.shade.ts`](https://typeshade.dev/guide/examples/msaa-resolve/)
- [`gallery/storage-texture/storage-texture.shade.ts`](https://typeshade.dev/guide/examples/storage-texture/)

## See also

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