From 7f8ef62edd126953d495a71379f92d8e6976b714 Mon Sep 17 00:00:00 2001 From: nanoqsh Date: Thu, 2 May 2024 20:49:16 +0500 Subject: [PATCH] Bump winit & wgpu --- dunge/Cargo.toml | 10 +++++----- dunge/src/el.rs | 12 +++--------- dunge/src/layer.rs | 2 ++ dunge/src/window.rs | 10 +++++----- dunge_shader/Cargo.toml | 2 +- 5 files changed, 16 insertions(+), 20 deletions(-) diff --git a/dunge/Cargo.toml b/dunge/Cargo.toml index fa22f07..a9a03ae 100644 --- a/dunge/Cargo.toml +++ b/dunge/Cargo.toml @@ -18,21 +18,21 @@ bytemuck.workspace = true glam.workspace = true instant = { version = "0.1", optional = true } log.workspace = true -wgpu = { version = "0.19", default-features = false, features = ["naga-ir"] } +wgpu = { version = "0.20", default-features = false, features = ["naga-ir"] } [dependencies.winit] -version = "0.29" +version = "0.30" default-features = false features = ["rwh_06", "x11"] optional = true [target.'cfg(target_arch = "wasm32")'.dependencies] instant = { version = "0.1", features = ["wasm-bindgen"], optional = true } -wgpu = { version = "0.19", default-features = false, features = ["webgpu"] } -web-sys = { version = "<0.3.68", features = ["Document", "Window", "Element"] } +wgpu = { version = "0.20", default-features = false, features = ["webgpu"] } +web-sys = { version = "0.3", features = ["Document", "Window", "Element"] } [target.'cfg(target_os = "android")'.dependencies.winit] -version = "0.29" +version = "0.30" default-features = false features = ["android-native-activity"] optional = true diff --git a/dunge/src/el.rs b/dunge/src/el.rs index f6d9272..5d68aa9 100644 --- a/dunge/src/el.rs +++ b/dunge/src/el.rs @@ -31,9 +31,7 @@ where impl Loop { pub fn new() -> Result { - use winit::event_loop::EventLoopBuilder; - - let inner = EventLoopBuilder::with_user_event().build()?; + let inner = EventLoop::with_user_event().build()?; Ok(Self(inner)) } @@ -97,14 +95,10 @@ impl error::Error for LoopError { } type Event = event::Event; -type Target = event_loop::EventLoopWindowTarget; +type Target = event_loop::ActiveEventLoop; type Failure = Option>; -fn handle( - cx: Context, - view: View, - mut upd: U, -) -> impl FnMut(Event, &Target) -> Failure +fn handle(cx: Context, view: View, mut upd: U) -> impl FnMut(Event, &Target) -> Failure where U: Update, { diff --git a/dunge/src/layer.rs b/dunge/src/layer.rs index 7fe60b7..34e3b36 100644 --- a/dunge/src/layer.rs +++ b/dunge/src/layer.rs @@ -235,6 +235,7 @@ impl Layer { vertex: VertexState { module, entry_point: "vs", + compilation_options: PipelineCompilationOptions::default(), buffers: &buffers, }, primitive: PrimitiveState { @@ -254,6 +255,7 @@ impl Layer { fragment: Some(FragmentState { module, entry_point: "fs", + compilation_options: PipelineCompilationOptions::default(), targets: &targets, }), multiview: None, diff --git a/dunge/src/window.rs b/dunge/src/window.rs index d57e027..b4a062e 100644 --- a/dunge/src/window.rs +++ b/dunge/src/window.rs @@ -91,13 +91,13 @@ impl WindowBuilder { let lu = Loop::new()?; let inner = { let title = mem::take(&mut self.title); - let builder = window::WindowBuilder::new().with_title(title); - let builder = match self.size { - Some((width, height)) => builder.with_inner_size(PhysicalSize::new(width, height)), - None => builder.with_fullscreen(Some(Fullscreen::Borderless(None))), + let attrs = window::Window::default_attributes().with_title(title); + let attrs = match self.size { + Some((width, height)) => attrs.with_inner_size(PhysicalSize::new(width, height)), + None => attrs.with_fullscreen(Some(Fullscreen::Borderless(None))), }; - Arc::new(builder.build(lu.inner())?) + Arc::new(lu.inner().create_window(attrs)?) }; let view = { diff --git a/dunge_shader/Cargo.toml b/dunge_shader/Cargo.toml index 1f4f68b..1fd78b8 100644 --- a/dunge_shader/Cargo.toml +++ b/dunge_shader/Cargo.toml @@ -14,7 +14,7 @@ rust-version.workspace = true [dependencies] glam.workspace = true log.workspace = true -naga = "0.19" +naga = "0.20" [features] wgsl = ["naga/wgsl-out"]