Rule 12.3
On this page

Rule 12.3

Chapter 12, Diagnostics Test

Severity must follow the target’s role: a program WGSL refuses must be an error; a shortfall of GLSL ES 3.00 on a module with a render entry must be a warning that leaves wgsl in place; a compute-only module’s GLSL shortfall must be no diagnostic at all.

The rule text and the parts under it are the compiler's own English, as the design document writes them.

Rationale

an error would unsay a compile that succeeded, and a warning on a module GLSL could never serve is not news.

Derives from

src/compiler/ts/compile.ts; PR #165’s decision 1.

How it is verified

Checked by a test. A test, a gate script or a CI workflow names this rule, and the traceability check fails when a file listed below stops naming it.

Where the rule says the compiler enforces it:

  • src/compiler/ts/compile.contract.test.ts (keeps the wgsl of a render+compute module when only the GLSL backend cannot emit it and keeps the wgsl of a vertex+fragment module whose binding the GLSL backend cannot spell), each asserting one TS8015 warning;
  • the same file (yields wgsl but no glsl and no warning for a compute-only module);
  • src/compiler/ts/reserved-names.test.ts (reports a struct field named half, on the field), which asserts one TS8068 warning, wgsl carrying half and glsl undefined, and is a fourth pin of the same shape.

The files that verify it at commit 26de7be8, each at the first line that names the rule:

Error codes that enforce it

The diagnostic codes the rule names under Enforced by, or whose registry text names the rule:

TS8015 BACKEND
A backend that refused to emit a module the front end accepted. The message is the backend's own.
TS8068 RESERVED_NAME
A declared name that a target reserves, checked on the name the emit actually carries: half as a struct field, which ANGLE answers with "Illegal use of reserved word" in generated text the author never wrote.

See also

Source

The rule at commit 26de7be8:

Edit this page Report a problem