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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Bottom level categories:
- DX11
- GLES
- WebGPU
- Enscripten
- Emscripten
- Hal
-->

Expand All @@ -46,6 +46,7 @@ Bottom level categories:

- Convert all `Default` Implementations on Enums to `derive(Default)`
- Implement `Default` for `CompositeAlphaMode`
- Improve compute shader validation error message. By @haraldreingruber in [#3139](https://github.com/gfx-rs/wgpu/pull/3139)

#### WebGPU
- Implement `queue_validate_write_buffer` by @jinleili in [#3098](https://github.com/gfx-rs/wgpu/pull/3098)
Expand Down
4 changes: 3 additions & 1 deletion wgpu-core/src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,11 @@ pub enum StageError {
#[error("shader module is invalid")]
InvalidModule,
#[error(
"shader entry point current workgroup size {current:?} must be less or equal to {limit:?} of total {total}"
"shader entry point's workgroup size {current:?} ({current_total} total invocations) must be less or equal to the per-dimension limit {limit:?} and the total invocation limit {total}"
)]
InvalidWorkgroupSize {
current: [u32; 3],
current_total: u32,
limit: [u32; 3],
total: u32,
},
Expand Down Expand Up @@ -1098,6 +1099,7 @@ impl Interface {
{
return Err(StageError::InvalidWorkgroupSize {
current: entry_point.workgroup_size,
current_total: total_invocations,
limit: max_workgroup_size_limits,
total: self.limits.max_compute_invocations_per_workgroup,
});
Expand Down