Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on const, shader validation on older shader language version ? #14

Closed
cedricpinson opened this issue Nov 22, 2022 · 7 comments
Closed

Comments

@cedricpinson
Copy link

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.

node-functions.txt

@PolyMeilex
Copy link
Owner

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

@cedricpinson
Copy link
Author

🙏 thx

@PolyMeilex
Copy link
Owner

I'd like to keep that open, if you don't mind. Just to keep track of that.

@cedricpinson
Copy link
Author

Ho np 👍

@codeart1st
Copy link

New versions are released with const support.

@PolyMeilex
Copy link
Owner

New versions are released with const support.

Great will take a look at that, thanks.

@PolyMeilex
Copy link
Owner

Indeed it is now working as expected. cargo-wgsl is also updated already so vscode-wgsl just works ™️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants