Skip to content
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

Godot 4.2.1 Compatibility Rendering (GLES3) don't works at all on a 3 Years Old Andoid Device #86112

Closed
joined72 opened this issue Dec 13, 2023 · 115 comments · Fixed by #87352
Closed

Comments

@joined72
Copy link
Contributor

Tested versions

Godot 4.2.1

System information

Android 8.0 - Godot 4.2.1 Compatibility Rendering (GLES3)

Issue description

I created an empty project with an empty scene with the Compatibility Rendering modality, after exported it for Android and upload to my Old Huawei 10" Tablet (Android 8 updated on Sep/2020), results?
After showing the Godot Logo the app freeze.

Initially, I was discouraged thinking that my old tablet probably missing the OpenGL ES 3.0 driver/feature (GLES3) but to be sure I installed GFXBench, an Android App able to test and bench all the device’s graphic abilities.
The app showed me that my device has full support for OpenGL ES 1.0, 2.0, and 3.0 but hasn’t any support for Vulkan, OpenGL ES 3.1 and 3.2.
To be sure I executed all the OpenGL ES 3.0 tests and to my great surprise, all works fine, as you can see from the following image.
Screenshot_20231213-104133

So now my question is… how can I help to fix this bug?

Steps to reproduce

You need an Old Android Device.

Minimal reproduction project (MRP)

Any empty project with an empty scene in Compatibility Modality

@Zireael07
Copy link
Contributor

I don't think this is something that can be fixed, it's likely your device is indeed missing some feature the Compatibility renderer uses - I believe it uses some features of GLES 3.1 in addition to 3.0

@AThousandShips
Copy link
Member

Did you properly export with the compatibility renderer? Just selecting it in the editor isn't enough, you need to set this setting: rendering/renderer/rendering_method.mobile

@joined72
Copy link
Contributor Author

Did you properly export with the compatibility renderer? Just selecting it in the editor isn't enough, you need to set this setting: rendering/renderer/rendering_method.mobile

OK, just done but same result, this is the debug output:

Exporting for Android...
- debug build: true
- export path: /home/fabio/.cache/godot/tmpexport.1702464605.apk
- export format: 0
- sign build: true
- gradle build enabled: false
- apk expansion enabled: false
- enabled abis: armeabi-v7a,arm64-v8a
- export filter: 0
- include filter: 
- exclude filter: 
Using default splash image.
Creating splash background color image.
Loading regular icon from 
- falling back to project icon: res://icon.png
Loading adaptive foreground icon from 
- falling back to using the regular icon
0 param: --xr_mode_regular
1 param: --use_immersive
Starting legacy build system...
ADDING: classes.dex
ADDING: classes2.dex
ADDING: classes3.dex
ADDING: classes4.dex
ADDING: lib/arm64-v8a/libc++_shared.so
ADDING: lib/arm64-v8a/libgodot_android.so
ADDING: lib/armeabi-v7a/libc++_shared.so
ADDING: lib/armeabi-v7a/libgodot_android.so
ADDING: kotlin/annotation/annotation.kotlin_builtins
ADDING: kotlin/collections/collections.kotlin_builtins
ADDING: kotlin/coroutines/coroutines.kotlin_builtins
ADDING: kotlin/internal/internal.kotlin_builtins
ADDING: kotlin/kotlin.kotlin_builtins
ADDING: kotlin/ranges/ranges.kotlin_builtins
ADDING: kotlin/reflect/reflect.kotlin_builtins
ADDING: AndroidManifest.xml
ADDING: res/anim-v21/fragment_fast_out_extra_slow_in.xml
ADDING: res/animator/fragment_close_enter.xml
ADDING: res/animator/fragment_close_exit.xml
ADDING: res/animator/fragment_fade_enter.xml
ADDING: res/animator/fragment_fade_exit.xml
ADDING: res/animator/fragment_open_enter.xml
ADDING: res/animator/fragment_open_exit.xml
ADDING: res/drawable-hdpi-v4/notification_bg_low_normal.9.png
ADDING: res/drawable-hdpi-v4/notification_bg_low_pressed.9.png
ADDING: res/drawable-hdpi-v4/notification_bg_normal.9.png
ADDING: res/drawable-hdpi-v4/notification_bg_normal_pressed.9.png
ADDING: res/drawable-hdpi-v4/notify_panel_notification_icon_bg.png
ADDING: res/drawable-mdpi-v4/notification_bg_low_normal.9.png
ADDING: res/drawable-mdpi-v4/notification_bg_low_pressed.9.png
ADDING: res/drawable-mdpi-v4/notification_bg_normal.9.png
ADDING: res/drawable-mdpi-v4/notification_bg_normal_pressed.9.png
ADDING: res/drawable-mdpi-v4/notify_panel_notification_icon_bg.png
ADDING: res/drawable-nodpi-v4/splash.png
ADDING: res/drawable-nodpi-v4/splash_bg_color.png
ADDING: res/drawable-v21/notification_action_background.xml
ADDING: res/drawable-xhdpi-v4/notification_bg_low_normal.9.png
ADDING: res/drawable-xhdpi-v4/notification_bg_low_pressed.9.png
ADDING: res/drawable-xhdpi-v4/notification_bg_normal.9.png
ADDING: res/drawable-xhdpi-v4/notification_bg_normal_pressed.9.png
ADDING: res/drawable-xhdpi-v4/notify_panel_notification_icon_bg.png
ADDING: res/drawable/notification_bg.xml
ADDING: res/drawable/notification_bg_low.xml
ADDING: res/drawable/notification_icon_background.xml
ADDING: res/drawable/notification_tile_bg.xml
ADDING: res/drawable/splash_drawable.xml
ADDING: res/layout-v21/notification_action.xml
ADDING: res/layout-v21/notification_action_tombstone.xml
ADDING: res/layout-v21/notification_template_custom_big.xml
ADDING: res/layout-v21/notification_template_icon_group.xml
ADDING: res/layout/custom_dialog.xml
ADDING: res/layout/downloading_expansion.xml
ADDING: res/layout/godot_app_layout.xml
ADDING: res/layout/notification_template_part_chronometer.xml
ADDING: res/layout/notification_template_part_time.xml
ADDING: res/layout/status_bar_ongoing_event_progress_bar.xml
ADDING: res/mipmap-anydpi-v26/icon.xml
ADDING: res/mipmap-hdpi-v4/icon.png
ADDING: res/mipmap-hdpi-v4/icon_background.png
ADDING: res/mipmap-hdpi-v4/icon_foreground.png
ADDING: res/mipmap-mdpi-v4/icon.png
ADDING: res/mipmap-mdpi-v4/icon_background.png
ADDING: res/mipmap-mdpi-v4/icon_foreground.png
ADDING: res/mipmap-xhdpi-v4/icon.png
ADDING: res/mipmap-xhdpi-v4/icon_background.png
ADDING: res/mipmap-xhdpi-v4/icon_foreground.png
ADDING: res/mipmap-xxhdpi-v4/icon.png
ADDING: res/mipmap-xxhdpi-v4/icon_background.png
ADDING: res/mipmap-xxhdpi-v4/icon_foreground.png
ADDING: res/mipmap-xxxhdpi-v4/icon.png
ADDING: res/mipmap-xxxhdpi-v4/icon_background.png
ADDING: res/mipmap-xxxhdpi-v4/icon_foreground.png
ADDING: res/mipmap/icon.png
ADDING: res/mipmap/icon_background.png
ADDING: res/mipmap/icon_foreground.png
ADDING: res/xml/godot_provider_paths.xml
ADDING: resources.arsc
Starting signing of the APK binary using /home/fabio/Dropbox/Android/SDK/build-tools/33.0.2/apksigner
Signing debug binary using: 
/home/fabio/Dropbox/Android/SDK/build-tools/33.0.2/apksigner sign --verbose --ks /home/fabio/Dropbox/Android/Keys/debug.keystore --ks-pass pass:android --ks-key-alias androiddebugkey /home/fabio/.cache/godot/tmpexport.1702464605.apk
Signed

