Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

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.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
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