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".
This commit is contained in:
Charlton Rodda
2023-12-12 17:03:41 +00:00
parent 91a4f2a544
commit 59ce1f52d1

View File

@@ -112,7 +112,12 @@ pub fn initialize_xr_instance(
let instance_descriptor = &wgpu_hal::InstanceDescriptor { let instance_descriptor = &wgpu_hal::InstanceDescriptor {
name: &app_info.name, 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(), flags: wgpu::InstanceFlags::from_build_config().with_env(),
gles_minor_version: Default::default(), gles_minor_version: Default::default(),
}; };