From ac8b840ade9a0f0e845804427955564b55d01a02 Mon Sep 17 00:00:00 2001 From: Paris DOUADY Date: Thu, 11 Jul 2024 10:48:53 +0200 Subject: [PATCH] disable validation on linux (broken on wgpu 0.20 for now) --- engine/src/gfx.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/engine/src/gfx.rs b/engine/src/gfx.rs index e2c31a02..2fa11435 100644 --- a/engine/src/gfx.rs +++ b/engine/src/gfx.rs @@ -263,10 +263,21 @@ impl GfxContext { backends = Backends::VULKAN; } + let mut flags = if cfg!(debug_assertions) { + // TODO: re enable validation when https://github.com/gfx-rs/wgpu/issues/5231 is fixed + wgpu::InstanceFlags::DEBUG + } else { + wgpu::InstanceFlags::empty() + }; + + if cfg!(target_os = "windows") { + flags = flags | wgpu::InstanceFlags::VALIDATION + } + let instance = wgpu::Instance::new(InstanceDescriptor { backends, dx12_shader_compiler: Default::default(), - flags: wgpu::InstanceFlags::default() | wgpu::InstanceFlags::DEBUG, + flags, gles_minor_version: wgpu::Gles3MinorVersion::Automatic, });