---
title: "invariant: attribute in the TypeShade language reference"
description: "invariant, an attribute in the TypeShade language reference. The decorated form of the invariant option, builtin<\"position\", { invariant: true }>…"
url: https://typeshade.dev/reference/attributes/invariant/
language: en
---

# `@invariant`

Attribute

The decorated form of the `invariant` option, `builtin<"position", { invariant: true }>`: WGSL's promise that this position is computed the same way in two pipelines, so a depth pre-pass matches the shading pass.

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

## Syntax

```ts
declare function invariant(target: unknown, context?: unknown): void
```

## Parameters

This decorator is written on its own and takes no arguments.

The declaration also names what the TypeScript decorator runtime hands a decorator, `target` and `context`. A call passes neither.

## Description

Emits `invariant gl_Position;` on GLSL ES 3.00.

## See also

- [Attributes](https://typeshade.dev/reference/attributes/)
