@location
On this page

@location

Attribute

Binds a field to a numeric shader IO location, such as @location(0).

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

Syntax

declare function location(n: number): (target: unknown, context?: unknown) => void

Parameters

  • n number

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