diff options
| author | 2023-04-08 04:47:05 +0200 | |
|---|---|---|
| committer | 2023-04-08 04:47:05 +0200 | |
| commit | c0431aedd3bbef4161456f2fa5f29866e8f17fc5 (patch) | |
| tree | 37f5af689b91818e04f3bc58e523aa24858f056a /wgpu/src/window | |
| parent | 6fae8bf6cbe7155bcee42eaeba68e31564df057c (diff) | |
| download | iced-c0431aedd3bbef4161456f2fa5f29866e8f17fc5.tar.gz iced-c0431aedd3bbef4161456f2fa5f29866e8f17fc5.tar.bz2 iced-c0431aedd3bbef4161456f2fa5f29866e8f17fc5.zip | |
Update `wgpu` and `cosmic-text`
Diffstat (limited to '')
| -rw-r--r-- | wgpu/src/window/compositor.rs | 13 | 
1 files changed, 9 insertions, 4 deletions
| diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index a67ac3c0..025cd43a 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -31,7 +31,10 @@ impl<Theme> Compositor<Theme> {          settings: Settings,          compatible_window: Option<&W>,      ) -> Option<Self> { -        let instance = wgpu::Instance::new(settings.internal_backend); +        let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { +            backends: settings.internal_backend, +            ..Default::default() +        });          log::info!("{:#?}", settings); @@ -46,7 +49,7 @@ impl<Theme> Compositor<Theme> {          #[allow(unsafe_code)]          let compatible_surface = compatible_window -            .map(|window| unsafe { instance.create_surface(window) }); +            .and_then(|window| unsafe { instance.create_surface(window).ok() });          let adapter = instance              .request_adapter(&wgpu::RequestAdapterOptions { @@ -63,7 +66,7 @@ impl<Theme> Compositor<Theme> {          log::info!("Selected: {:#?}", adapter.get_info());          let format = compatible_surface.as_ref().and_then(|surface| { -            surface.get_supported_formats(&adapter).first().copied() +            surface.get_capabilities(&adapter).formats.first().copied()          })?;          log::info!("Selected format: {:?}", format); @@ -207,7 +210,8 @@ impl<Theme> graphics::Compositor for Compositor<Theme> {          height: u32,      ) -> wgpu::Surface {          #[allow(unsafe_code)] -        let mut surface = unsafe { self.instance.create_surface(window) }; +        let mut surface = unsafe { self.instance.create_surface(window) } +            .expect("Create surface");          self.configure_surface(&mut surface, width, height); @@ -229,6 +233,7 @@ impl<Theme> graphics::Compositor for Compositor<Theme> {                  width,                  height,                  alpha_mode: wgpu::CompositeAlphaMode::Auto, +                view_formats: vec![],              },          );      } | 
