From 0a12590b6f500394194ccd7588af8c6729426d71 Mon Sep 17 00:00:00 2001 From: Wyatt Herkamp Date: Fri, 7 Oct 2022 09:03:41 -0400 Subject: Update `wgpu` to `0.14` and `wgpu_glyph` to `0.18` --- examples/integration_wgpu/src/main.rs | 3 +++ graphics/Cargo.toml | 2 +- graphics/src/window/compositor.rs | 6 +++--- wgpu/Cargo.toml | 6 +++--- wgpu/src/window/compositor.rs | 10 ++++++---- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index 69d46c3e..ed03f77a 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -16,6 +16,7 @@ use winit::{ event_loop::{ControlFlow, EventLoop}, }; +use crate::wgpu::CompositeAlphaMode; #[cfg(target_arch = "wasm32")] use wasm_bindgen::JsCast; #[cfg(target_arch = "wasm32")] @@ -119,6 +120,7 @@ pub fn main() { width: physical_size.width, height: physical_size.height, present_mode: wgpu::PresentMode::AutoVsync, + alpha_mode: CompositeAlphaMode::Auto, }, ); @@ -213,6 +215,7 @@ pub fn main() { width: size.width, height: size.height, present_mode: wgpu::PresentMode::AutoVsync, + alpha_mode: CompositeAlphaMode::Auto }, ); diff --git a/graphics/Cargo.toml b/graphics/Cargo.toml index 49d4d9c6..18fef54f 100644 --- a/graphics/Cargo.toml +++ b/graphics/Cargo.toml @@ -20,7 +20,7 @@ opengl = [] [dependencies] glam = "0.10" -raw-window-handle = "0.4" +raw-window-handle = "0.5" thiserror = "1.0" [dependencies.bytemuck] diff --git a/graphics/src/window/compositor.rs b/graphics/src/window/compositor.rs index 0c4cadcd..52255666 100644 --- a/graphics/src/window/compositor.rs +++ b/graphics/src/window/compositor.rs @@ -2,7 +2,7 @@ //! surfaces. use crate::{Color, Error, Viewport}; -use raw_window_handle::HasRawWindowHandle; +use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; use thiserror::Error; /// A graphics compositor that can draw to windows. @@ -17,7 +17,7 @@ pub trait Compositor: Sized { type Surface; /// Creates a new [`Compositor`]. - fn new( + fn new( settings: Self::Settings, compatible_window: Option<&W>, ) -> Result<(Self, Self::Renderer), Error>; @@ -25,7 +25,7 @@ pub trait Compositor: Sized { /// Crates a new [`Surface`] for the given window. /// /// [`Surface`]: Self::Surface - fn create_surface( + fn create_surface( &mut self, window: &W, ) -> Self::Surface; diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 586f97d3..92ebdcd0 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -28,10 +28,10 @@ spirv = ["wgpu/spirv"] webgl = ["wgpu/webgl"] [dependencies] -wgpu = "0.13" -wgpu_glyph = "0.17" +wgpu = "0.14" +wgpu_glyph = "0.18" glyph_brush = "0.7" -raw-window-handle = "0.4" +raw-window-handle = "0.5.0" log = "0.4" guillotiere = "0.6" futures = "0.3" diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index a36d2a87..c34fa735 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -4,9 +4,10 @@ use futures::stream::{self, StreamExt}; use iced_graphics::compositor; use iced_native::futures; -use raw_window_handle::HasRawWindowHandle; +use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; use std::marker::PhantomData; +use wgpu::CompositeAlphaMode; /// A window graphics backend for iced powered by `wgpu`. #[allow(missing_debug_implementations)] @@ -27,7 +28,7 @@ impl Compositor { /// Requests a new [`Compositor`] with the given [`Settings`]. /// /// Returns `None` if no compatible graphics adapter could be found. - pub async fn request( + pub async fn request( settings: Settings, compatible_window: Option<&W>, ) -> Option { @@ -123,7 +124,7 @@ impl iced_graphics::window::Compositor for Compositor { type Renderer = Renderer; type Surface = wgpu::Surface; - fn new( + fn new( settings: Self::Settings, compatible_window: Option<&W>, ) -> Result<(Self, Self::Renderer), Error> { @@ -138,7 +139,7 @@ impl iced_graphics::window::Compositor for Compositor { Ok((compositor, Renderer::new(backend))) } - fn create_surface( + fn create_surface( &mut self, window: &W, ) -> wgpu::Surface { @@ -162,6 +163,7 @@ impl iced_graphics::window::Compositor for Compositor { present_mode: self.settings.present_mode, width, height, + alpha_mode: CompositeAlphaMode::Auto, }, ); } -- cgit From bea5882c58edac0bd5300d53b31ee4ac295bda25 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 1 Nov 2022 19:17:08 +0100 Subject: Remove inconsistent `wgpu` imports --- examples/integration_wgpu/src/main.rs | 5 ++--- wgpu/src/window/compositor.rs | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs index ed03f77a..70f9a48b 100644 --- a/examples/integration_wgpu/src/main.rs +++ b/examples/integration_wgpu/src/main.rs @@ -16,7 +16,6 @@ use winit::{ event_loop::{ControlFlow, EventLoop}, }; -use crate::wgpu::CompositeAlphaMode; #[cfg(target_arch = "wasm32")] use wasm_bindgen::JsCast; #[cfg(target_arch = "wasm32")] @@ -120,7 +119,7 @@ pub fn main() { width: physical_size.width, height: physical_size.height, present_mode: wgpu::PresentMode::AutoVsync, - alpha_mode: CompositeAlphaMode::Auto, + alpha_mode: wgpu::CompositeAlphaMode::Auto, }, ); @@ -215,7 +214,7 @@ pub fn main() { width: size.width, height: size.height, present_mode: wgpu::PresentMode::AutoVsync, - alpha_mode: CompositeAlphaMode::Auto + alpha_mode: wgpu::CompositeAlphaMode::Auto }, ); diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs index c34fa735..6d0c36f6 100644 --- a/wgpu/src/window/compositor.rs +++ b/wgpu/src/window/compositor.rs @@ -7,7 +7,6 @@ use iced_native::futures; use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; use std::marker::PhantomData; -use wgpu::CompositeAlphaMode; /// A window graphics backend for iced powered by `wgpu`. #[allow(missing_debug_implementations)] @@ -163,7 +162,7 @@ impl iced_graphics::window::Compositor for Compositor { present_mode: self.settings.present_mode, width, height, - alpha_mode: CompositeAlphaMode::Auto, + alpha_mode: wgpu::CompositeAlphaMode::Auto, }, ); } -- cgit From 8f6af6bbfc7a14e9dc71b20ccb9045597bbccbad Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 1 Nov 2022 19:18:47 +0100 Subject: Fix inconsistent version format for `raw-window-handle` dependency --- wgpu/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgpu/Cargo.toml b/wgpu/Cargo.toml index 92ebdcd0..55eec73f 100644 --- a/wgpu/Cargo.toml +++ b/wgpu/Cargo.toml @@ -31,7 +31,7 @@ webgl = ["wgpu/webgl"] wgpu = "0.14" wgpu_glyph = "0.18" glyph_brush = "0.7" -raw-window-handle = "0.5.0" +raw-window-handle = "0.5" log = "0.4" guillotiere = "0.6" futures = "0.3" -- cgit