The Android/Quest CMakeLists.txt patch previously reimplemented desktop
build / build (push) Successful in 1m8s
build / build (push) Successful in 1m8s
immediate-mode GL (glBegin/glVertex3f/glEnd and friends) from scratch on top of GLES, since GLES has none of it. That code compiled but was never actually exercised - no on-screen verification was possible without real Quest hardware - making it the biggest unverified risk in the port. Replace it with GL4ES (MIT-licensed, prebuilt into the build image), a mature desktop-GL-on-GLES translation library used by other Quest/Android game ports for exactly this problem. This cuts 04-android-opengl-es-render.patch by half, deleting the hand-written vertex-accumulation emulation entirely; alpha test, point sprites, and point size stay on their existing GLES-native fixes rather than trusting GL4ES's shakier custom-shader interop for those. Bump build-image/VERSION to 3 - a fresh image with GL4ES cross-compiled for arm64-v8a was built and make apk verified successfully against it.
This commit is contained in:
@@ -46,6 +46,10 @@ ARG ANDROID_COMPILE_SDK_VERSION=34
|
||||
ARG ANDROID_BUILD_TOOLS_VERSION=34.0.0
|
||||
ARG ANDROID_NDK_VERSION=26.1.10909125
|
||||
ARG ANDROID_CMAKE_VERSION=3.22.1
|
||||
# GL4ES (https://github.com/ptitSeb/gl4es) - translates the engine's
|
||||
# desktop-style immediate-mode OpenGL calls into real GLES/EGL calls, so
|
||||
# engine/src/MacSrc/OpenGL.cc needs no immediate-mode rewrite on Android.
|
||||
ARG ANDROID_GL4ES_VERSION=1.1.6
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
@@ -225,6 +229,23 @@ RUN git clone https://github.com/EtherTyper/fluidsynth-lite.git fluidsynth-lite-
|
||||
/opt/prebuilt/android/fluidsynth-lite/include/fluidsynth/version.h \
|
||||
&& rm -rf fluidsynth-lite-android build-fluidsynth-android
|
||||
|
||||
# gl4es's own CMakeLists.txt writes its output straight to
|
||||
# ${CMAKE_SOURCE_DIR}/lib (the source tree, not the build dir) and gives
|
||||
# the GL target a ".so.1" suffix - stage explicitly rather than
|
||||
# `cmake --install` (which it doesn't support for this target anyway).
|
||||
RUN git clone --branch "v${ANDROID_GL4ES_VERSION}" --depth 1 \
|
||||
https://github.com/ptitSeb/gl4es.git gl4es-android \
|
||||
&& rm -rf gl4es-android/.git \
|
||||
&& cmake -S gl4es-android -B build-gl4es-android \
|
||||
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_TOOLCHAIN}" \
|
||||
-DANDROID_ABI="${ANDROID_ABI}" -DANDROID_PLATFORM="android-${ANDROID_PLATFORM_VERSION}" \
|
||||
-DANDROID=ON -DUSE_ANDROID_LOG=ON -DSTATICLIB=OFF \
|
||||
&& cmake --build build-gl4es-android -j"$(nproc)" \
|
||||
&& mkdir -p /opt/prebuilt/android/gl4es/lib /opt/prebuilt/android/gl4es/include \
|
||||
&& cp -a gl4es-android/lib/libGL.so.1 /opt/prebuilt/android/gl4es/lib/libGL.so \
|
||||
&& cp -a gl4es-android/include/. /opt/prebuilt/android/gl4es/include/ \
|
||||
&& rm -rf gl4es-android build-gl4es-android
|
||||
|
||||
COPY build-image/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
COPY build-image/build-engine.sh /usr/local/bin/build-engine.sh
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh /usr/local/bin/build-engine.sh
|
||||
|
||||
Reference in New Issue
Block a user