[naga] Don't report shader errors as their own source (#8258)

This commit is contained in:
Andy Leiserson 2025-09-24 19:42:24 -07:00 committed by GitHub
parent 4566e56677
commit 1f10d0ce8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 4 additions and 11 deletions

View File

@ -197,6 +197,7 @@ By @cwfitzgerald in [#8162](https://github.com/gfx-rs/wgpu/pull/8162).
- 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).
- 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).
- **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).
- 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).
#### DX12

View File

@ -134,7 +134,7 @@ where
E: Error + 'static,
{
fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(&self.inner)
self.inner.source()
}
}

View File

@ -198,11 +198,7 @@ impl core::fmt::Display for ParseErrors {
}
}
impl core::error::Error for ParseErrors {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
None
}
}
impl core::error::Error for ParseErrors {}
impl From<Vec<Error>> for ParseErrors {
fn from(errors: Vec<Error>) -> Self {

View File

@ -127,11 +127,7 @@ impl core::fmt::Display for ParseError {
}
}
impl core::error::Error for ParseError {
fn source(&self) -> Option<&(dyn core::error::Error + 'static)> {
None
}
}
impl core::error::Error for ParseError {}
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ExpectedToken<'a> {