Error on const, shader validation on older shader language version ?
Closed this issue · 7 comments
Hi,
first of all, this extension is great. GG
I tried to use in vscode but it seems that the validation produces errors when chrome canary is fine with the shader. It seems like the validation is not up to date with the shading language.
on this one the first line produces an error.
--> webgpu-experiment/src/node-functions.wgsl:2:1
error: error: expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file, found 'const'
┌─ wgsl:2:1
│
2 │ const NodeMaxLevel = 14;
│ ^^^^^ expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file
Note that this shader is injected a bit like include in a more complex compute shader and vertex shader. Still It feels that it validates on a different version and the language.
const are not yet supported in naga: gfx-rs/naga#2071 should be fixed in gfx-rs/naga#2075
That being said, naga was indeed outdated, so I updated it, and published cargo-wgsl 0.0.12
🙏 thx
I'd like to keep that open, if you don't mind. Just to keep track of that.
Ho np 👍
New versions are released with const support.
New versions are released with const support.
Great will take a look at that, thanks.
Indeed it is now working as expected. cargo-wgsl is also updated already so vscode-wgsl just works ™️