no wgpu validation layer when not(test)

This commit is contained in:
nathaniel 2024-05-08 17:03:45 -04:00
parent 5bbc5ea944
commit 6f6b3bcc01
1 changed files with 10 additions and 2 deletions

View File

@ -182,9 +182,17 @@ async fn select_adapter<G: GraphicsApi>(_device: &WgpuDevice) -> wgpu::Adapter {
#[cfg(not(target_family = "wasm"))]
fn select_adapter<G: GraphicsApi>(device: &WgpuDevice) -> wgpu::Adapter {
use wgpu::DeviceType;
use wgpu::{DeviceType, InstanceFlags};
let instance = wgpu::Instance::default();
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
backends: G::backend().into(),
#[cfg(test)]
flags: InstanceFlags::debugging(),
#[cfg(not(test))]
flags: InstanceFlags::empty(),
dx12_shader_compiler: wgpu::Dx12Compiler::default(),
gles_minor_version: wgpu::Gles3MinorVersion::default(),
});
let mut adapters_other = Vec::new();
let mut adapters = Vec::new();