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 with no vertex or fragment program for the GLSL emit to carry is not news: its compute entries run on WebGL2 as pass programs (Rule 10.3, Rule 11.8).

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 (compiles a struct field named half, spelled half_ in the GLSL), which asserts wgsl carrying half and a GLSL emit that spells the field half_ in both stages: a name GLSL ES 3.00 reserves is no shortfall since change 0070, which gives it a fresh GLSL spelling.

The files that verify it at commit af54ddad5, 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.

See also

Source

The rule at commit af54ddad5:

Edit this page Report a problem