Skip to content

Commit 1f10d0c

Browse files
[naga] Don't report shader errors as their own source (#8258)
1 parent 4566e56 commit 1f10d0c

File tree

4 files changed

+4
-11
lines changed

4 files changed

+4
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ By @cwfitzgerald in [#8162](https://github.com/gfx-rs/wgpu/pull/8162).
197197
- Add f16 IO polyfill on Vulkan backend to enable SHADER_F16 use without requiring `storageInputOutput16`. By @cryvosh in [#7884](https://github.com/gfx-rs/wgpu/pull/7884).
198198
- For custom Naga backend authors: `naga::proc::Namer` now accepts reserved keywords using two new dedicated types, `proc::{KeywordSet, CaseInsensitiveKeywordSet}`. By @kpreid in [#8136](https://github.com/gfx-rs/wgpu/pull/8136).
199199
- **BREAKING**: Previously the WGSL storage-texture format `rg11b10float` was incorrectly accepted and generated by naga, but now only accepts the the correct name `rg11b10ufloat` instead. By @ErikWDev in [#8219](https://github.com/gfx-rs/wgpu/pull/8219).
200+
- The [`source()`](https://doc.rust-lang.org/std/error/trait.Error.html#method.source) method of `ShaderError` no longer reports the error as its own source. By @andyleiserson in [#8258](https://github.com/gfx-rs/wgpu/pull/8258).
200201

201202
#### DX12
202203

naga/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ where
134134
E: Error + 'static,
135135
{
136136
fn source(&self) -> Option<&(dyn Error + 'static)> {
137-
Some(&self.inner)
137+
self.inner.source()
138138
}
139139
}
140140

naga/src/front/glsl/error.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,7 @@ impl core::fmt::Display for ParseErrors {
198198
}
199199
}
200200

201-
impl core::error::Error for ParseErrors {
202-
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
203-
None
204-
}
205-
}
201+
impl core::error::Error for ParseErrors {}
206202

207203
impl From<Vec<Error>> for ParseErrors {
208204
fn from(errors: Vec<Error>) -> Self {

naga/src/front/wgsl/error.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,7 @@ impl core::fmt::Display for ParseError {
127127
}
128128
}
129129

130-
impl core::error::Error for ParseError {
131-
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
132-
None
133-
}
134-
}
130+
impl core::error::Error for ParseError {}
135131

136132
#[derive(Copy, Clone, Debug, PartialEq)]
137133
pub enum ExpectedToken<'a> {

0 commit comments

Comments
 (0)