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

# `vec4i`

Type

A four-component vector of `i32`.

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

## Syntax

```ts
interface vec4i {
  readonly [vecTag]: readonly ['i32', 4]
  [index: number]: i32
  x: i32
  y: i32
  z: i32
  w: i32
  r: i32
  g: i32
  b: i32
  a: i32
  …
}
```

The `…` line stands for 672 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/packed-bytes/packed-bytes.shade.ts`](https://typeshade.dev/guide/examples/packed-bytes/)

## See also

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