godot: Strange bug with 3 sprites, where one of them uses gdshader - Android 10
Godot version
4.0, 4.1, 4.1.1
System information
Godot v4.1.1.stable (bd6af8e0e) - Fedora Linux 37 (Workstation Edition) - Vulkan (Mobile) - integrated Intel® Graphics (ADL GT2) () - 12th Gen Intel® Core™ i5-12500H (16 Threads)
Issue description
Hi guys, I am porting circle android jump game from kids can code tutorial using vulkan renderer. I am using an old phone Xiaomi mi a2 (Android 10, it support vulkan 1.0 and gles3.2) I found a strange bug, where I am rendering 3 sprites, two sprites use png, third use png with gdshader. Tested situations:
-
When I hide one of them (nvm which one) everything is working. So, in this case, if there is one sprite with png, and a second with gdshader, everything is working.
-
When I remove gdshader from the sprite, everything is working.
-
When I remove gdshader, but add more sprites, everything is working.
I will send github repo to see details.
I did tests on other phones, like moto g5(android 12) and samsung a52(android 12), and on pc as well, and everything is working. It’s working in compatibility renderer!
logcat: https://pastebin.com/Z8H5tDUQ
Currently, I am trying to build editor and export a template with debugging symbols to find the line where it’s crashing, but I found nothing.
I am open to any suggestions to fix this error because it has very unpredictable behavior.
Steps to reproduce
- Create circle scene, add sprite, and add png.
- Create jumper scene, add sprite, add png and add gdshader on that sprite:
shader_type canvas_item;
uniform vec4 color : source_color;
void fragment() {
COLOR .rgb = color.rgb;
}
- Create main scene, where you add one jumper scene, and two circle scenes.
Minimal reproduction project
I removed all unnecessary files. https://github.com/marko995/CircleJumpGodot4
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 1
- Comments: 44 (25 by maintainers)
I will release a debug APK for it soon, last I checked OpenGL ES3. I found some debug settings in the Godot sources, I still have to try if this is also possible with Vulkan.
@Alex2782 when i press compute once it works but if i press 25 times the app crashes. logcat: https://pastebin.com/fYeKr2c9
But when I pressed Add ShaderMaterial first (or after compute), app crashed instantly. logcat: https://pastebin.com/SFZmHzKT
@Alex2782 crash happens because of this line: uniform vec4 color : source_color;
when I don’t use it, works fine
The issue is present on
4.1.1.stable
and onv4.2.dev2.official [da81ca62a]
;3.5.2
works as expected.I experience a similar issue on Sony Xperia XZ1 Compact running Android 11. I narrowed down the problem to the
uniform
feature. If I hardcode the value, the game no longer crashes.Next week I’ll try to add debug_callback. I can test 5 x per day for free at Firebase on real devices, there are also a lot of virtual ones, which are probably unsuitable because of software renderer.
Firebase - Test Lab has also
Mi A2 Lite
: full logs (search for22258
pid)I have tried with
Validation Layer
, but I can’t see any new useful information yet.ShaderTest.zip
@marko995: if you find the time at some point, please try it out. Are the crashes reproducible? I need a project where I can debug the functions at the push of a button.
global_color_canvas_item.gdshader
->global uniform vec4 global_color;
On my Samsung Galaxy Tab A (2016) SM-T580, there are no problems with the color shaders, but with the compute shader (output = input).
doesn’t work:
it works:
ok thanks, 2 days ago Github showed 404 error (not found), today it works again
For questions regarding godot-compilation I suggest to join the contributors chat at https://chat.godotengine.org/ It is difficult to discuss these things here on Github.