-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flickering issues with low processor mode on Android #59607
Fix flickering issues with low processor mode on Android #59607
Conversation
7117a46
to
4a6adf0
Compare
f937f5f
to
f299b9b
Compare
@@ -243,9 +243,12 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_step(JNIEnv *env, jcl | |||
DisplayServerAndroid::get_singleton()->process_magnetometer(magnetometer); | |||
DisplayServerAndroid::get_singleton()->process_gyroscope(gyroscope); | |||
|
|||
if (os_android->main_loop_iterate()) { | |||
bool should_swap_buffers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we've favoring the defensive initialization style now, so it'd be good to initialize this one.
@@ -17,4 +17,4 @@ target_include_directories(${PROJECT_NAME} | |||
SYSTEM PUBLIC | |||
${GODOT_ROOT_DIR}) | |||
|
|||
add_definitions(-DUNIX_ENABLED -DVULKAN_ENABLED -DTOOLS_ENABLED) | |||
add_definitions(-DUNIX_ENABLED -DVULKAN_ENABLED -DANDROID_ENABLED) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nitpick: I fell like changes of this kind should be in their own commit since they are not really part of the main task. For me, it'd be fine the alternative of just adding a line in the commit message telling that there are some additional little fixes unrelated to the main goal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RandomShaper This change is mostly cosmetic and doesn't affect the engine logic.
That CMake file is only used by Android Studio to properly show the native engine code, and so has no effects on anything else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a few comments about not very important things.
Besides them, my only real concern is the maintainability of the forked stuff. I'd suggest to follow the closest that is possible to the scheme followed for other 3rd-party code. Being Java files I'm not sure if they can be put under ´thirdparty/´, but at least it would be good to check out the changes as patch files for easier upgrading.
In the past for java code, we've departed from the I'm also not very concerned about maintainability given the forked files have been stable for quite a while ( |
f299b9b
to
b176b31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough.
As pointed out by @Relintai in #55604 (comment), the cause of the flickers when enabling low processor mode is that the framebuffers are swapped automatically even when nothing is rendered.
To resolve the issue, I forked
GLSurfaceView
so that the Godot Android logic can specify when the framebuffers should be swapped.Fixes #19304
Fixes #58932
Bugsquad edit:
master
version of #59606.