Skip to content

Commit

Permalink
Default to dxc compiler because fxc is too slow
Browse files Browse the repository at this point in the history
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".
  • Loading branch information
SafariMonkey committed Feb 23, 2024
1 parent 45f6baa commit 396560e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/graphics/d3d12.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
};
Expand Down

0 comments on commit 396560e

Please sign in to comment.