mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 14:55:05 +00:00
Add shader validation bool to DeviceDescriptor
This commit is contained in:
parent
5f57c9eae2
commit
16424bfac1
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user