Verifying signed build using: 
/home/fabio/Dropbox/Android/SDK/build-tools/33.0.2/apksigner verify --verbose /home/fabio/.cache/godot/tmpexport.1702464605.apk
Verifies
Verified using v1 scheme (JAR signing): true
Verified using v2 scheme (APK Signature Scheme v2): true
Verified using v3 scheme (APK Signature Scheme v3): true
Verified using v3.1 scheme (APK Signature Scheme v3.1): false
Verified using v4 scheme (APK Signature Scheme v4): false
Verified for SourceStamp: false
Number of signers: 1

Successfully completed signing build.
Installing to device (please wait...): Huawei AGS-W09
Performing Streamed Install
Success

Starting: Intent { act=android.intent.action.MAIN cmp=org.godotengine.godot4gles3/com.godot.game.GodotApp }

And now?

@joined72
Copy link
Contributor Author

I don't think this is something that can be fixed, it's likely your device is indeed missing some feature the Compatibility renderer uses - I believe it uses some features of GLES 3.1 in addition to 3.0

Are you sure, how I can check it to be sure?

@AThousandShips
Copy link
Member

AThousandShips commented Dec 13, 2023

I'd suggest asking these questions in the other community channels first, likely your hardware is too old to support Godot

@joined72
Copy link
Contributor Author

I'd suggest asking these questions in the other community channels first, likely your hardware is too old to support Godot

But is a 10" Tablet buy on 2020, only 3 years old!!! :( ... and on Godot 3.5.3 GLES2 all works fine.
So my question is, why setup the Compatibility Render to GLES3.1 if a Device old only 3 years just fall on it?
Why do not setup it to GLES3.0, or at least allow an option, as for Linux exists, to FallBack to old GLES3.0 instead that 3.1?

@joined72 joined72 changed the title Godot 4.2.1 Compatibility Rendering (GLES3) don't works at all on Old Andoid Devices Godot 4.2.1 Compatibility Rendering (GLES3) don't works at all on a 3 Years Old Andoid Device Dec 13, 2023
@AThousandShips
Copy link
Member

AThousandShips commented Dec 13, 2023

It does use OpenGL ES 3.0, don't know why your hardware doesn't work, not necessarily too old but too low support, just because it's only ~4 years old doesn't mean it's capable, and 3.5 GLES2 is different here

Edit: My bad only linux uses it, unsure why not on Android 🙂

@joined72
Copy link
Contributor Author

It does use OpenGL ES 3.0, don't know why your hardware doesn't work, not necessarily too old but too low support, just because it's only ~4 years old doesn't mean it's capable, and 3.5 GLES2 is different here

OK, I'll be happy to can help to identify the problem just to be sure if exists the possibility to improve the Compatibility render, only this. Can you simple point me in the right direction to debug it, please? Thanks.

@AThousandShips
Copy link
Member

I'd ask in the channels 🙂, to see if this is an issue or insufficient support

@joined72
Copy link
Contributor Author

I'd ask in the channels 🙂, to see if this is an issue or insufficient support

Thank you very much.

@AThousandShips
Copy link
Member

Indeed the android port does not seem to support OpenGL ES 3.0 from the settings, so likely you have to have OpenGL 3.3, meaning your hardware isn't supported

@akien-mga
Copy link
Member

No that's a misunderstanding. OpenGL and OpenGL ES have different versioning.

We use OpenGL 3.3 on desktop, and OpenGL ES 3.0 on mobile.

That being said, older Android devices tend to claim support for OpenGL ES 3.0, but the drivers are so old and buggy that it doesn't work in practice. It may have passed basic compliance tests, but doesn't actually support anything non trivial being made with it. This is hard to detect and thus to prevent from the engine side, we just know that the OS claims to support OpenGL ES 3.0.

@AThousandShips
Copy link
Member

Indeed, the naming and settings are confusing and overrode my initial assumption

@Calinou
Copy link
Member

Calinou commented Dec 13, 2023

But is a 10" Tablet buy on 2020, only 3 years old!!! :( ...

The tablet may be only 3 years old, but its GPU (Adreno 308) was announced in February 2016. This makes it almost 8 years old as of writing. Low-end devices often feature old SoCs as they get cheaper to manufacture over time, and they can sometimes be very old like in your case.

This is why an used flagship device is often a better choice than a new low-end device - their SoC won't be the latest, but it'll still be the greatest it was back then.

@joined72
Copy link
Contributor Author

The tablet may be only 3 years old, but its GPU (Adreno 308) was announced in February 2016. This makes it almost 8 years old as of writing. Low-end devices often feature old SoCs as they get cheaper to manufacture over time, and they can sometimes be very old like in your case.

