Repository navigation
Android Build - #6992
Android Build#6992
Conversation
|
Regarding point 1, the prebuilt override bug, that's fixed in the SDL3 branch. I keep forgetting to split that off into it's own thing and PR it. Another thing is that since we've moved to a newer cmake version we can technically replicate |
eca087f to
ab778d4
Compare
2b6fca8 to
ca6b8a7
Compare
41840fa to
e8f665d
Compare
There was a problem hiding this comment.
Read this against master and ran a desktop regression on master+this branch: no change on OpenGL or Vulkan, and the json_v1 output is the same structurally. Things I found:
- Prebuilts: the Android archives come from your personal release under the reusable
prebuilts-cmaketag. The download is checked for TLS only, and reuse is keyed onPREBUILT_VERSION_NAME, so replacing an archive under the same tag never re-downloads. Until they move to scp-prebuilt (your TODO), anEXPECTED_HASH SHA256=...on the download would pin them. - Vulkan pre-transform: master now marks the swap chain for rebuild on any
eSuboptimalfrom acquire or present. If Android returns SUBOPTIMAL whenpreTransformdiffers fromcurrentTransform(I believe it does on 10+, but haven't checked on a device), a phone in landscape would rebuild every frame. Ignoring suboptimal on Android when the extent hasn't changed would avoid that. Also, the comment above it has the mechanism reversed: the engine rotates whenpreTransformdiffers fromcurrentTransform. Identity is still the right choice for content that isn't pre-rotated. - The build recipe's
sedfor-lusb-1.0suggests a prebuilt's link interface pulls it in. Dropping it underANDROIDand adding a configure-only NDK job would keep this from rotting (master'sspeech_android.cppis still on SDL2 names, for example). - JNI: the four
osapi.cpphelpers neverDeleteLocalRefthe activity fromSDL_GetAndroidActivity()(SDL says the caller must release it), and they don't check for exceptions afterCallStatic*Method. The overlay pair runs on every option change. One shared helper like the one inspeech_android.cppwould fix both in one place. - Smaller:
- The
getWorkingFolderfallback appends/files/toSDL_GetAndroidExternalStoragePath(), which already ends infiles. set(VAR ON FORCE)withoutCACHEsets a normal variable toON;FORCE; anANDROIDdefault on the option would be cleaner (master has the same idiom at line 147 withOFF, filed as #7984).- The Borderless default only applies on the in-game-options path.
- Under
USE_OPENGL_ESthe ImGui SDL3 backend is never initialized, so the lab and options screens assert; that's on master already, and your #7489 may cover it. - The
json_v2comment says flags only, but it includespref_path, which seems intended for the launcher.
- The
-getWorkingFolder, fixed fallback Ill check on device now to make sure i didnt break anything. EDIT: it still works fine. Also i confirmed libusb1.0 is not longer being linked. |
dustinspace217
left a comment
There was a problem hiding this comment.
Thanks, I went through the new commits. The suboptimal handling looks right to me: out-of-date still always rebuilds, and on Android a suboptimal is skipped only when the surface reports a non-identity transform and the extent hasn't changed, which is the compositor compensating for the identity preTransform. A size change still rebuilds. The local frame in the JNI helper covers every exit path, and the folder and json_v2 fixes check out.
One leftover: CMakeLists.txt:62-66 still use set(X ON FORCE) without CACHE, the same idiom #7489 fixed for #7984. set(X ON CACHE BOOL "" FORCE) would match.
dustinspace217
left a comment
There was a problem hiding this comment.
This is a code-reading review of the two new commits, and nothing was built or run.
The leftover from my last comment is resolved: CMakeLists.txt:62-66 now use set(X ON CACHE BOOL "" FORCE).
Small cleanup, not a blocker: of those five, only SDL3_USE_PRECOMPILED and OPENAL_USE_PRECOMPILED (:64-65) actually take effect. USING_PREBUILT_LIBS (:63) and USING_PREBUILT_VULKAN (:66) get shadowed by the plain set() calls in SDL3.cmake:41, OpenAL.cmake:34, FFmpeg.cmake:61 and vulkan.cmake:96, and Android already gets the Vulkan prebuilt through the OR ANDROID at vulkan.cmake:98.
FSO_BUILD_INCLUDED_LIBS (:62) repeats the OR ANDROID default at :121, and the FORCE means it can't be overridden from the command line, so lines 62, 63 and 66 could go.
The touch overlay string IDs 1936 to 1939 are unused on master, where the highest is 1935 (2d.cpp:908), and the XSTR_SIZE note now says 1940, so that matches the convention.
The other hunks in the new diff (the GLES log lines, the Vulkan clip distance and ETC2 changes, the ImGui init move) came in with the master merge and aren't part of this PR's own diff.
Everything else is unchanged from the head I approved, so the approval stands.
|
Heads up: #7694 also takes XSTR 1936 and 1937 (tracing.cpp:345-346), so whichever of these merges second will need to move up. 1940 and later are free on master today. |
BMagnu
left a comment
There was a problem hiding this comment.
Looks good with the newest round of changes.
We should get the prebuilts into the SCP organization ASAP post-merge.
Android OS:
-Added "-get_flags json_v2": It is a minimal version of the v1 removing all info related to configuration. To avoid doing sdl inits while getting flags. This is mostly intended to list cmdline flag data for the "configure" option in knossos mods.
Note: It is now possible to compile both fso and the prebuilt libs with just an script on a linux x64 system with only having the same dependencies needed to compile normally.
https://github.com/Shivansps/Fso-Android-Prebuilts
A docker file was also added.
Note2: without #7489 android builds can only be compiled for Vulkan and will work if the device supports hardware clipping. 7489 fixes GLES compile, adds support in internal shaders and adds SW fallback for clip in vulkan.
For compiling, as it is in the script, its petty much two operations, first compile the embedded file, then the normal builds by turning off QTFRED and OPENXR. Android NDK is needed, R29 is recommended as it enables 16KB alignment.
While testing FSO and Knossos i did build x86 and arm32 bit builds, but in the end this is not worth it and i dont even think im going to ship Knossos with 32bits support either, so it is recommended not to waster time and space in 32bit builds.