mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-14 19:26:56 -04:00
#1194: Direct3D 12 shaders compile with FXC
wgpu's default DX12 shader compiler loads whichever dxcompiler.dll the DLL search path finds first; VectorCraft ships none, so it was another program's, and one without its dxil.dll warns that the DXIL is unsigned. wgpu takes the warning for a compile error, the device is lost before the first frame, and the app falls back to OpenGL. FXC (d3dcompiler_47, part of Windows) compiles everything the window needs, as LightCraft does since its #484; WGPU_DX12_COMPILER still picks another.
This commit is contained in:
1 parent
9e3aa73819
commit
21459f4df4
2 files changed
+6
-1
No files matched your search
@@ -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
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user