From cc566abe5c1c72bff5cc8f68272f9f1ddec57fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Capucho?= Date: Wed, 9 Jun 2021 21:14:53 +0100 Subject: [PATCH] Update wgpu and check for best swap chain format --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- voxygen/src/render/renderer.rs | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 145b1f4fee..28f9e22c5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6721,7 +6721,7 @@ dependencies = [ [[package]] name = "wgpu" version = "0.8.0" -source = "git+https://github.com/gfx-rs/wgpu-rs.git?rev=7486bdad64bb5d17b709ecccb41e063469efff88#7486bdad64bb5d17b709ecccb41e063469efff88" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549a8e2cb9dac781bafc5ed32828f3caf46" dependencies = [ "arrayvec", "js-sys", @@ -6741,7 +6741,7 @@ dependencies = [ [[package]] name = "wgpu-core" version = "0.8.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=53eab747a32414232be45d47cae8a43a369395d0#53eab747a32414232be45d47cae8a43a369395d0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549a8e2cb9dac781bafc5ed32828f3caf46" dependencies = [ "arrayvec", "bitflags", @@ -6781,7 +6781,7 @@ dependencies = [ [[package]] name = "wgpu-types" version = "0.8.0" -source = "git+https://github.com/gfx-rs/wgpu?rev=53eab747a32414232be45d47cae8a43a369395d0#53eab747a32414232be45d47cae8a43a369395d0" +source = "git+https://github.com/gfx-rs/wgpu.git?rev=a92b8549a8e2cb9dac781bafc5ed32828f3caf46#a92b8549a8e2cb9dac781bafc5ed32828f3caf46" dependencies = [ "bitflags", "serde", diff --git a/Cargo.toml b/Cargo.toml index 88c76c276e..76f9d2fc02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,7 +118,7 @@ nativeBuildInputs = ["cmake", "python3", "gnumake"] winit = { git = "https://gitlab.com/veloren/winit.git", branch = "macos-test-spiffed" } vek = { git = "https://gitlab.com/veloren/vek.git", branch = "fix_intrinsics2" } # patch wgpu so we can use wgpu-profiler crate -wgpu = { git = "https://github.com/gfx-rs/wgpu-rs.git", rev = "7486bdad64bb5d17b709ecccb41e063469efff88" } +wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "a92b8549a8e2cb9dac781bafc5ed32828f3caf46" } # # use the latest fixes in naga (remove when updates trickle down to wgpu-rs) # naga = { git = "https://github.com/gfx-rs/naga.git", rev = "3a0f0144112ff621dd7f731bf455adf6cab19164" } diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index 6870c32e42..d5e9f2157d 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -241,9 +241,13 @@ impl Renderer { "selected graphics device" ); + let format = adapter + .get_swap_chain_preferred_format(&surface) + .expect("No supported swap chain format found"); + let sc_desc = wgpu::SwapChainDescriptor { usage: wgpu::TextureUsage::RENDER_ATTACHMENT, - format: wgpu::TextureFormat::Bgra8UnormSrgb, + format, width: dims.width, height: dims.height, present_mode: mode.present_mode.into(),