From 685c87696355c79d19d22a12378662bdf71dd8f9 Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Fri, 8 Oct 2021 02:23:07 -0400 Subject: [PATCH] Support wgpu 0.11 --- CHANGELOG.md | 3 +++ Cargo.toml | 2 +- examples/hello-world.rs | 5 ++++- simple-api/Cargo.toml | 2 +- simple-api/src/lib.rs | 5 +++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4482046..19a5412 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,9 @@ Per Keep a Changelog there are 6 main categories of changes: ## Unreleased +#### Updated +- updated wgpu dependency to `>=0.10,<0.12` + ## v0.17.1 Released 2021-09-22 diff --git a/Cargo.toml b/Cargo.toml index 3dfcd96..dd363ee 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -51,7 +51,7 @@ bytemuck = "1" imgui = ">=0.1, <0.9" log = "0.4" smallvec = "1" -wgpu = "0.10" +wgpu = ">=0.10, <0.12" [dev-dependencies] bytemuck = { version = "1.4", features = ["derive"] } diff --git a/examples/hello-world.rs b/examples/hello-world.rs index fe21094..72cc881 100644 --- a/examples/hello-world.rs +++ b/examples/hello-world.rs @@ -41,6 +41,7 @@ fn main() { let adapter = block_on(instance.request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::HighPerformance, compatible_surface: Some(&surface), + force_fallback_adapter: false, })) .unwrap(); @@ -152,7 +153,7 @@ fn main() { imgui.io_mut().update_delta_time(now - last_frame); last_frame = now; - let frame = match surface.get_current_frame() { + let frame = match surface.get_current_texture() { Ok(frame) => frame, Err(e) => { eprintln!("dropped frame: {:?}", e); @@ -222,6 +223,8 @@ fn main() { drop(rpass); queue.submit(Some(encoder.finish())); + + frame.submit(); } _ => (), } diff --git a/simple-api/Cargo.toml b/simple-api/Cargo.toml index 10754e1..3b0bdb7 100644 --- a/simple-api/Cargo.toml +++ b/simple-api/Cargo.toml @@ -21,5 +21,5 @@ imgui-wgpu = { path = ".." } imgui-winit-support = "0.8" pollster = "0.2" # for block_on executor winit = "0.25" -wgpu = "0.10" +wgpu = "0.11" diff --git a/simple-api/src/lib.rs b/simple-api/src/lib.rs index a9d9d65..72fc09b 100644 --- a/simple-api/src/lib.rs +++ b/simple-api/src/lib.rs @@ -103,6 +103,7 @@ pub fn run frame, Err(e) => { eprintln!("dropped frame: {:?}", e); @@ -228,7 +229,6 @@ pub fn run { (config.on_event)(event, &mut state);