-
Notifications
You must be signed in to change notification settings - Fork 920
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
[naga] Add packed
as a keyword for GLSL
#5855
Conversation
Turns out that sometimes `packed` is a keyword, and the produced GLSL had syntax errors due to that.
I'm wondering whether there are any other similar keywords that should also be added. Such as the |
I was wondering that too, but I couldn't find any evidence on the internet that any of them should be treated as a keyword. However, we may prefer falsely claiming that something is a keyword to falsely claiming that something isn't. There's also an option to test those suspected keywords on a platform where |
I tried looking at the documents linked in the comments within this list, and search for |
@sombraguerrero has confirmed that whilst I did some tests myself (but not using wgpu, as OpenGL does not work for me in wgpu). And
I also tried other similar identifiers in WebGL, but it really seems that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
I looked at the specs and we seem to be missing a few more, I will open a PR for the remaining ones. |
Turns out that sometimes
packed
is a keyword, and the produced GLSL had syntax errors due to that.Connections
Fixes #5853.
Description
Sometimes
packed
is a keyword in GLSL, and naga was preserving variables named that way, which caused syntax errors.Testing
I executed the following command and observed that the
packed
variable name was suffixed with an underscore. The input file was the original file that caused syntax errors for some users (https://github.com/ruffle-rs/ruffle/blob/036839fb1f382852711e0c1e270fa3e69a3a540a/render/wgpu/shaders/filter/displacement_map.wgsl). Others have confirmed that renaming the identifier to something else thanpacked
fixes those issues.Checklist
cargo fmt
.cargo clippy
(it produces warnings but my patch does not introduce any). If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.