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

Improve compute shader validation error message #3139

Conversation

haraldreingruber
Copy link
Contributor

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
Potential improvement for #2985

Description
The previous error message was easily misunderstood, as it didn't say explicitly that each dimension and the total number must be below the bounds.

For example, instead of:

shader entry point current workgroup size [8, 8, 8] must be less or equal to [256, 256, 64] of total 256

after applying this PR the error is:

shader entry point current workgroup size [8, 8, 8] of total 512 must be less or equal to [256, 256, 64] and of total 256

Thanks to @mwalczyk for the original improvement idea 🙏

Testing
In shader.wgsl of the hello-compute example, I've changed the @workgroup_size(1) to @workgroup_size(8, 8, 8)

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Suggested some alternative wording to help make the error message even more clear.

CHANGELOG.md Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2022

Codecov Report

Merging #3139 (0ec0e65) into master (d1ff383) will increase coverage by 63.42%.
The diff coverage is 0.00%.

@@             Coverage Diff             @@
##           master    #3139       +/-   ##
===========================================
+ Coverage    1.34%   64.76%   +63.42%     
===========================================
  Files          70       81       +11     
  Lines       18683    38764    +20081     
===========================================
+ Hits          251    25106    +24855     
+ Misses      18432    13658     -4774     
Impacted Files Coverage Δ
wgpu-core/src/validation.rs 58.87% <0.00%> (+58.87%) ⬆️
wgpu-hal/src/empty.rs 0.00% <0.00%> (ø)
wgpu-core/src/present.rs 0.00% <0.00%> (ø)
wgpu/src/util/encoder.rs 0.00% <0.00%> (ø)
wgpu-hal/src/dx11/device.rs 0.00% <0.00%> (ø)
wgpu/examples/framework.rs
wgpu-hal/src/metal/mod.rs
wgpu/examples/cube/main.rs
deno_webgpu/src/error.rs
wgpu/tests/common/mod.rs
... and 83 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cwfitzgerald cwfitzgerald merged commit 51b34c5 into gfx-rs:master Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants