mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-26 00:33:51 +00:00
Merge pull request #1380 from fintelia/patch-1
Include shader label in log message if shader parsing fails
This commit is contained in:
commit
6485fc0ca2
@ -1016,7 +1016,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
let module = match parser.parse() {
|
||||
Ok(module) => Some(module),
|
||||
Err(err) => {
|
||||
log::warn!("Failed to parse shader SPIR-V code: {:?}", err);
|
||||
log::warn!("Failed to parse shader SPIR-V code for {:?}: {:?}", desc.label, err);
|
||||
if desc.flags.contains(wgt::ShaderFlags::VALIDATION) {
|
||||
return Err(pipeline::CreateShaderModuleError::Parsing);
|
||||
}
|
||||
@ -1033,7 +1033,7 @@ impl<B: GfxBackend> Device<B> {
|
||||
match naga::front::wgsl::parse_str(&code) {
|
||||
Ok(module) => (None, Some(module)),
|
||||
Err(err) => {
|
||||
log::error!("Failed to parse WGSL code: {}", err);
|
||||
log::error!("Failed to parse WGSL code for {:?}: {}", desc.label, err);
|
||||
return Err(pipeline::CreateShaderModuleError::Parsing);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user