Skip to content

Fallback to OpenGL if Vulkan not available #972

@enfipy

Description

@enfipy

Description
Currently, it's not possible to run examples of WGPU on an Android emulator (tested on official android emulators on windows 10/mac 10.15) due to lack of Vulkan support. But it works well on real Android smartphones (currently, tested on Mi only).

The error may differ but here is one from my Mac Android emulator:

10-12 11:14:42.902  5395  5420 D vulkan  : searching for layers in '/data/app/~~FEEqvpvQbJT0JSo8apm6hg==/rust.app-8dgkmZZJTxv2FVxgPqeUyw==/lib/x86'
10-12 11:14:42.902  5395  5420 D vulkan  : searching for layers in '/data/app/~~FEEqvpvQbJT0JSo8apm6hg==/rust.app-8dgkmZZJTxv2FVxgPqeUyw==/base.apk!/lib/x86'
10-12 11:14:42.903  5395  5420 I gfx_backend_vulkan: Unable to find extension: VK_EXT_debug_utils
10-12 11:14:42.903  5395  5420 I gfx_backend_vulkan: Unable to find extension: VK_KHR_get_physical_device_properties2
10-12 11:14:42.903  5395  5420 W gfx_backend_vulkan: Unable to find layer: VK_LAYER_KHRONOS_validation

Is it possible to fall back to OpenGL ES when Vulkan failed to load? Some researches shows that currently there's more than 50% of smartphones don't support Vulkan. What current blockers to support fallback?

Repro steps
All I did is created an empty cargo project and recreated WGPU hello-triangle example, then run on Android with emulator -avd Pixel_XL_API_30.

Expected vs observed behavior
Got errors while waited to see the example result as on my real smartphone.

Platform
Crates:

wgpu = { version = "0.6.0" }
ndk-glue = { version = "0.2" }

Platform:
MacOS Catalina Version 10.15.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    external: upstreamIssues happening in lower level APIs or platformstype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions