naga icon indicating copy to clipboard operation
naga copied to clipboard

[wgsl-in] Implement const expressions

Open Gordon-F opened this issue 2 years ago • 2 comments

https://gpuweb.github.io/gpuweb/wgsl/#const-expressions

Spec PR: https://github.com/gpuweb/gpuweb/pull/2668

Gordon-F avatar Apr 14 '22 18:04 Gordon-F

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.

9SMTM6 avatar Aug 31 '22 12:08 9SMTM6

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

yutannihilation avatar Sep 09 '22 03:09 yutannihilation