OK but I don't understand why the game freeze an the GLES3 initialization, no one frame is showed in GLES3, so I suppose I can investigate a bit more just to be sure what is the problem, at least to understand why Godot isn't able at least to enter in GLES3 modality. Can you instruct me about the right direction to follow to debug it, please?
I wont to help!

@clayjohn
Copy link
Member

I think we can take a step back and figure this out.

There are a few things that we should clear up. But first some background:

  1. On Android the compatibility renderer uses OpenGL ES 3.0 (it does not use any features from 3.1 or anything like that)
  2. We use a really limited set of features, in theory anything that advertises support for OpenGL ES 3.0 should work

We need a bit more information from @joined72:

  1. Have you tested GLES3 in Godot 3.5.2? It uses more advanced features than the compatibility renderer in Godot 4.2, so if it works, then 4.2 should definitely work
  2. Can you share your project, or at least your project.godot file so we can confirm that you are exporting with OpenGL?
  3. Have you tried debugging on your device using adb logcat to get the logs? It would be really helpful for us to see if the engine is printing any error messages as it loads

@joined72
Copy link
Contributor Author

joined72 commented Dec 14, 2023

We need a bit more information from @joined72:

1. Have you tested GLES3 in Godot 3.5.2? It uses more advanced features than the compatibility renderer in Godot 4.2, so if it works, then 4.2 should definitely work

