From 27d5a683447fd4097f956599b71d16d91fa8e009 Mon Sep 17 00:00:00 2001 From: gents83 Date: Sun, 27 Aug 2023 11:45:02 +0200 Subject: [PATCH] Fix wasm compilation --- wgpu-core/src/instance.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index f2ffa74a75..91c85727bc 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -1009,19 +1009,20 @@ impl Global { let fid = A::hub(self).adapters.prepare(input); - let (id, _) = match A::VARIANT { - #[cfg(all(feature = "vulkan", not(target_arch = "wasm32")))] - Backend::Vulkan => fid.assign(Adapter::new(hal_adapter)), - #[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))] - Backend::Metal => fid.assign(Adapter::new(hal_adapter)), - #[cfg(all(feature = "dx12", windows))] - Backend::Dx12 => fid.assign(Adapter::new(hal_adapter)), - #[cfg(all(feature = "dx11", windows))] - Backend::Dx11 => fid.assign(Adapter::new(hal_adapter)), - #[cfg(feature = "gles")] - Backend::Gl => fid.assign(Adapter::new(hal_adapter)), - _ => unreachable!(), - }; + let (id, _adapter): (crate::id::Id>, Arc>) = + match A::VARIANT { + #[cfg(all(feature = "vulkan", not(target_arch = "wasm32")))] + Backend::Vulkan => fid.assign(Adapter::new(hal_adapter)), + #[cfg(all(feature = "metal", any(target_os = "macos", target_os = "ios")))] + Backend::Metal => fid.assign(Adapter::new(hal_adapter)), + #[cfg(all(feature = "dx12", windows))] + Backend::Dx12 => fid.assign(Adapter::new(hal_adapter)), + #[cfg(all(feature = "dx11", windows))] + Backend::Dx11 => fid.assign(Adapter::new(hal_adapter)), + #[cfg(feature = "gles")] + Backend::Gl => fid.assign(Adapter::new(hal_adapter)), + _ => unreachable!(), + }; log::info!("Created Adapter {:?}", id); id }