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

Initialiazing var foo: vec4f = vec4() fails with "type can't be inferred" #7356

Open
andyleiserson opened this issue Mar 17, 2025 · 1 comment · May be fixed by #7367
Open

Initialiazing var foo: vec4f = vec4() fails with "type can't be inferred" #7356

andyleiserson opened this issue Mar 17, 2025 · 1 comment · May be fixed by #7367
Assignees
Labels
area: naga front-end lang: WGSL WebGPU Shading Language naga Shader Translator type: bug Something isn't working

Comments

@andyleiserson
Copy link
Contributor

This failure is from https://martinlaxenaire.github.io/gpu-curtains/examples/shadow-mapping/ via https://bugzilla.mozilla.org/show_bug.cgi?id=1876519, although I think I also hit this problem writing test cases for an unrelated issue.

Shader 'Mesh 0 material render pipeline: fragment shader module' parsing error: type can't be inferred
    ┌─ wgsl:525:28
    │
525 │   var outputColor: vec4f = vec4();
    │                            ^^^^ type can't be inferred
@andyleiserson andyleiserson added lang: WGSL WebGPU Shading Language naga Shader Translator labels Mar 17, 2025
@andyleiserson andyleiserson self-assigned this Mar 17, 2025
@andyleiserson andyleiserson added the type: bug Something isn't working label Mar 17, 2025
@ErichDonGubler
Copy link
Member

Self-contained example:

@compute @workgroup_size(1, 1)
fn main() {
  var bruh: vec3u = vec3();
}

andyleiserson added a commit to andyleiserson/wgpu that referenced this issue Mar 18, 2025
* Support `vecN()` constructors (fixes gfx-rs#7356)
* Apply automatic conversions to the initializer for `let` bindings
@andyleiserson andyleiserson linked a pull request Mar 18, 2025 that will close this issue
6 tasks
ErichDonGubler pushed a commit to andyleiserson/wgpu that referenced this issue Mar 20, 2025
* Support `vecN()` constructors (fixes gfx-rs#7356)
* Apply automatic conversions to the initializer for `let` bindings
@andyleiserson andyleiserson moved this from Todo to In Progress in WebGPU for Firefox Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end lang: WGSL WebGPU Shading Language naga Shader Translator type: bug Something isn't working
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

3 participants