I just tested the game on Godot 3.5.3 GLES3, ... same results! :(

2. Can you share your project, or at least your project.godot file so we can confirm that you are exporting with OpenGL?

Here: GLES3_Test.zip

3. Have you tried debugging on your device using `adb logcat` to get the logs? It would be really helpful for us to see if the engine is printing any error messages as it loads

This is the adb logcat obtained with the adb logcat | grep -E 'godot|com.example.gles3_test' command:

12-13 11:13:22.600 24048 24048 E AndroidRuntime: Process: org.godotengine.godot4gles3, PID: 24048
12-13 11:13:22.600 24048 24048 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.godotengine.godot4gles3/com.godot.game.GodotApp}: java.lang.IllegalStateException: Unable to initialize engine render view
12-13 11:13:22.600 24048 24048 E AndroidRuntime: 	at org.godotengine.godot.GodotFragment.performEngineInitialization(GodotFragment.java:196)
12-13 11:13:22.600 24048 24048 E AndroidRuntime: 	at org.godotengine.godot.GodotFragment.onCreate(GodotFragment.java:182)
12-13 11:13:22.600 24048 24048 E AndroidRuntime: 	at org.godotengine.godot.GodotActivity.onCreate(GodotActivity.kt:84)
12-13 11:13:22.600 24048 24048 E AndroidRuntime: 	at com.godot.game.GodotApp.onCreate(GodotApp.java:45)
12-14 09:14:17.589   461   465 D VoldCmdListener: volume mkdirs /storage/emulated/0/Android/data/org.godotengine.godot3gles3/files/
12-14 09:14:18.059 20163 20163 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {org.godotengine.godot3gles3/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 09:15:42.981 20542 20542 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {org.godotengine.godot3gles3/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 09:26:17.462   461   465 D VoldCmdListener: volume mkdirs /storage/emulated/0/Android/data/com.example.gles3_test/files/
12-14 09:26:17.881 22055 22055 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {com.example.gles3_test/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 09:38:41.111 24447 24447 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {com.example.gles3_test/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 09:41:56.174 24878 24878 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {com.example.gles3_test/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 09:42:32.547 25000 25000 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {com.example.gles3_test/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 09:57:20.675   777  1719 D installed: forkNotifyToRMS parcel pid = 26781, ppid = 777, pkgname = com.example.gles3_test
12-14 09:57:20.824 26781 26781 I dex2oat : /system/bin/dex2oat Installd-com.example.gles3_test --input-vdex-fd=-1 --output-vdex-fd=21 --compiler-filter=quicken --debuggable --classpath-dir=/data/app/vmdl2016444544.tmp
12-14 09:57:22.867 14845 26793 W GCM     : Unexpected forwarded intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.gles3_test flg=0x4000010 pkg=com.google.android.gms cmp=com.google.android.gms/.chimera.PersistentIntentOperationService (has extras) }
12-14 09:57:22.886 14845 26795 W GCM     : Unexpected forwarded intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.gles3_test flg=0x4000010 pkg=com.google.android.gms cmp=com.google.android.gms/.chimera.PersistentIntentOperationService (has extras) }
12-14 09:57:23.262 22020 22142 D WorkSource: i1=1 i2=0 N1=1: insert 10109 com.example.gles3_test
12-14 09:57:23.263 22020 22142 D WorkSource: Insert in WorkSource{10085 com.google.android.gms} @ 1 uid 10109 name com.example.gles3_test
12-14 09:57:23.271 24641 24691 I Finsky  : [2593] knt.a(55): AIM: AppInfoManager-Perf > OnDeviceAppInfo > cacheHitCount=0, cacheMissCount=1. Missed  in cache (limit 10) : [com.example.gles3_test]
12-14 09:57:23.304 22020 23844 D WorkSource: Insert in WorkSource{10109 com.example.gles3_test} @ 0 uid 10085 name com.google.android.gms
12-14 09:57:23.670  2271  2271 I HwLauncher: Model onPackageAdded packageName = com.example.gles3_test user = UserHandle{0}
12-14 09:57:23.691  2271  2271 I HwLauncher: Model  findCloudAppInfoInDB : found 0 shortcutInfo for package[com.example.gles3_test] in db
12-14 09:57:23.691  2271  2271 I HwLauncher: PowerSaveLauncherModel onPackageAdded packageName = com.example.gles3_test user = UserHandle{0}
12-14 09:57:23.691  2271  2271 I HwLauncher: StreetModeLauncherModel onPackageAdded packageName = com.example.gles3_test user = UserHandle{0}
12-14 09:57:23.936 24641 24641 I Finsky  : [1] kly.f(9): AIM: AppInfoCacheUpdater -> invalidating apps: [com.example.gles3_test]
12-14 09:57:23.950 24641 24691 I Finsky  : [2593] knt.a(55): AIM: AppInfoManager-Perf > OnDeviceAppInfo > cacheHitCount=0, cacheMissCount=1. Missed  in cache (limit 10) : [com.example.gles3_test]
12-14 09:57:24.115 24641 26450 I Finsky  : [2674] jua.a(178): Asset module storage cleared for package com.example.gles3_test.
12-14 09:57:24.489 14845 26801 W GCM     : Unexpected forwarded intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.gles3_test flg=0x4000010 pkg=com.google.android.gms cmp=com.google.android.gms/.chimera.PersistentIntentOperationService (has extras) }
12-14 09:57:24.491 14845 26795 W GCM     : Unexpected forwarded intent: Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.gles3_test flg=0x4000010 pkg=com.google.android.gms cmp=com.google.android.gms/.chimera.PersistentIntentOperationService (has extras) }
12-14 09:57:24.610 22020 22142 D WorkSource: i1=1 i2=0 N1=1: insert 10109 com.example.gles3_test
12-14 09:57:24.610 22020 22142 D WorkSource: Insert in WorkSource{10085 com.google.android.gms} @ 1 uid 10109 name com.example.gles3_test
12-14 09:59:46.699  2219  2606 I ash     : front pkg : com.example.gles3_test launcher: false
12-14 09:59:46.699  2219  2606 I ash     : above launcher front pkgs: [com.example.gles3_test]
12-14 09:59:47.020 27048 27048 I chatty  : uid=10125(u0_a125) com.example.gles3_test identical 345 lines
12-14 09:59:47.134  2219  2357 D ScenarioService: front pkg : com.example.gles3_test launcher: false
12-14 09:59:47.134  2219  2357 D ScenarioService: new above launcher front pkgs: [com.example.gles3_test]
12-14 09:59:47.139  2219  2357 I AppsUsage: scnOff:false FgAPP:com.example.gles3_test BgAPP:com.huawei.android.launcher
12-14 09:59:47.176  2219  2798 I PGServer: report state:10000 event type:1 pid:0 uid:0 pkg:com.example.gles3_test to pid: 1718
12-14 09:59:47.176  2219  2798 I PGServer: report state:10000 event type:1 pid:0 uid:0 pkg:com.example.gles3_test to pid: 2219
12-14 09:59:47.176  2219  2798 I SceneReceiver: state type: 10000 eventType:1 pid:0 uid:0 pkg:com.example.gles3_test
12-14 09:59:47.177  2219  2812 D HwThermalStateManager: current foreapp pkg : com.example.gles3_test
12-14 09:59:47.274 27048 27064 I chatty  : uid=10125(u0_a125) com.example.gles3_test expire 14 lines
12-14 09:59:47.369   461   465 D VoldCmdListener: volume mkdirs /storage/emulated/0/Android/data/com.example.gles3_test/files/
12-14 09:59:47.765 27048 27048 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {com.example.gles3_test/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 09:59:47.819 27048 27079 I chatty  : uid=10125(u0_a125) com.example.gles3_test expire 7 lines
12-14 09:59:47.843 27048 27080 I chatty  : uid=10125(u0_a125) com.example.gles3_test expire 1 line
12-14 09:59:47.950 27048 27077 I chatty  : uid=10125(u0_a125) com.example.gles3_test expire 18 lines
12-14 09:59:54.242 27048 27054 I chatty  : uid=10125(u0_a125) com.example.gles3_test expire 3 lines
12-14 10:00:22.265 27048 27048 I chatty  : uid=10125(u0_a125) com.example.gles3_test expire 1 line
12-14 10:00:25.360  2219  2357 D ScenarioService: new above launcher front pkgs: [com.example.gles3_test, com.android.systemui]
12-14 10:00:25.360  2219  2357 I AppsUsage: scnOff:false FgAPP:com.android.systemui BgAPP:com.example.gles3_test
12-14 10:00:25.422  2219  2606 I GpsController: com.example.gles3_test is above launcher app, just return...
12-14 10:00:25.422  2219  2606 I ash     : above launcher front pkgs: [com.example.gles3_test, com.android.systemui]
12-14 10:00:25.424  2219  2798 I PGServer: report state:10000 event type:2 pid:0 uid:0 pkg:com.example.gles3_test to pid: 1718
12-14 10:00:25.425  2219  2798 I PGServer: report state:10000 event type:2 pid:0 uid:0 pkg:com.example.gles3_test to pid: 2219
12-14 10:00:25.425  2219  2798 I SceneReceiver: state type: 10000 eventType:2 pid:0 uid:0 pkg:com.example.gles3_test
12-14 10:00:58.825 27215 27215 I chatty  : uid=10125(u0_a125) com.example.gles3_test identical 39 lines
12-14 10:00:59.046 27215 27232 I chatty  : uid=10125(u0_a125) com.example.gles3_test expire 13 lines
12-14 10:00:59.195 27215 27215 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.WindowInsetsAnimation$Callback" on path: DexPathList[[zip file "/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/lib/arm64, /data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
12-14 10:00:59.195 27215 27215 I zygote64:   at void org.godotengine.godot.GodotFragment.onCreate(android.os.Bundle) (GodotFragment.java:181)
12-14 10:00:59.196 27215 27215 I zygote64:   at void org.godotengine.godot.GodotActivity.onCreate(android.os.Bundle) (GodotActivity.kt:84)
12-14 10:00:59.196 27215 27215 I zygote64:   at void com.godot.game.GodotApp.onCreate(android.os.Bundle) (GodotApp.java:45)
12-14 10:00:59.196 27215 27215 I zygote64: Rejecting re-init on previously-failed class java.lang.Class<org.godotengine.godot.Godot$onInitRenderView$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/WindowInsetsAnimation$Callback;
12-14 10:00:59.197 27215 27215 I zygote64:   at void org.godotengine.godot.GodotFragment.onCreate(android.os.Bundle) (GodotFragment.java:181)
12-14 10:00:59.197 27215 27215 I zygote64:   at void org.godotengine.godot.GodotActivity.onCreate(android.os.Bundle) (GodotActivity.kt:84)
12-14 10:00:59.197 27215 27215 I zygote64:   at void com.godot.game.GodotApp.onCreate(android.os.Bundle) (GodotApp.java:45)
12-14 10:00:59.197 27215 27215 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.WindowInsetsAnimation$Callback" on path: DexPathList[[zip file "/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/lib/arm64, /data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
12-14 10:00:59.197 27215 27215 I zygote64:   at void org.godotengine.godot.GodotFragment.onCreate(android.os.Bundle) (GodotFragment.java:181)
12-14 10:00:59.197 27215 27215 I zygote64:   at void org.godotengine.godot.GodotActivity.onCreate(android.os.Bundle) (GodotActivity.kt:84)
12-14 10:00:59.197 27215 27215 I zygote64:   at void com.godot.game.GodotApp.onCreate(android.os.Bundle) (GodotApp.java:45)
12-14 10:00:59.198 27215 27215 I zygote64: Rejecting re-init on previously-failed class java.lang.Class<org.godotengine.godot.Godot$onInitRenderView$2>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/WindowInsetsAnimation$Callback;
12-14 10:00:59.198 27215 27215 I zygote64:   at void org.godotengine.godot.GodotFragment.onCreate(android.os.Bundle) (GodotFragment.java:181)
12-14 10:00:59.198 27215 27215 I zygote64:   at void org.godotengine.godot.GodotActivity.onCreate(android.os.Bundle) (GodotActivity.kt:84)
12-14 10:00:59.198 27215 27215 I zygote64:   at void com.godot.game.GodotApp.onCreate(android.os.Bundle) (GodotApp.java:45)
12-14 10:00:59.198 27215 27215 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.WindowInsetsAnimation$Callback" on path: DexPathList[[zip file "/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/lib/arm64, /data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
12-14 10:00:59.198 27215 27215 I zygote64:   at void org.godotengine.godot.GodotFragment.onCreate(android.os.Bundle) (GodotFragment.java:181)
12-14 10:00:59.198 27215 27215 I zygote64:   at void org.godotengine.godot.GodotActivity.onCreate(android.os.Bundle) (GodotActivity.kt:84)
12-14 10:00:59.198 27215 27215 I zygote64:   at void com.godot.game.GodotApp.onCreate(android.os.Bundle) (GodotApp.java:45)
12-14 10:00:59.218 27215 27215 I HwApiCacheMangerEx: apicache pi PackageInfo{e4d93c8 com.example.gles3_test}
12-14 10:00:59.230 27215 27215 W linker  : "/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/lib/arm64/libc++_shared.so" unused DT entry: type 0x70000001 arg 0x0
12-14 10:00:59.396 27215 27215 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/lib/arm64, /data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
12-14 10:00:59.397 27215 27215 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/lib/arm64, /data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
12-14 10:00:59.398 27215 27215 I zygote64: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/lib/arm64, /data/app/com.example.gles3_test-fsGPOybXNVecQhPMFjbE7A==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
12-14 10:00:59.426 27215 27215 D ActivityThread: add activity client record, r= ActivityRecord{1040240 token=android.os.BinderProxy@4ed6129 {com.example.gles3_test/com.godot.game.GodotApp}} token= android.os.BinderProxy@4ed6129
12-14 10:00:59.565 27215 27215 W com.example.gles3_test: type=1400 audit(0.0:2273): avc: denied { search } for comm=474C5468726561642032363430 name="kgsl-3d0" dev="sysfs" ino=21562 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:sysfs_kgsl:s0 tclass=dir permissive=0
12-14 10:00:59.579 27215 27244 I godot   : Godot Engine v4.2.1.stable.official.b09f793f5 - https://godotengine.org
12-14 10:00:59.604 27215 27244 I godot   : TextServer: Added interface "Dummy"
12-14 10:00:59.690 27215 27244 I godot   : TextServer: Added interface "ICU / HarfBuzz / Graphite (Built-in)"
12-14 10:00:59.726 27215 27244 I godot   : Using "default" pen tablet driver...
12-14 10:00:59.729 27215 27244 I godot   : godot: ENABLING GL DEBUG
12-14 10:00:59.738 27215 27244 I godot   : Shader 'CanvasSdfShaderGLES3' SHA256: a86e8644c91faf628a28d82fbb43d8062537e54756e49ba358effb980bee9625
12-14 10:00:59.747 27215 27244 I godot   : Shader 'SkeletonShaderGLES3' SHA256: b7f963aa549ccea4474fe7cbd3ff1314d5b592f9d25187a0753390901abdeebf
12-14 10:00:59.750 27215 27244 I godot   : Shader 'ParticlesShaderGLES3' SHA256: fa0ed3a7b23c664eafb1ad09a42372cae71d497e726bcaac074a1591e5e2ffbd
12-14 10:00:59.752 27215 27244 I godot   : Shader 'ParticlesCopyShaderGLES3' SHA256: 80fe86edb00f96ba8389672e2268cecc06c577dbe1a191b13204c0bb6b30fcb6
12-14 10:00:59.753 27215 27244 I godot   : Shader 'CopyShaderGLES3' SHA256: a6d403c8b183ba79926a177b814b5c2c0e0427713ba49b70370c94012591dc41
12-14 10:00:59.763 27215 27244 I godot   : Shader 'CanvasShaderGLES3' SHA256: a77bbb6fcf4720cba41376e989b731b63a27bceca4ea7f371210607385b49674
12-14 10:00:59.764 27215 27244 I godot   : Shader 'CanvasOcclusionShaderGLES3' SHA256: bf78a03bdac6d21135277216f7c9cb5eb789dbb9da1eec409014512904514cba
12-14 10:00:59.778 27215 27244 I godot   : Shader 'SceneShaderGLES3' SHA256: 1783396bc13d69aba84a33963083b18661a6e26af5b4b4dbb5e09b4b97f368cc
12-14 10:02:59.989  1718  1881 V WindowManager: removeIfPossible: Window{41162b5 u0 Splash Screen com.example.gles3_test} callers=com.android.server.wm.WindowState.removeIfPossible:1914 com.android.server.wm.WindowManagerService.removeWindow:2045 com.android.server.wm.Session.remove:218 android.view.ViewRootImpl.dispatchDetachedFromWindow:3774 android.view.ViewRootImpl.doDie:6861 
12-14 10:02:59.990  1718  1881 I WindowManager: Destroying surface Surface(name=Splash Screen com.example.gles3_test) called by com.android.server.wm.WindowStateAnimator.destroySurface:2092 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:899 com.android.server.wm.HwWindowStateAnimator.destroySurfaceLocked:1006 com.android.server.wm.WindowState.removeImmediately:1899 com.android.server.wm.WindowState.removeIfPossible:2051 com.android.server.wm.WindowState.removeIfPossible:1914 com.android.server.wm.WindowManagerService.removeWindow:2045 com.android.server.wm.Session.remove:218 
12-14 10:02:59.991  1718  1881 V WindowManager: postWindowRemoveCleanupLocked: Window{41162b5 u0 Splash Screen com.example.gles3_test}
12-14 10:02:59.991  1718  1881 V WindowManager: Removing Window{41162b5 u0 Splash Screen com.example.gles3_test} from AppWindowToken{8517aa8 token=Token{39d42cb ActivityRecord{486599a u0 com.example.gles3_test/com.godot.game.GodotApp t34}}}
12-14 10:02:59.998  1718  3971 W HwActivityManagerServiceEx: appSwitch from: com.example.gles3_test to: com.android.systemui
12-14 10:02:59.999  1718  3971 V WindowManager: findFocusedWindow: AppWindowToken{8517aa8 token=Token{39d42cb ActivityRecord{486599a u0 com.example.gles3_test/com.godot.game.GodotApp t34}}} below Reached focused app=AppWindowToken{4334448 token=Token{c67aeeb ActivityRecord{c4623a u0 com.android.systemui/.recents.RecentsActivity t13}}}
12-14 10:03:00.017  1718  3971 I WindowManager: Failed to capture screenshot of Token{39d42cb ActivityRecord{486599a u0 com.example.gles3_test/com.godot.game.GodotApp t34}} appWin=Window{732c033 u0 com.example.gles3_test/com.godot.game.GodotApp} drawState=1
12-14 10:03:00.247   791  1022 I dubaid  : [AbnormalityRoutine.cpp] checkCpuAbnormality# 10108:org.godotengine.godot3gles3:0.249:380710:0
12-14 10:03:00.498  1718  1799 W ActivityManager: Activity pause timeout for ActivityRecord{486599a u0 com.example.gles3_test/com.godot.game.GodotApp t34}
12-14 10:03:00.603  1718  2164 D ActivityManager: Skipping intent:act=android.intent.action.DELETE dat=package:com.example.gles3_test flg=0x10800000 cmp=com.google.android.packageinstaller/com.android.packageinstaller.UninstallerActivity
12-14 10:03:01.147  2030  2136 D ReporterUtil:  e id:38 type:{pkg:com.example.gles3_test}
12-14 10:03:01.371  1718 27412 I ActivityManager: Killing 27215:com.example.gles3_test/u0a125 (adj 900): remove task
12-14 10:03:01.401  1718  3355 I WindowManager: WIN DEATH: Window{732c033 u0 com.example.gles3_test/com.godot.game.GodotApp}
12-14 10:03:01.401  1718  3355 V WindowManager: removeIfPossible: Window{732c033 u0 com.example.gles3_test/com.godot.game.GodotApp} callers=com.android.server.wm.WindowState.-wrap1:0 com.android.server.wm.WindowState$DeathRecipient.binderDied:2481 android.os.BinderProxy.sendDeathNotice:842 <bottom of call stack> <bottom of call stack> 
12-14 10:03:01.402  1718  3355 I WindowManager: Destroying surface Surface(name=com.example.gles3_test/com.godot.game.GodotApp) called by com.android.server.wm.WindowStateAnimator.destroySurface:2092 com.android.server.wm.WindowStateAnimator.destroySurfaceLocked:899 com.android.server.wm.HwWindowStateAnimator.destroySurfaceLocked:1006 com.android.server.wm.WindowState.removeImmediately:1899 com.android.server.wm.WindowState.removeIfPossible:2051 com.android.server.wm.WindowState.-wrap1:0 com.android.server.wm.WindowState$DeathRecipient.binderDied:2481 android.os

The second log line seems to indicate a problem in initializing the GLES3 render.

E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.godotengine.godot4gles3/com.godot.game.GodotApp}: java.lang.IllegalStateException: Unable to initialize engine render view

The exception seems to be raised from the following code (GodotFragment.java file, GodotFragment.performEngineInitialization() method, at line 196)

File:
godot/platform/android/java/lib/src/org/godotengine/godot/GodotFragment.java

Method:
GodotFragment.performEngineInitialization()

Source Code:

194			godotContainerLayout = godot.onInitRenderView(this);
195			if (godotContainerLayout == null) {
196				throw new IllegalStateException("Unable to initialize engine render view"); // <=== ERROR IS HERE!!!
197			}

This is the GitHub file URL.

Let me know if I can do ANYTHING to can help more, thanks.

@f9x0
Copy link

f9x0 commented Dec 14, 2023

Hello. OpenGL 3.3 stopped working for me.

"Godot Engine v4.1.3.stable.official.f06b6836a - https://godotengine.org
OpenGL API 3.3.14736 Core Profile Forward-Compatible Context 20.9.1 27.20.12029.1000 - Compatibility - Using Device: ATI Technologies Inc. - AMD Radeon(TM) R2 Graphics"

Godot 4.2 / 4.2.1
"WARNING: Your video card drivers seem not to support the required OpenGL 3.3 version, switching to ANGLE.
at: DisplayServerWindows (platform/windows/display_server_windows.cpp:4668)
OpenGL API OpenGL ES 3.0.0 (ANGLE 2.1.21969 git hash: 9528449a8930) - Compatibility - Using Device: Google Inc. (AMD) - ANGLE (AMD, AMD Radeon(TM) R2 Graphics (0x00009850) Direct3D11 vs_5_0 ps_5_0, D3D11-27.20.12029.1000)"

@clayjohn
Copy link
Member

I just tested the game on Godot 3.5.3 GLES3, ... same results! :(

Same results as GLES2, or same results as 4.2.1? Are you saying that 3.5.3 GLES3 does not work on your device?

The second log line seems to indicate a problem in initializing the GLES3 render.

E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.godotengine.godot4gles3/com.godot.game.GodotApp}: java.lang.IllegalStateException: Unable to initialize engine render view

This is very helpful. This shows that the engine is failing to initialize OpenGL ES 3.0 on your device.

This can mean two things:

  1. Your device doesn't actually support OpenGL ES 3.0 (if that's the case, then we can't do anything) or
  2. We are requesting a configuration that isn't supported by your device.

Given that those benchmarks ran on your device, I am leaning towards it being 2

Your investigation has been very helpful so far, thank you.

@joined72
Copy link
Contributor Author

joined72 commented Dec 14, 2023

I just tested the game on Godot 3.5.3 GLES3, ... same results! :(

Same results as GLES2, or same results as 4.2.1? Are you saying that 3.5.3 GLES3 does not work on your device?

The Godot 3.x GLES3 never run on my devices (I just tested from 3.2.x in 2020 year).
To works I have to setup it as GLES2, in GLES2 my device works fine.

The second log line seems to indicate a problem in initializing the GLES3 render.
E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.godotengine.godot4gles3/com.godot.game.GodotApp}: java.lang.IllegalStateException: Unable to initialize engine render view

This is very helpful. This shows that the engine is failing to initialize OpenGL ES 3.0 on your device.

This can mean two things:

1. Your device doesn't actually support OpenGL ES 3.0 (if that's the case, then we can't do anything) or

2. We are requesting a configuration that isn't supported by your device.

Given that those benchmarks ran on your device, I am leaning towards it being 2

Yes, it is.

Your investigation has been very helpful so far, thank you.

Glad to can help, tell me how can I help more, thanks.

@joined72
Copy link
Contributor Author

Can I suggest to take inspiration from the Godot 3.5.3 GLES2 initialization to make the required changes to the Godot 4.2.1 Compatibility GLES3 initialization?

@Calinou
Copy link
Member

Calinou commented Dec 14, 2023

@f9x0 This is an unrelated issue, and is expected behavior since Godot 4.2. ANGLE is used on old AMD GPUs on Windows because their OpenGL drivers are buggy, so ANGLE is being used to translate OpenGL to Direct3D (since these drivers are much more mature on AMD on Windows).

@joined72
Copy link
Contributor Author

joined72 commented Dec 16, 2023

Through further investigation I discover that until the Godot 3.2 RC1, GLES3 worked really fine on my device, the bug appeared suddenly from the Godot 3.2 RC2. I'm trying to remove any RC2 changes from the source to find the commit that caused this bug. I'll update ASAP.

@marko995
Copy link

@f9x0 This is an unrelated issue, and is expected behavior since Godot 4.2. ANGLE is used on old AMD GPUs on Windows because their OpenGL drivers are buggy, so ANGLE is being used to translate OpenGL to Direct3D (since these drivers are much more mature on AMD on Windows).

@Calinou
Is it possible to translate opengles3 to opengles2?

@joined72
Copy link
Contributor Author

From my point of view the availability of GLES3 on old devices is definitely enough today, I sincerely think that Godot 3.2 and from it to 4.2 too, have some bug in the GLES3 implementation, here I think to have found one and I hope to can found a fix ASAP

@Calinou
Copy link
Member

Calinou commented Dec 17, 2023

Is it possible to translate opengles3 to opengles2?

No, it doesn't work like that. Open GL ES 2.0 is a much more limited API (closer to OpenGL 2.1 while OpenGL ES 3.0 is closer to 3.3).

@Alex2782
Copy link
Contributor

Alex2782 commented Jan 16, 2024

My Internet is stable again. I have added more logs in the last 3 days. logcat_debug_android

It gets stuck here on moto e5 play. Next I would have to debug Vertex and Fragment.

01-16 05:47:49.140: I/godot(13145): BEGIN ShaderGLES3::_compile_specialization
01-16 05:47:49.140: I/godot(13145): vertex stage
01-16 05:47:49.267: I/godot(13145): fragment stage
01-16 05:47:49.398: I/godot(13145): glAttachShader(spec.id, spec.frag_id);
01-16 05:47:49.398: I/godot(13145): glAttachShader(spec.id, spec.vert_id);
01-16 05:47:49.400: I/godot(13145): feedback_count:  0
01-16 05:47:49.400: I/godot(13145): glLinkProgram(spec.id);

@joined72: If you have time then you could check setEGLContextFactory and RegularConfigChooser or RegularFallbackConfigChooser to see why no context can be created. In my branch commented out, but the following 2 lines in it, so that context can be created.

				setEGLConfigChooser(8, 8, 8, 8, 16, 0);
				setEGLContextClientVersion(3);

Note: The call setEGLConfigChooser(8, 8, 8, 8, 16, 0); uses ComponentSizeChooser

@joined72
Copy link
Contributor Author

My Internet is stable again. I have added more logs in the last 3 days. logcat_debug_android

Just updated! :)

@joined72: If you have time then you could check setEGLContextFactory and RegularConfigChooser or RegularFallbackConfigChooser to see why no context can be created. In my branch commented out, but the following 2 lines in it, so that context can be created.

@Alex2782 : I'll try to do my best. In the meantime I observed an error that is presents only in the logcat of not working app...

E Could not load vendor/lib64/egl/libGLES_mali.so from sphal namespace: dlopen failed: library "vendor/lib64/egl/libGLES_mali.so" not found.

Do you think this could be one of the bug causes?

@Alex2782
Copy link
Contributor

logcat.moto.e5.play.txt.zip
I don't know if this library is necessary. On the moto e5 play such an error is not displayed, but the behavior is identical.

arm support forum

@joined72
Copy link
Contributor Author

@Alex2782 I try to change the setEGLContextFactory parameters without success, always same result. I'll continue my tests...

@joined72
Copy link
Contributor Author

joined72 commented Jan 16, 2024

@Alex2782 I asked the Google AI (Bard) to analyze our bug and this is the answer...

I have reviewed the bug report you provided, and I believe that the issue is caused by a bug in the Godot Engine's Shader compiler. The compiler is attempting to optimize the shader code, but it is doing so in a way that is causing the shader to crash.

Here are a few possible solutions to this problem:

Fix the compiler bug: This is the most likely solution, but it will require some effort from the Godot Engine developers.

Disable shader optimization: This is a temporary solution that will prevent the shader from crashing. However, it will also mean that the shader will not be as optimized as it could be.

Manually rewrite the shader: This is a more difficult solution, but it will ensure that the shader does not crash.

I recommend that you report this bug to the Godot Engine developers so that they can fix it. In the meantime, you can try disabling shader optimization or manually rewriting the shader.

What do you think about?

UPDATE: To disable shader caching, go to the Project Settings window and find the Rendering section. Under Shaders, uncheck the Enable shader caching checkbox.

@Alex2782
Copy link
Contributor

Google AI (Bard) / What do you think about?

ChatGPT usually delivers better results, but is often useless for complex and hardware-specific problems,
... like Google Bard 😃


I try to change the setEGLContextFactory parameters without success, always same result. I'll continue my tests...

The parameters must remain the same

works (Context is created):

setEGLConfigChooser(8, 8, 8, 8, 16, 0);
setEGLContextClientVersion(3);

(why) not (?):
What makes ComponentSizeChooser different from RegularConfigChooser + RegularContextFactory? That is what I would have to check later.

setEGLConfigChooser(new RegularConfigChooser(8, 8, 8, 8, 16, 0)));
int[] attrib_list = { EGL_CONTEXT_CLIENT_VERSION, version, EGL10.EGL_NONE };
context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);

@Alex2782
Copy link
Contributor

Alex2782 commented Jan 17, 2024

I have commented out about 400 lines out of 2100 lines in 2 files. A 2D project starts, but rotates incorrectly. (It's ok on my Samsung Tab.)

  • drivers/gles3/shaders/scene.glsl
  • drivers/gles3/shaders/stdlib_inc.glsl
Video: moto e5 play, on Firebase Test Lab
web-build_20240117_rtel_pettyl-27-en_US-portrait_video.mp4

@joined72: If you find time, you could search for //ALEX in the sources, if ShaderCode was commented out, then reactivate it step by step and run it on your hardware until it stops working again. I have deactivated almost all light and shadow functions.

In the Godot ShaderTest project I have deactivated some settings and reduced values. Maybe they are also important.
After 3 seconds, a uniform shader is attached to the nodes. On some smartphones the project crashes only because of uniform (keyword) in the GdShader (but only with vulkan). #79760 (comment)

@joined72
Copy link
Contributor Author

@Alex2782 I have full uncommented the drivers/gles3/shaders/stdlib_inc.glsl file and restored default Project Options and ALL WORKS FINE ;) (except the wrong rotation)... I'm continue working on the drivers/gles3/shaders/scene.glsl file.

@joined72
Copy link
Contributor Author

