From fce8fc3bfdaa5e4104a7de67433d3368353d0c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 11 Feb 2022 22:12:56 +0100 Subject: [PATCH] package/ci: give up and don't run GLES3 tests on Android. GOOGLE!!! You owe me a WEEK of my time. A WEEK WASTED! --- package/ci/android-x86-gles.sh | 35 +++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/package/ci/android-x86-gles.sh b/package/ci/android-x86-gles.sh index 8ddd4939a..2c4a73a75 100755 --- a/package/ci/android-x86-gles.sh +++ b/package/ci/android-x86-gles.sh @@ -80,7 +80,40 @@ ninja $NINJA_JOBS # Wait for emulator to start (done in parallel to build) and run tests circle-android wait-for-boot -CORRADE_TEST_COLOR=ON ctest -V +# SwiftShader on the Android 29 image advertises itself as 4.0.0.1, however +# who the fuck knows, actually. The repository has no tags, so the only way +# to know the version is to check for changes to src/Common/Version.h (and +# then there's a SEPARATE Version.hpp for Vulkan!), and then use a crystal ball +# to figure out if the binary that reports such version is built from the +# commit that changed the version number or from the 100 commits after until +# the version got changed again. +# +# So there's the commit https://github.com/google/swiftshader/commit/c8fcfd82093bb2286e576ec76ef29c5480d35381, +# where it's APPARENT that GLES3 contexts were supported already in 3.3. Yet +# the cursed Android binary just doesn't allow those created, and any attempts +# to use EGL_CONFIG_CAVEAT lead to nothing. The fucked eglChooseConfig() just +# returns EGL_FALSE (and EGL_SUCCESS) always, which isn't even possible to +# happen from looking at the code. +# +# Then, Android has its own repository (fork? some stupid other something?) at +# https://android.googlesource.com/platform/external/swiftshader/ and it's full +# of tags and branches that even gitk blew up trying to visualize the damn +# thing. I tried looking at what version is used in platform-tools-29 or +# Android 10, it said 4.1 both times, which is totally fucked as it reports +# 4.0.0.1 to me in the Android 29 image!!! +# +# As a last resort, because the damn thing advertises itself as OpenGL ES 3.0 +# in the version string, I tried to just create a GLES2 context and used it as +# version 3 instead. The result wasn't great, it was beyond awful, like if the +# driver was just random bits and crashes lumped together. Ugh. And of course, +# none of this reproducible with a local non-Android build. And then, THEN, the +# same Android image has a *perfectly fine* Vulkan SwiftShader binary that +# reports 1.1 and has just one, ONE bug, compared to what I use natively. I +# can't even. +if [[ "$TARGET_GLES2" == "OFF" ]]; then + EXCLUDE_GL_TESTS="-E (GLTest|GLBenchmark)" +fi +CORRADE_TEST_COLOR=ON ctest -V $EXCLUDE_GL_TESTS # Test install, after running the tests as for them it shouldn't be needed ninja install