@builtin
On this page

@builtin

Attribute

Binds a field or parameter to a WebGPU builtin value, such as @builtin("vertex_index").

The signature and the sentence under each name are the compiler's own text at commit 26de7be8.

Syntax

declare function builtin(name: string): (target: unknown, context?: unknown) => void

Parameters

  • name string

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

Examples

See also

Edit this page Report a problem