@Alex2782 I found and fixed the drivers/gles3/shaders/scene.glsl shader bug, you have to change the following function:

float get_omni_spot_attenuation(float distance, float inv_range, float decay) {
	...
	...
	...	
	return nd * pow(max(distance, 0.0001), -decay);
}

in the following one:

float get_omni_spot_attenuation(float distance, float inv_range, float decay) {
	...
	...
	...
	return nd * (1 / pow(max(distance, 0.0001), decay));
}

I don't know WHY but on my device works fine ONLY with this specific change.

@AThousandShips
Copy link
Member

AThousandShips commented Jan 17, 2024

That sounds like a compliance issue with the drivers, as it's supposed to support negative exponents, but as a compatibility fix it makes sense, compensating for broken drivers

As pow(x, y) works when x > 0 or x == 0 && y > 0 which is always true here

@Alex2782
Copy link
Contributor

I found and fixed the drivers/gles3/shaders/scene.glsl shader bug

What error did you fix exactly? Wrong rotation?
I have not commented out this part, glLinkProgram had no problems with it.

@joined72
Copy link
Contributor Author

joined72 commented Jan 17, 2024

I found and fixed the drivers/gles3/shaders/scene.glsl shader bug

What error did you fix exactly? Wrong rotation? I have not commented out this part, glLinkProgram had no problems with it.

