From 98d108d2b73b994a63140361110dec6401a80ae4 Mon Sep 17 00:00:00 2001 From: Poly Date: Wed, 3 Feb 2021 19:32:30 +0100 Subject: [PATCH] [wgpu 0.7] Update window/compositor.rs Notes: - wgpu::PowerPreference::Default no longer exists, maybe there is another way to replicate its behavior. --- wgpu/src/window/compositor.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index 492efb42..492cb955 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -27,7 +27,7 @@ impl Compositor { let adapter = instance .request_adapter(&wgpu::RequestAdapterOptions { power_preference: if settings.antialiasing.is_none() { - wgpu::PowerPreference::Default + wgpu::PowerPreference::default() } else { wgpu::PowerPreference::HighPerformance }, @@ -38,12 +38,14 @@ impl Compositor { let (device, queue) = adapter .request_device( &wgpu::DeviceDescriptor { + label: Some( + "iced_wgpu::window::Compositor Device Descriptor", + ), features: wgpu::Features::empty(), limits: wgpu::Limits { max_bind_groups: 2, ..wgpu::Limits::default() }, - shader_validation: false, }, None, ) @@ -103,7 +105,7 @@ impl iced_graphics::window::Compositor for Compositor { self.device.create_swap_chain( surface, &wgpu::SwapChainDescriptor { - usage: wgpu::TextureUsage::OUTPUT_ATTACHMENT, + usage: wgpu::TextureUsage::RENDER_ATTACHMENT, format: self.settings.format, present_mode: self.settings.present_mode, width, @@ -130,6 +132,7 @@ impl iced_graphics::window::Compositor for Compositor { ); let _ = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + label: Some("iced_wgpu::window::Compositor Render Pass"), color_attachments: &[wgpu::RenderPassColorAttachmentDescriptor { attachment: &frame.output.view, resolve_target: None,