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

Cannot define fractional constants #471

Closed
Diggsey opened this issue Feb 14, 2021 · 1 comment · Fixed by #2309
Closed

Cannot define fractional constants #471

Diggsey opened this issue Feb 14, 2021 · 1 comment · Fixed by #2309
Labels
area: front-end Input formats for conversion kind: feature New feature or request lang: WGSL WebGPU shading language

Comments

@Diggsey
Copy link

Diggsey commented Feb 14, 2021

The following will fail to compile:

const w2: vec4<f32> = vec4<f32>(4.0/9.0, 0.0, 0.0, 0.0);

(Even if const is replaced with var, it will still fail)

@kvark
Copy link
Member

kvark commented Feb 14, 2021

I think the part of WGSL specification related to this is still being hashed out - gpuweb/gpuweb#1272
So we could either just put the concrete values in there, or we can do our best at computing the constants as we parse.

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.

3 participants