Now the app run fine on my device, without freeze and showing the main scene and I can interact with it, the unique remaining bug (on my device) is the Rotation Bug (also with the default Project Options, WORKS FINE)! :)

@Alex2782
Copy link
Contributor

Ok that's strange, I still don't understand this bug. 😄
How did you find the solution? Are the 400 lines I commented out all active again?

I will continue with setEGLConfigChooser, compare why Godot (original sources) can't create a context.

@joined72
Copy link
Contributor Author

I decommented ALL //ALEX comments from both shaders and make the get_omni_spot_attenuation function fix, that's all.

@joined72
Copy link
Contributor Author

joined72 commented Jan 17, 2024

I just updated my git Godot sources to the official 4.3 Dev 2 and trying to run my Test Project with the standard Templates with the same NOT WORKING FREEZE BUG, after I ONLY make the get_omni_spot_attenuation function fix, re-compile the new Android Templates and now ALL WORKS FINE (except the wrong rotation bug).

This is to confirm that this fix works fine also on the official 4.3 Dev 2 sources.

AThousandShips: That sounds like a compliance issue with the drivers, as it's supposed to support negative exponents, but as a compatibility fix it makes sense, compensating for broken drivers

@AThousandShips I guess you're right, it might be that this specific driver didn't implement "negative exponent" on the pow function.

