From a9c7a0f5ef4a0afe04a824d47ecefcff3b71bdc4 Mon Sep 17 00:00:00 2001 From: daxpedda Date: Wed, 26 Feb 2020 16:35:31 +0100 Subject: [PATCH 1/2] Expose `enumerate_adapters`. --- src/lib.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 6852e0094d..a2ef9e5ba2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -522,6 +522,14 @@ impl Surface { } impl Adapter { + /// Retrieves all available [`Adapter`]s that match the given backends. + pub fn enumerate(backends: BackendBit) -> Vec { + wgn::wgpu_enumerate_adapters(backends) + .into_iter() + .map(|id| Adapter { id }) + .collect() + } + /// Retrieves an [`Adapter`] which matches the given options. /// /// Some options are "soft", so treated as non-mandatory. Others are "hard". From a1e429eabebbe35cc4aa1a40b555ebf874b29cdd Mon Sep 17 00:00:00 2001 From: daxpedda Date: Thu, 27 Feb 2020 00:45:02 +0100 Subject: [PATCH 2/2] Update `wgpu` dependency. --- Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0b0ee2163a..5a527604fe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,14 +27,14 @@ vulkan = ["wgn/vulkan-portability"] package = "wgpu-native" version = "0.4" git = "https://github.com/gfx-rs/wgpu" -rev = "f2323f2b23b7dbe060d324266cf6c1c864152e91" +rev = "429ca1d4460becd20d771f67024878948b60454b" #path = "../wgpu/wgpu-native" [dependencies.wgc] package = "wgpu-core" version = "0.1" git = "https://github.com/gfx-rs/wgpu" -rev = "f2323f2b23b7dbe060d324266cf6c1c864152e91" +rev = "429ca1d4460becd20d771f67024878948b60454b" #path = "../wgpu/wgpu-core" [dependencies]