gfx-rs / wgpu

A cross-platform, safe, pure-Rust graphics API.
https://wgpu.rs
Apache License 2.0
12.44k stars 910 forks source link

WGSL: Unrecognized single-token diagnostic rule names are an error, but it should be a warning #6460

Open ErichDonGubler opened 5 hours ago

ErichDonGubler commented 5 hours ago

Description

Initial support for diagnostic filtering rules will land/has landed in #6456. With it, Naga's WGSL input will reject the following shader:

diagnostic(off, asdf);

…with this error:

error: invalid `diagnostic(…)` rule name
  ┌─ ../in.wgsl:1:17
  │
1 │ diagnostic(off, asdf);
  │                 ^^^^ not a valid diagnostic rule name
  │
  = note: See available trigger rules at <https://www.w3.org/TR/WGSL/#filterable-triggering-rules>.

However, the WGSL standard states:

Using an unrecognized triggering rule consisting of a single diagnostic name-token should trigger a warning from the user agent.

Repro steps

See above.

Expected vs observed behavior

warning plz

Extra materials

-

Platform

-

ErichDonGubler commented 5 hours ago

Currently blocked on https://github.com/gfx-rs/wgpu/issues/6458.