Hard error on SPIRV parsing failure when VALIDATION is requested

This commit is contained in:
Dzmitry Malyshau 2021-04-22 17:17:22 -04:00
parent fe07d272b1
commit 525efda7b2

View File

@ -1005,10 +1005,11 @@ impl<B: GfxBackend> Device<B> {
let module = match parser.parse() {
Ok(module) => Some(module),
Err(err) => {
// TODO: eventually, when Naga gets support for all features,
// we want to convert these to a hard error,
log::warn!("Failed to parse shader SPIR-V code: {:?}", err);
log::warn!("Shader module will not be validated or reflected");
if desc.flags.contains(wgt::ShaderFlags::VALIDATION) {
return Err(pipeline::CreateShaderModuleError::Parsing);
}
log::warn!("\tProceeding unsafely without validation");
None
}
};