@joined72
Copy link
Contributor Author

About the "Wrong Rotation Bug" seems to be a know bug.

I'm trying to working on it...

@Alex2782
Copy link
Contributor

Alex2782 commented Jan 17, 2024

The bugfix also works on moto e5 play. 👍


About the "Wrong Rotation Bug"

You could try gles3jni (https://github.com/Alex2782/ndk-samples) and compare it with Godot, search for //ALEX comments.

I have reduced the example to 3 objects to see the orientation better. The objects are always displayed at the bottom left on my Samsung Tab S7.

UPDATE: on moto e5 play the 'Portrait' orientation was identical. @joined72

Landscape Portrait
Bildschirmfoto 2024-01-17 um 19 46 29 Bildschirmfoto 2024-01-17 um 19 46 58

@joined72
Copy link
Contributor Author

joined72 commented Jan 18, 2024

About the "Wrong Rotation Bug"

You could try gles3jni (https://github.com/Alex2782/ndk-samples) and compare it with Godot, search for //ALEX comments.

@Alex2782 I don't understand how to use gles3jni to fix the rotation issue, anyway I find the following text in this old bug:

Steps to reproduce:
The following problem appeared to me when stable 3.0 was released.
It worked fine on alpha versions.

So now I'm trying to identify the first 3.0 version where this bug occurs for the first time so to can isolate and fix it.
I'm currently creating a build environment to compile Godot 3.0 sources and templates. I hope this will be a viable solution.

@Alex2782

This comment was marked as outdated.

@joined72
Copy link
Contributor Author

@Alex2782 this bugfix solve also another issue, take a look HERE, do you think would be the time to open a pull request just to apply it in the next stable Godot release while we continue to improve it?

@Alex2782
Copy link
Contributor

https://github.com/godotengine/godot-demo-projects

@joined72
If you have time, could you create a Godot project for testing? Copy the 2D and 3D demos into subfolders that also work on modern hardware with OpenGL, then create a navigation interface to open the main scene of a demo application at the push of a button. But I am not sure if this will work as easy as I imagine.

After that we can create 2 APKs, one version original master branch and one version with the bug fixes, so I think we can compare better.

@joined72
Copy link
Contributor Author

https://github.com/godotengine/godot-demo-projects

@joined72 If you have time, could you create a Godot project for testing? Copy the 2D and 3D demos into subfolders that also work on modern hardware with OpenGL, then create a navigation interface to open the main scene of a demo application at the push of a button. But I am not sure if this will work as easy as I imagine.

OK, I'll try! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.