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

[wgsl-in] Implement const expressions #1829

Closed
Gordon-F opened this issue Apr 14, 2022 · 2 comments · Fixed by #2309
Closed

[wgsl-in] Implement const expressions #1829

Gordon-F opened this issue Apr 14, 2022 · 2 comments · Fixed by #2309
Assignees
Labels
area: front-end Input formats for conversion kind: feature New feature or request lang: WGSL WebGPU shading language

Comments

@Gordon-F
Copy link
Collaborator

Gordon-F commented Apr 14, 2022

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

Spec PR: gpuweb/gpuweb#2668

@Gordon-F Gordon-F changed the title Implement creation-time expressions [wgsl-in] Implement creation-time expressions Apr 14, 2022
@kvark kvark added kind: feature New feature or request lang: WGSL WebGPU shading language area: front-end Input formats for conversion labels Apr 16, 2022
@teoxoy teoxoy added this to the WGSL Specification V1 milestone Apr 30, 2022
@9SMTM6
Copy link

9SMTM6 commented Aug 31, 2022

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.

@yutannihilation
Copy link
Contributor

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 gpuweb/gpuweb#3189

@Gordon-F Gordon-F changed the title [wgsl-in] Implement creation-time expressions [wgsl-in] Implement const expressions Oct 4, 2022
@teoxoy teoxoy self-assigned this Nov 24, 2022
haoyunfeix added a commit to haoyunfeix/tfjs that referenced this issue Dec 21, 2022
…s global scope

FIXES BUG: tensorflow#6746
Deno uses Naga for wgsl compilation, but Naga currently uses let for global constants(will be fixed in gfx-rs/naga#1829).
This PR helps WebGPU to run pose-detection models on Deno by removing global constants in shaders.

Address comments
gyagp pushed a commit to tensorflow/tfjs that referenced this issue Dec 21, 2022
* [webgpu] Use numbers directly instead of `const variables` in shader's global scope

FIXES BUG: #6746
Deno uses Naga for wgsl compilation, but Naga currently uses let for global constants(will be fixed in gfx-rs/naga#1829).
This PR helps WebGPU to run pose-detection models on Deno by removing global constants in shaders.
Linchenn pushed a commit to Linchenn/tfjs that referenced this issue Jan 9, 2023
…7193)

* [webgpu] Use numbers directly instead of `const variables` in shader's global scope

FIXES BUG: tensorflow#6746
Deno uses Naga for wgsl compilation, but Naga currently uses let for global constants(will be fixed in gfx-rs/naga#1829).
This PR helps WebGPU to run pose-detection models on Deno by removing global constants in shaders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: front-end Input formats for conversion kind: feature New feature or request lang: WGSL WebGPU shading language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants