Expose enumerate_adapters.

This commit is contained in:
daxpedda
2020-02-26 16:35:31 +01:00
parent fabb0fd794
commit a9c7a0f5ef

View File

@@ -522,6 +522,14 @@ impl Surface {
}
impl Adapter {
/// Retrieves all available [`Adapter`]s that match the given backends.
pub fn enumerate(backends: BackendBit) -> Vec<Self> {
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".