Skip to content

Commit

Permalink
fix not enabling any backend on android, fix related doc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Jan 31, 2024
1 parent b721346 commit 90c1096
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ default = ["wgsl", "dx12", "metal", "webgpu"]
#! ### Backends
# --------------------------------------------------------------------
#! ⚠️ WIP: Not all backends can be manually configured today.
#! On Windows & Linux the Vulkan & GLES backends are always enabled.
#! On Windows, Linux & Android the Vulkan & GLES backends are always enabled.
#! See [#3514](https://github.com/gfx-rs/wgpu/issues/3514) for more details.

## Enables the DX12 backend on Windows.
Expand Down
7 changes: 3 additions & 4 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1765,8 +1765,7 @@ impl Instance {
///
/// TODO: Right now it's otherwise not possible yet to opt-out of all features on some platforms.
/// See <https://github.com/gfx-rs/wgpu/issues/3514>
/// * Windows: always enables Vulkan and GLES with no way to opt out
/// * Linux: always enables Vulkan and GLES with no way to opt out
/// * Windows/Linux/Android: always enables Vulkan and GLES with no way to opt out
pub const fn enabled_backend_features() -> Backends {
let mut backends = Backends::empty();

Expand All @@ -1778,9 +1777,9 @@ impl Instance {
backends = backends.union(Backends::DX12);
}

// Windows & Linux currently always enable Vulkan and OpenGL.
// Windows, Android, Linux currently always enable Vulkan and OpenGL.
// See <https://github.com/gfx-rs/wgpu/issues/3514>
if cfg!(target_os = "windows") || cfg!(target_os = "linux") {
if cfg!(target_os = "windows") || cfg!(unix) {
backends = backends.union(Backends::VULKAN).union(Backends::GL);
}

Expand Down

0 comments on commit 90c1096

Please sign in to comment.