Merge pull request #1215 from storytold/fix/1194-dx12-fxc

#1194: Direct3D 12 shaders compile with FXC
This commit is contained in:
BFlat 2026-10-11 22:03:50 +07:00 committed by GitHub
commit 8fbb09bf4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -717,6 +717,11 @@ fn main() -> std::process::ExitCode {
create.instance_descriptor.flags =
(eframe::wgpu::InstanceFlags::from_build_config() - eframe::wgpu::InstanceFlags::VALIDATION_INDIRECT_CALL).with_env();
create.instance_descriptor.backends = gpu::backends(create.instance_descriptor.backends, std::env::var_os("WGPU_BACKEND").is_some());
// DX12 shaders compile with FXC, part of Windows: wgpu's default loads whichever
// dxcompiler.dll the search path finds, and one without its dxil.dll fails every shader,
// losing the device before the first frame (#1194). `WGPU_DX12_COMPILER` picks another.
create.instance_descriptor.backend_options.dx12.shader_compiler =
eframe::wgpu::Dx12Compiler::from_env().unwrap_or(eframe::wgpu::Dx12Compiler::Fxc);
}
options
};