Enable building GLES backend on Android
Doing so takes a dependency on dawn_use_angle because
native GLES android drivers are buggy. dawn_use_angle
itself akes a dependency on either not being Android,
or being a component build. For testing, this is fine
for now because tests run in component builds.
Official builds are static which will disable ANGLE on
Android which will also disable the GLES backend.
Bug: 1453445
Change-Id: I169fdd1b66e25708e349fcc000e6adbf7cb6dbff
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/149222
Reviewed-by: Gregg Tavares <gman@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Auto-Submit: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
diff --git a/scripts/dawn_features.gni b/scripts/dawn_features.gni
index 6736f88..781fa43 100644
--- a/scripts/dawn_features.gni
+++ b/scripts/dawn_features.gni
@@ -39,7 +39,9 @@
# libGLESv2.so, apparently without regard for the use_static_angle=true
# GN variable. Chromium's linker on Android disallows production of more
# than one shared object per target (?).
- dawn_use_angle = !is_android
+ # For now, ANGLE and thus the GLES backend are only enabled for component
+ # builds on Android.
+ dawn_use_angle = !is_android || is_component_build
# Enables SwiftShader as the fallback adapter. Requires dawn_swiftshader_dir
# to be set to take effect.
@@ -83,8 +85,11 @@
# Enables the compilation of Dawn's OpenGLES backend
# (WebGPU/Compat subset)
# Disables OpenGLES when compiling for UWP, since UWP only supports d3d
+ # Disables OpenGLES when not using ANGLE on Android. Native GLES drivers
+ # are buggy and require ANGLE's workarounds.
dawn_enable_opengles =
- (is_linux && !is_chromeos) || (is_win && !dawn_is_winuwp)
+ (is_linux && !is_chromeos) || (is_win && !dawn_is_winuwp) ||
+ (is_android && dawn_use_angle)
# Enables the compilation of Dawn's Vulkan backend
# Disables vulkan when compiling for UWP, since UWP only supports d3d