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] Rejection of composite consts without explicit nested types #1957

Closed
hanawatson opened this issue May 29, 2022 · 0 comments · Fixed by #2266
Closed

[wgsl-in] Rejection of composite consts without explicit nested types #1957

hanawatson opened this issue May 29, 2022 · 0 comments · Fixed by #2266
Labels
area: front-end Input formats for conversion kind: bug Something isn't working lang: WGSL WebGPU shading language

Comments

@hanawatson
Copy link

Even though the types are specified in the declaration of the const, naga rejects consts that are composite if they omit type information from their constructors.

WGSL:

let const0: vec3<f32> = vec3(0.0, 0.0, 0.0);

@stage(compute) @workgroup_size(1)
fn main() {
    var var0 = 0;
}

Error:

        error: expected '<', found '('
          ┌─ test.wgsl:1:29
          │
        1 │ let const0: vec3<f32> = vec3(0.0, 0.0, 0.0);
          │                             ^ expected '<'
        
        Could not parse WGSL

The above works fine if given e.g. vec3<f32>(0.0, 0.0, 0.0). I believe it should be acceptable to omit the type in the constructor.

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: bug Something isn't working lang: WGSL WebGPU shading language
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants