505: Expose `Global::enumerate_adapters`. r=kvark a=daxpedda

Expose `enumerate_adapters` to use it in `wgpu-rs`.
Issue was that directly accessing `wgpu-core` wasn't possible because an instantiation of `Global` was needed.

Co-authored-by: daxpedda <daxpedda@gmail.com>
This commit is contained in:
bors[bot]
2020-02-26 22:34:40 +00:00
committed by GitHub

View File

@@ -143,6 +143,10 @@ pub extern "C" fn wgpu_create_surface_from_windows_hwnd(
))
}
pub fn wgpu_enumerate_adapters(mask: core::instance::BackendBit) -> Vec<id::AdapterId> {
GLOBAL.enumerate_adapters(core::instance::AdapterInputs::Mask(mask, || PhantomData))
}
/// # Safety
///
/// This function is unsafe as it calls an unsafe extern callback.