@compute
On this page

@compute

Attribute

Marks a top-level exported function as a compute-stage entry point, with an optional workgroup size: @compute([64]).

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

Syntax

declare function compute(workgroupSize: readonly number[]): (target: Function, context?: unknown) => void
declare function compute(target: Function, context?: unknown): void

Parameters

  • workgroupSize readonly number[]

It is also written on its own, with no arguments.

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