mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-25 08:13:27 +00:00
add dxc error message formatting (#3632)
This commit is contained in:
parent
2c37608ad3
commit
4d15567392
@ -131,6 +131,7 @@ By @cwfitzgerald in [#3610](https://github.com/gfx-rs/wgpu/pull/3610).
|
||||
- Improve attachment related errors. By @cwfitzgerald in [#3549](https://github.com/gfx-rs/wgpu/pull/3549)
|
||||
- Make error descriptions all upper case. By @cwfitzgerald in [#3549](https://github.com/gfx-rs/wgpu/pull/3549)
|
||||
- Don't include ANSI terminal color escape sequences in shader module validation error messages. By @jimblandy in [#3591](https://github.com/gfx-rs/wgpu/pull/3591)
|
||||
- Report error messages from DXC compile. By @Davidster in [#3632](https://github.com/gfx-rs/wgpu/pull/3632)
|
||||
|
||||
#### WebGPU
|
||||
|
||||
|
@ -188,7 +188,12 @@ mod dxc {
|
||||
Err(e) => (
|
||||
Err(crate::PipelineError::Linkage(
|
||||
stage_bit,
|
||||
format!("DXC validation error: {:?}\n{:?}", e.0, e.1),
|
||||
format!(
|
||||
"DXC validation error: {:?}\n{:?}",
|
||||
get_error_string_from_dxc_result(&dxc_container.library, &e.0)
|
||||
.unwrap_or_default(),
|
||||
e.1
|
||||
),
|
||||
)),
|
||||
log::Level::Error,
|
||||
),
|
||||
@ -205,7 +210,11 @@ mod dxc {
|
||||
Err(e) => (
|
||||
Err(crate::PipelineError::Linkage(
|
||||
stage_bit,
|
||||
format!("DXC compile error: {e:?}"),
|
||||
format!(
|
||||
"DXC compile error: {:?}",
|
||||
get_error_string_from_dxc_result(&dxc_container.library, &e.0)
|
||||
.unwrap_or_default()
|
||||
),
|
||||
)),
|
||||
log::Level::Error,
|
||||
),
|
||||
@ -240,6 +249,15 @@ mod dxc {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn get_error_string_from_dxc_result(
|
||||
library: &hassle_rs::DxcLibrary,
|
||||
error: &hassle_rs::DxcOperationResult,
|
||||
) -> Result<String, hassle_rs::HassleError> {
|
||||
error
|
||||
.get_error_buffer()
|
||||
.and_then(|error| library.get_blob_as_string(&hassle_rs::DxcBlob::from(error)))
|
||||
}
|
||||
}
|
||||
|
||||
// These are stubs for when the `dxc_shader_compiler` feature is disabled.
|
||||
|
Loading…
Reference in New Issue
Block a user