Add shader validation bool to DeviceDescriptor

This commit is contained in:
Dzmitry Malyshau 2020-06-06 23:26:59 -04:00
parent 5f57c9eae2
commit 16424bfac1
2 changed files with 7 additions and 17 deletions

View File

@ -677,24 +677,11 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
}
let mem_props = phd.memory_properties();
if !desc.shader_validation {
log::warn!("Shader validation is disabled");
}
let private_features = PrivateFeatures {
shader_validation: match std::env::var("WGPU_SHADER_VALIDATION") {
Ok(var) => match var.as_str() {
"0" => {
log::info!("Shader validation is disabled");
false
}
"1" => {
log::info!("Shader validation is enabled");
true
}
_ => {
log::warn!("Unknown shader validation setting: {:?}", var);
true
}
},
_ => true,
},
shader_validation: desc.shader_validation,
texture_d24_s8: phd
.format_properties(Some(hal::format::Format::D24UnormS8Uint))
.optimal_tiling

View File

@ -189,6 +189,9 @@ impl Default for Limits {
pub struct DeviceDescriptor {
pub extensions: Extensions,
pub limits: Limits,
/// Switch shader validation on/off. This is a temporary field
/// that will be removed once our validation logic is complete.
pub shader_validation: bool,
}
// TODO: This is copy/pasted from gfx-hal, so we need to find a new place to put