Merge PR #16173: #15929: build the compositor pipelines with FXC once, not twice

This commit is contained in:
David Mann committed 2026-11-22 13:24:48 +01:00
commit 9889a02f2d
1 file changed
+10 -7
+10 -7
View File
@@ -32,21 +32,24 @@ fn every_compositor_pipeline_builds() {
// One instance per backend: `Backends::all()` only enables the others on one instance, and
// `request_adapter` then returns the single default adapter, so the other backends' own
// translation went untested. One adapter per backend keeps a second, unrelated adapter of the
// same backend (a dual-GPU laptop's integrated GPU) out of the run.
for (backends, compiler) in [(wgpu::Backends::DX12, wgpu::Dx12Compiler::Fxc), (wgpu::Backends::all(), wgpu::Dx12Compiler::Auto)] {
// same backend (a dual-GPU laptop's integrated GPU) out of the run. The second pass names DXC
// rather than `Auto`: without `dxcompiler.dll`, as on the Windows runners, `Auto` falls back to
// FXC and built every pipeline with FXC a second time (#15929), while a DXC that does not load
// leaves DX12 out of that pass.
for (backends, compiler) in [(wgpu::Backends::DX12, wgpu::Dx12Compiler::Fxc), (wgpu::Backends::all(), wgpu::Dx12Compiler::default_dynamic_dxc())] {
let required = cfg!(windows) && matches!(compiler, wgpu::Dx12Compiler::Fxc);
for backend in backends.iter() {
let instance = wgpu::Instance::new(describe(backend, compiler.clone()));
// The Windows runners always have a WARP adapter on DX12, so a missing one there means
// the check this test exists for silently did not run. Any other backend is a plain
// skip: `Backends::all()` also names backends this platform does not provide.
// skip: `Backends::all()` also names backends this platform does not provide, and
// DX12 through DXC needs a `dxcompiler.dll`.
let Ok(adapter) = pollster::block_on(instance.request_adapter(&wgpu::RequestAdapterOptions::default())) else {
#[cfg(windows)]
assert!(backend != wgpu::Backends::DX12, "no adapter on Windows: the DX12/FXC pipeline check did not run");
assert!(!required, "no adapter on Windows: the DX12/FXC pipeline check did not run");
continue;
};
let Ok((device, _queue)) = pollster::block_on(adapter.request_device(&wgpu::DeviceDescriptor::default())) else {
#[cfg(windows)]
assert!(backend != wgpu::Backends::DX12, "no device on Windows: the DX12/FXC pipeline check did not run");
assert!(!required, "no device on Windows: the DX12/FXC pipeline check did not run");
continue;
};
let info = adapter.get_info();