Allow override-expressions in element count of fixed-size arrays #5315
Labels
area: correctness
We're behaving incorrectly
lang: WGSL
WebGPU Shading Language
naga
Shader Translator
Description
We don't appear to allow override-expressions within template parameters, though it is specified by the WebGPU spec.'s
6.2.9 Array Types
section:Repro steps
I don't have straightforward STR ATM (TODO), but this repros with WebGPU CTS'
webgpu:shader,execution,zero_init:compute,zero_init:*
test (see the source of the shader it submits here: https://github.com/mozilla/gpuweb-cts/blob/41f89e77b67e6b66cb017be4e00235a0a9429ca7/src/webgpu/shader/execution/zero_init.spec.ts#L413-L429). In particular, thevar<workgroup> wg_mem : array<u32, ${wg_memory_limits} / 4>;
line exercises this functionality, yielding an error like the following:Expected vs observed behavior
Expected: Compilation Just Works™, and the shader module is usable in subsequently constructed pipelines.
Actual: We get a relatively unhelpful error diagnostic message, and the shader module is invalid.
Extra materials
None provided.
Platform
None provided.
The text was updated successfully, but these errors were encountered: