Fix adapter selection loop in iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2023-09-03 01:14:22 +02:00
parent 0b28080d3e
commit 9b9b37e6f8
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -98,8 +98,9 @@ impl<Theme> Compositor<Theme> {
..limits ..limits
}); });
let (device, queue) = loop { let (device, queue) =
if let Some(limits) = limits.next() { loop {
let limits = limits.next()?;
let device = adapter.request_device( let device = adapter.request_device(
&wgpu::DeviceDescriptor { &wgpu::DeviceDescriptor {
label: Some( label: Some(
@ -114,10 +115,7 @@ impl<Theme> Compositor<Theme> {
if let Some(device) = device { if let Some(device) = device {
break Some(device); break Some(device);
} }
} }?;
break None;
}?;
Some(Compositor { Some(Compositor {
instance, instance,