From 5ba504834925577fc0b5fdf86babb6ce3c1a2415 Mon Sep 17 00:00:00 2001 From: Harald Reingruber Date: Sat, 15 Oct 2022 21:34:27 +0200 Subject: [PATCH 1/4] Improve compute shader validation error message --- wgpu-core/src/validation.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wgpu-core/src/validation.rs b/wgpu-core/src/validation.rs index 17d322db26..14f1c3d542 100644 --- a/wgpu-core/src/validation.rs +++ b/wgpu-core/src/validation.rs @@ -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 current workgroup size {current:?} of total {current_total} must be less or equal to {limit:?} and of total {total}" )] InvalidWorkgroupSize { current: [u32; 3], + current_total: u32, limit: [u32; 3], total: u32, }, @@ -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, }); From 634bd714d3e1fc38e524fbe16013fcb542657fbe Mon Sep 17 00:00:00 2001 From: Harald Reingruber Date: Tue, 25 Oct 2022 22:14:07 +0200 Subject: [PATCH 2/4] Add entry to changelog. --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b243a6c4e..e02365494e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ Bottom level categories: - DX11 - GLES - WebGPU -- Enscripten +- Emscripten - Hal --> @@ -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 #### WebGPU - Implement `queue_validate_write_buffer` by @jinleili in [#3098](https://github.com/gfx-rs/wgpu/pull/3098) From d14c63b5e48e3cd54bf1d5e672e89c8a50dc560b Mon Sep 17 00:00:00 2001 From: Harald Reingruber Date: Sat, 29 Oct 2022 22:44:16 +0200 Subject: [PATCH 3/4] Improve error message wording (by cwfitzgerald) Co-authored-by: Connor Fitzgerald --- wgpu-core/src/validation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgpu-core/src/validation.rs b/wgpu-core/src/validation.rs index 14f1c3d542..3fa41032d1 100644 --- a/wgpu-core/src/validation.rs +++ b/wgpu-core/src/validation.rs @@ -236,7 +236,7 @@ pub enum StageError { #[error("shader module is invalid")] InvalidModule, #[error( - "shader entry point current workgroup size {current:?} of total {current_total} must be less or equal to {limit:?} and 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], From 0ec0e6520bea65723aa3246558763ac404ebe9cd Mon Sep 17 00:00:00 2001 From: Harald Reingruber Date: Sat, 29 Oct 2022 22:57:29 +0200 Subject: [PATCH 4/4] Add credit and PR link to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e02365494e..775e7243e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,7 +46,7 @@ Bottom level categories: - Convert all `Default` Implementations on Enums to `derive(Default)` - Implement `Default` for `CompositeAlphaMode` -- Improve compute shader validation error message +- 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)