mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-05 13:33:00 -05:00
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 <[email protected]>
This commit is contained in:
1 parent
89b477ae67
commit
54e4e522d4
1 file changed
+4
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user