---
title: "Attributes, the TypeShade language reference for shaders"
description: "The 9 attributes written with `@`: an entry’s stage, a kernel function’s workgroup size and the decorated form of the attribute types."
url: https://typeshade.dev/reference/attributes/
language: en
---

# Attributes

9 names

The attributes written with `@`: an entry’s stage, a kernel function’s workgroup size and the decorated form of the attribute types.

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

**[`@vertex`](https://typeshade.dev/reference/attributes/vertex/)**

Marks the pipeline's vertex-stage entry point, on the function declaration: `@vertex export function vs(…) { … }`.

**[`@fragment`](https://typeshade.dev/reference/attributes/fragment/)**

Marks the pipeline's fragment-stage entry point, on the function declaration: `@fragment export function fs(…) { … }`.

**[`@compute`](https://typeshade.dev/reference/attributes/compute/)**

Marks a compute-stage entry point with its workgroup size, one to three extents, on the function declaration: `@compute([64]) export function main(…) { … }`.

**[`@workgroup_size`](https://typeshade.dev/reference/attributes/workgroup_size/)**

Optionally states the workgroup size of each loop that does not reduce in a kernel function, an exported function that takes an array with no size or a 2D storage texture, as one extent: `@workgroup_size([128]) export function scale(xs: array<f32>) { … }`.

**[`@builtin`](https://typeshade.dev/reference/attributes/builtin/)**

The decorated form of `builtin<N>`, a WebGPU builtin value: `i: builtin<"vertex_index">` for `@builtin("vertex_index") i: u32`.

**[`@location`](https://typeshade.dev/reference/attributes/location/)**

The decorated form of `location<I, T>`, a numeric shader IO location: `uv: location<0, vec2>` for `@location(0) uv: vec2`.

**[`@interpolate`](https://typeshade.dev/reference/attributes/interpolate/)**

The decorated form of the `interpolate` option, `location<0, u32, { interpolate: "flat" }>`, or a type and a sampling as `{ interpolate: ["linear", "centroid"] }`.

**[`@invariant`](https://typeshade.dev/reference/attributes/invariant/)**

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.

**[`@blend_src`](https://typeshade.dev/reference/attributes/blend_src/)**

The decorated form of the `blend_src` option, `location<0, vec4, { blend_src: 0 }>` beside `{ blend_src: 1 }`: which of the two colours a dual-source blend mixes this fragment output is.

Names, declarations and descriptions come from the compiler language-service tables at the pinned commit. Builtin output spellings and stage rules are read from compiler code. The site supplies the groupings and explanations around these entries.
