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

unhelpful diagnostic from naga regarding missing & #6983

Open
crowlKats opened this issue Jan 24, 2025 · 0 comments
Open

unhelpful diagnostic from naga regarding missing & #6983

crowlKats opened this issue Jan 24, 2025 · 0 comments
Labels
area: naga front-end kind: diagnostics Error message should be better lang: WGSL WebGPU Shading Language naga Shader Translator

Comments

@crowlKats
Copy link
Collaborator

wgpu version 24.0.0

While working on the reworked webgpu bindings for Deno, I attempted to run a test, which is a 1-1 copy of hello-compute but written in javascript.

So using this shader, I am getting this diagnostic:

Device::create_shader_module error: 
Shader validation error: 
   ┌─ :20:36
   │
20 │     let array_length = arrayLength(input);
   │                                    ^^^^^ naga::Expression [4]


error: GPUValidationError: 
Shader validation error: 
   ┌─ :20:36
   │
20 │     let array_length = arrayLength(input);
   │                                    ^^^^^ naga::Expression [4]

: Entry point doubleMe at Compute is invalid: Expression [4] is invalid: Loading of [3] can't be done

Apparently, thanks to @teoxoy the solution is to do arrayLength(&input). The diagnostic is not very helpful here.
Also unsure why this is happening, since the wgpu repo itself is using the shader as-is without this change, yet the example works fine.

@crowlKats crowlKats added area: naga front-end kind: diagnostics Error message should be better lang: WGSL WebGPU Shading Language naga Shader Translator labels Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: naga front-end kind: diagnostics Error message should be better lang: WGSL WebGPU Shading Language naga Shader Translator
Projects
None yet
Development

No branches or pull requests

1 participant