Skip to content

Commit

Permalink
Fix wasm compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
gents83 committed Aug 27, 2023
1 parent 969e411 commit 27d5a68
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,19 +1009,20 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {

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<Adapter<hal::empty::Api>>, Arc<Adapter<A>>) =
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
}
Expand Down

0 comments on commit 27d5a68

Please sign in to comment.