From 019b799d442904de73b2cdd27f8d115549ecd30d Mon Sep 17 00:00:00 2001 From: kelpsyberry <138107494+kelpsyberry@users.noreply.github.com> Date: Sat, 20 Jan 2024 02:01:29 +0100 Subject: [PATCH] Update to latest wgpu revision --- .../build-release-macos-app-bundles.yml | 2 +- frontend/desktop/src/ui/window.rs | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-release-macos-app-bundles.yml b/.github/workflows/build-release-macos-app-bundles.yml index 190ac87..bdf7e69 100644 --- a/.github/workflows/build-release-macos-app-bundles.yml +++ b/.github/workflows/build-release-macos-app-bundles.yml @@ -15,7 +15,7 @@ env: jobs: build: - name: Build release macOS app bundles + name: Build runs-on: macos-latest steps: diff --git a/frontend/desktop/src/ui/window.rs b/frontend/desktop/src/ui/window.rs index 3fcb1d8..6e4a402 100644 --- a/frontend/desktop/src/ui/window.rs +++ b/frontend/desktop/src/ui/window.rs @@ -49,8 +49,13 @@ impl GfxState { backends: wgpu::Backends::all(), ..Default::default() }); - let surface = - unsafe { instance.create_surface_from_raw(window) }.expect("Couldn't create surface"); + let surface = unsafe { + instance.create_surface_unsafe( + wgpu::SurfaceTargetUnsafe::from_window(window) + .expect("Couldn't get surface target from window"), + ) + } + .expect("Couldn't create surface"); let adapter = match adapter { AdapterSelection::Auto(power_preference) => { @@ -62,9 +67,10 @@ impl GfxState { }) .await } - AdapterSelection::Manual(backends, suitable) => { - instance.enumerate_adapters(backends).find(suitable) - } + AdapterSelection::Manual(backends, suitable) => instance + .enumerate_adapters(backends) + .into_iter() + .find(suitable), } .expect("Couldn't create graphics adapter"); @@ -103,6 +109,7 @@ impl GfxState { present_mode: wgpu::PresentMode::AutoVsync, alpha_mode: wgpu::CompositeAlphaMode::Auto, view_formats: Vec::new(), + desired_maximum_frame_latency: 2, }; surface.configure(&device, &surf_config);