WGSL template arg. parsing should permit a single trailing comma #6394
Labels
area: correctness
We're behaving incorrectly
area: cts
Issues stemming from the WebGPU Conformance Test Suite
area: naga front-end
area: validation
Issues related to validation, diagnostics, and error handling
good first issue
Good for newcomers
lang: WGSL
WebGPU Shading Language
naga
Shader Translator
type: bug
Something isn't working
Description
Until recently, Dawn didn't allow a trailing comma in template argument lists, and WebGPU CTS also tested that parse cases with a trailing comma failed to parse. Naga also implemented this behavior. However, it turns out that this was all incorrect! 😱
The WGSL. spec. states that the
template_arg_comma_list
must accept a single optional trailing comma:As of gpuweb/cts#3959, the CTS fixed this to follow the spec., with Dawn following suit in https://crbug.com/366000875. Naga should also fix this, so we don't diverge.
Repro steps
Try to compile this shader:
…which, at time of writing, yields the following in
naga-cli
:Alternatively, if lines 3-4 are commented out:
Expected vs observed behavior
The repro steps should produce no errors.
Extra materials
-
Platform
-
The text was updated successfully, but these errors were encountered: