Android backend improvements and fixup (WIP)#2727
Android backend improvements and fixup (WIP)#2727riccardobl wants to merge 5 commits intojMonkeyEngine:masterfrom
Conversation
|
🖼️ Screenshot tests have failed. The purpose of these tests is to ensure that changes introduced in this PR don't break visual features. They are visual unit tests. 📄 Where to find the report:
✅ If you did mean to change things: ✨ If you are creating entirely new tests: Note; it is very important that the committed reference images are created on the build pipeline, locally created images are not reliable. Similarly tests will fail locally but you can look at the report to check they are "visually similar". See https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-screenshot-tests/README.md for more information Contact @richardTingle (aka richtea) for guidance if required |
There was a problem hiding this comment.
Code Review
This pull request updates the Android implementation to support OpenGL ES 3.0, migrates to AndroidX, and improves the Android harness fragment. It also refactors texture format handling and mipmap generation to be more robust across different hardware. I have identified two issues: the error dialog in AndroidHarnessFragment lacks a dismiss action, and the EGL extension check in OGLESContext is susceptible to false positives.
Co-authored-by: Copilot <copilot@github.com>
68e8dd5 to
4313238
Compare
|
@gemini-code-assist new review pls |
There was a problem hiding this comment.
Code Review
This pull request modernizes the Android backend by transitioning to OpenGL ES 3.0 and AndroidX, refactoring core components like AndroidHarnessFragment and OGLESContext. Key enhancements include a new sRGB blit conversion for gamma correction, improved EGL configuration selection, and a more robust MipMapGenerator with alpha-weighted filtering. Reviewers suggested implementing glShaderStorageBlockBinding via the GLES31 API, enabling CPU mipmap fallbacks for power-of-two resized images, and utilizing dynamic depth format selection for the linear framebuffer to improve device compatibility.
Co-authored-by: Copilot <copilot@github.com>
|
@gemini-code-assist new review pls |
There was a problem hiding this comment.
Code Review
This pull request introduces significant updates to the Android build configuration and rendering pipeline, including improved NDK discovery, support for OpenGL ES 3.0, and a new linear-to-sRGB blit conversion mechanism. I have reviewed the changes and provided a suggestion to improve the efficiency and readability of the NDK discovery logic in build.gradle by deduplicating SDK directory searches.
| def localProperties = file('local.properties') | ||
| if (localProperties.isFile()) { | ||
| Properties properties = new Properties() | ||
| localProperties.withInputStream { properties.load(it) } | ||
| if (properties.getProperty('ndk.dir')) { | ||
| ndkCandidates << file(properties.getProperty('ndk.dir')) | ||
| } | ||
| if (properties.getProperty('sdk.dir')) { | ||
| ndkCandidates.addAll(findAndroidNdkDirs(file(properties.getProperty('sdk.dir')))) | ||
| } | ||
| } | ||
|
|
||
| if (System.env.ANDROID_HOME) { | ||
| ndkCandidates.addAll(findAndroidNdkDirs(file(System.env.ANDROID_HOME))) | ||
| } | ||
| if (System.env.ANDROID_SDK_ROOT) { | ||
| ndkCandidates.addAll(findAndroidNdkDirs(file(System.env.ANDROID_SDK_ROOT))) | ||
| } | ||
| ndkCandidates.addAll(findAndroidNdkDirs(file("${System.properties['user.home']}/Android/Sdk"))) |
There was a problem hiding this comment.
The current logic for finding the NDK by searching through various SDK directories can be made more efficient and readable. It may perform redundant searches if multiple environment variables or properties point to the same SDK location.
A better approach would be to first collect all potential SDK directory paths, deduplicate them, and then iterate over the unique paths to find NDKs. This avoids unnecessary file system operations and makes the logic clearer. A similar pattern is already used in jme3-android-examples/build.gradle for locating adb.
def sdkDirs = []
def localProperties = file('local.properties')
if (localProperties.isFile()) {
Properties properties = new Properties()
localProperties.withInputStream { properties.load(it) }
if (properties.getProperty('ndk.dir')) {
ndkCandidates << file(properties.getProperty('ndk.dir'))
}
if (properties.getProperty('sdk.dir')) {
sdkDirs << file(properties.getProperty('sdk.dir'))
}
}
if (System.env.ANDROID_HOME) {
sdkDirs << file(System.env.ANDROID_HOME)
}
if (System.env.ANDROID_SDK_ROOT) {
sdkDirs << file(System.env.ANDROID_SDK_ROOT)
}
sdkDirs << file("${System.properties['user.home']}/Android/Sdk")
sdkDirs.unique { it.canonicalPath }.each { sdkDir ->
ndkCandidates.addAll(findAndroidNdkDirs(sdkDir))
}
This brings the android backend up to par with the desktop ~GL3 backend.
After this PR the android renderer will use GLES3+ only, and support android 11+.
WIP