From 54e4e522d485ea2d0722c6cc1cc4c397ae252235 Mon Sep 17 00:00:00 2001 From: austin62jake <340374338+austin62jake@users.noreply.github.com> Date: Sat, 31 Oct 2026 14:12:18 -0500 Subject: [PATCH] M3: the adapter selector runs on Windows even when no display names its GPU (#4134) The selector, which now declines wgpu's OpenGL backend, was only installed when a display's GPU was found by its PCI ids. A display that has none, such as Remote Desktop's, left wgpu's own choice in charge, and that could still pick an OpenGL-only GPU. It now runs on Windows always; with no display known, pick_adapter ranks adapters by kind, most frugal first, as wgpu's low-power choice does. Co-Authored-By: Claude Opus 5.5 --- apps/pdfcraft/src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/pdfcraft/src/main.rs b/apps/pdfcraft/src/main.rs index 6d422a47fe..062f9f1751 100644 --- a/apps/pdfcraft/src/main.rs +++ b/apps/pdfcraft/src/main.rs @@ -782,7 +782,10 @@ fn configure_gpu(native: &mut eframe::NativeOptions) { setup.power_preference = eframe::wgpu::PowerPreference::LowPower; let displays = display_gpus(); let compositor = compositor_gpu::compositor_gpu(); - if !displays.is_empty() || compositor.is_some() { + // Always on Windows, so that an OpenGL-only GPU is declined (`wgpu_draws_with`) even when + // no display names its GPU, as over Remote Desktop; `pick_adapter` then ranks by kind, + // most frugal first, as wgpu's own low-power choice does. + if !displays.is_empty() || compositor.is_some() || cfg!(target_os = "windows") { setup.native_adapter_selector = Some(std::sync::Arc::new(move |adapters, surface| { let usable: Vec<&eframe::wgpu::Adapter> = adapters.iter().filter(|a| surface.is_none_or(|s| a.is_surface_supported(s))).collect(); let infos: Vec<(u32, u32, eframe::wgpu::DeviceType)> = usable