@diagnostic
On this page

@diagnostic

Attribute

Sets the severity of a WGSL diagnostic rule for the whole module, as in @diagnostic("off", "derivative_uniformity") on an entry.

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

Syntax

declare function diagnostic(severity: string, rule: string): (target: Function, context?: unknown) => void

Parameters

  • severity string
  • rule string

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

Description

Written on the entry, emitted as the module-scope diagnostic(off, derivative_uniformity);, because WGSL's function attribute does not reach the functions the entry calls. One rule is analysed here: derivative_uniformity.

Examples

See also

Edit this page Report a problem