From 59ce1f52d1249548040d9afb48e91e883c2da2d0 Mon Sep 17 00:00:00 2001 From: Charlton Rodda Date: Tue, 12 Dec 2023 17:03:41 +0000 Subject: [PATCH] Default to dxc compiler because fxc is too slow This does require dxil.dll and dxcompiler.dll to be available, falling back to fxc if these cannot be found. Can be overridden by setting the WGPU_DX12_COMPILER environment variable to "fxc". --- src/graphics/d3d12.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/graphics/d3d12.rs b/src/graphics/d3d12.rs index 8970e40..af7643e 100644 --- a/src/graphics/d3d12.rs +++ b/src/graphics/d3d12.rs @@ -112,7 +112,12 @@ pub fn initialize_xr_instance( let instance_descriptor = &wgpu_hal::InstanceDescriptor { name: &app_info.name, - dx12_shader_compiler: wgpu::util::dx12_shader_compiler_from_env().unwrap_or_default(), + dx12_shader_compiler: wgpu::util::dx12_shader_compiler_from_env().unwrap_or( + wgpu::Dx12Compiler::Dxc { + dxil_path: None, + dxc_path: None, + }, + ), flags: wgpu::InstanceFlags::from_build_config().with_env(), gles_minor_version: Default::default(), };