naga
naga copied to clipboard
[wgsl-in] Implement const expressions
https://gpuweb.github.io/gpuweb/wgsl/#const-expressions
Spec PR: https://github.com/gpuweb/gpuweb/pull/2668
The link is broken af far as I can tell, btw. I dont know if there is a persistent link and whether it would be a good idea to use that one, but...
As far as I understand: These are expressed as const
declarations, be it at module scope or function scope. And when this gets introduced let
declarations will be limited to function scope again.
These new const declarations reintroduce syntax that was used in the past, but meant something slightly different back then I believe.
I'm leaving this here to 1. validate my understanding and 2. to hopefully make this discoverable when searching issues. As it stands, if someone reads the official spec, and tries to use this software, they might be confused, as I was.
The link is broken
I believe the link should refer to here: https://gpuweb.github.io/gpuweb/wgsl/#const-expressions
"creation-time expression" was renamed to "const-expression" by https://github.com/gpuweb/gpuweb/pull/3189