Open marko995 opened 1 year ago
Since only a single device-type shows this problem, it might be hardware-related. That would make it difficult to fix this on the Godot-side.
Since only a single device-type shows this problem, it might be hardware-related. That would make it difficult to fix this on the Godot-side.
Can you help me with debugging? Because same game created in godot 3.5, works in both gles3 and gles2
Can you help me with debugging?
@marko995 i don't believe so, because without the specific device I can't replicate the problem.
yeah, I know, but can you give me guidelines on how to debug the issue? I already tried to build godot editor from source with debugging symbols, but I got same error message :/
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.
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.
The issue is present on 4.1.1.stable
and on v4.2.dev2.official [da81ca62a]
; 3.5.2
works as expected.
3.x is not a Vulkan app, so it could be related to your device's Vulkan drivers, too
Minimal reproduction project: https://github.com/marko995/CircleJumpGodot4 is no longer found
Some bugs have been fixed in the last few weeks, you might be able to test again soon with version 4.2.x or 4.3.
it still crashes
and v4.2.1?
Akien - 13:22 We just released Godot 4.2.1, as the first maintenance update to the 4.2 feature branch.
This version contains the bug fixes that I meant. If not, please upload your project again.
still crashing..kk
@Alex2782 same link https://github.com/marko995/CircleJumpGodot4
@Alex2782 is there any tutorial on how to get better error logs from vulkan driver?
@Alex2782 is there any tutorial on how to get better error logs from vulkan driver?
It doesn't mention specific instructions for enabling Vulkan validation layers on Android. I can find this from a quick search: https://developer.android.com/ndk/guides/graphics/validation-layer
@Alex2782 same link https://github.com/marko995/CircleJumpGodot4
ok thanks, 2 days ago Github showed 404 error (not found), today it works again
@Alex2782 crash happens because of this line: uniform vec4 color : source_color;
when I don't use it, works fine
logcat: https://pastebin.com/Z8H5tDUQ
AudioTrack org.godotengine.game V processAudioBuffer(351): obtainBuffer(882) returned 1772 = 882 + 890 err 0
but in the project I can't find any audio files that are played
You could also try starting an empty 2D project (maybe with only 1 text label, no gdshader) via remote debugging and log everything without filters
adb logcat > logs.txt
(press Ctrl + C
after crash, redirected all logs from the last 2 hours to one file)
@Alex2782 crash happens because of this line: uniform vec4 color : source_color;
when I don't use it, works fine
ok on my Samsung Tab S7 no problems (newer Vulkan version)
problem happens when I use
3 sprites, and one of them use uniform vec4 color : source_color;
if I use 2 sprites, everything works.
Probably the problem is in vulkan driver, because when I use the newer phone, motorola g5, works fine.
strange, and if only COLOR
is not initialized, it also crashes?
void fragment() {
COLOR.rgb = color.rgb;
}
@Alex2782 you didn't understand me :D if I don't use color, and use hardcoded color, it is working
I just wanted to narrow down the error. I understood the rest.😄
problem happens when I use 3 sprites, and one of them use
uniform vec4 color : source_color;
without COLOR.rgb = color.rgb;
, crash or not?
shader_type canvas_item;
uniform vec4 color : source_color;
void fragment() {
}
doesn't work:
shader_type canvas_item;
uniform vec4 color : source_color;
void fragment() {
COLOR .rgb = color.rgb;
}
it works:
shader_type canvas_item;
void fragment() {
COLOR.rgb = vec3(1.0, 0.0, 0.0);
}
the idea is to manipulate colors through material parameter, which is not working.
@Alex2782 is it possible to use source_color
without uniform
?
@Alex2782 also this doesn't work
shader_type canvas_item;
uniform vec3 color : source_color;
void fragment() {
}
yup, problem is in word uniform
:/
this doesn't work as well:
shader_type canvas_item;
uniform vec4 color;
void fragment() {
}
Github: uniform + android 14 issues open.
I still have an old Samsung tablet with Android 8, if I find time I'll try to test it with Godot.
@Alex2782 Ok, but I think this won't be fixed soon :/
@Alex2782 is it possible to use
source_color
withoutuniform
?
Unfortunately, I don't know much about shaders at all, after a short research I couldn't find any examples without "uniform".
There are also compute shaders
, where different uniform types
can be specified via GdScript. Maybe it would also be interesting to catch the errors.
https://docs.godotengine.org/en/stable/tutorials/shaders/compute_shaders.html
# Create a uniform to assign the buffer to the rendering device
var uniform := RDUniform.new()
uniform.uniform_type = RenderingDevice.UNIFORM_TYPE_STORAGE_BUFFER
Samsung Galaxy Tab A (2016) SM-T580, Android 8, armeabi-v7a: no problems with Vulkan and uniform
😃
Vulkan API 1.0.61 - Forward Mobile - Using Vulkan Device #0: ARM - Mali-T830
https://vulkan.gpuinfo.org/ The tablet is so old that there is no information about it, I can't install the gpuinfo app either (arm-v8)
This comparison could perhaps be useful: Samsung Galaxy Tab A (2016, Android 10, arm-v8) vs. Xiaomi Mi A2 Lite https://vulkan.gpuinfo.org/compare.php?reports=10941,9320#extensions
For example, Samsung has these 2 'extensions'. They are also queried by Godot (optional). If I find more time again, I'll try to experiment with the sources.
@Alex2782 If you need device to test it, ping me
@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).
@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 any luck?
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.
Firebase - Test Lab has also Mi A2 Lite
: full logs (search for 22258
pid)
I have tried with Validation Layer
, but I can't see any new useful information yet.
01-06 19:23:09.259: I/godot(22258): _on_timer_timeout
......
01-06 19:23:09.532: I/godot(22258): Shader loaded in 273 ms
......
01-06 19:23:09.587: F/libc(22258): Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 in tid 22746 (VkThread), pid 22258 (com.godot.game)
......
01-06 19:23:09.833: F/DEBUG(23682): ABI: 'arm64'
01-06 19:23:09.835: F/DEBUG(23682): Timestamp: 2024-01-06 19:23:09-0800
01-06 19:23:09.835: F/DEBUG(23682): pid: 22258, tid: 22746, name: VkThread >>> com.godot.game <<<
01-06 19:23:09.835: F/DEBUG(23682): uid: 10160
01-06 19:23:09.835: F/DEBUG(23682): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
01-06 19:23:09.835: F/DEBUG(23682): Cause: null pointer dereference
01-06 19:23:09.835: F/DEBUG(23682): x0 0000000000000000 x1 0000000000000003 x2 0000007810966e80 x3 000000780f7b3058
01-06 19:23:09.836: F/DEBUG(23682): x4 000000783cdb2000 x5 0000000000000000 x6 0000000000000000 x7 0000000000000001
01-06 19:23:09.836: F/DEBUG(23682): x8 0000000000000002 x9 0000000000000001 x10 0000000000000001 x11 0000000000000004
01-06 19:23:09.836: F/DEBUG(23682): x12 00000078156bbef0 x13 0000000000000000 x14 0000000000000000 x15 0000000000000002
01-06 19:23:09.836: F/DEBUG(23682): x16 000000783d62eef8 x17 00000078156db800 x18 00000078204d2000 x19 00000078156db800
01-06 19:23:09.836: F/DEBUG(23682): x20 0000007810966e80 x21 000000789b174d10 x22 0000000000000000 x23 000000789b174a10
01-06 19:23:09.836: F/DEBUG(23682): x24 0000000000000001 x25 000000780f03e100 x26 0000000000000028 x27 0000007843eb8580
01-06 19:23:09.836: F/DEBUG(23682): x28 0000000000000000 x29 000000789b177b70
01-06 19:23:09.836: F/DEBUG(23682): sp 000000789b1740f0 lr 000000789b174a10 pc 00000078195d0004
01-06 19:23:09.829: W/Studio:PollNet(21316): type=1400 audit(0.0:4593): avc: denied { read } for name="stats" dev="proc" ino=4026532884 scontext=u:r:shell:s0 tcontext=u:object_r:proc_qtaguid_stat:s0 tclass=file permissive=0
01-06 19:23:09.844: F/DEBUG(23682): backtrace:
01-06 19:23:09.844: F/DEBUG(23682): #00 pc 00000000000f5004 /vendor/lib64/hw/vulkan.msm8953.so (BuildId: 4059f276877a7a61cc16b085624608be)
01-06 19:23:09.844: F/DEBUG(23682): #01 pc 00000000000a0468 /vendor/lib64/hw/vulkan.msm8953.so (qglinternal::vkCmdDrawIndexed(VkCommandBuffer_T*, unsigned int, unsigned int, unsigned int, int, unsigned int)+232) (BuildId: 4059f276877a7a61cc16b085624608be)
01-06 19:23:09.844: F/DEBUG(23682): #02 pc 00000000019fd5e0 /data/app/com.godot.game-KJNnqiAlqU7OqrGjjechwQ==/lib/arm64/libVkLayer_khronos_validation.so (DispatchCmdDrawIndexed(VkCommandBuffer_T*, unsigned int, unsigned int, unsigned int, int, unsigned int)+156) (BuildId: 74b81aeab8816fc078cb99b8199b6b561a30c09b)
01-06 19:23:09.844: F/DEBUG(23682): #03 pc 00000000017e8e94 /data/app/com.godot.game-KJNnqiAlqU7OqrGjjechwQ==/lib/arm64/libVkLayer_khronos_validation.so (vulkan_layer_chassis::CmdDrawIndexed(VkCommandBuffer_T*, unsigned int, unsigned int, unsigned int, int, unsigned int)+452) (BuildId: 74b81aeab8816fc078cb99b8199b6b561a30c09b)
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.
I'm looking for a shader-related crash and I'm not sure if this issue is about it, because nor the title nor the description explicitly mention a crash.
The title says "strange bug". Then again in the description line:
I found a strange bug, where I am rendering 3 sprites, two sprites use png, third use png with gdshader.
The first and only mention of crash is when trying to fix it:
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.
and in the label: crash
I think it would be clearer to add the words crash in both the title and bug description instead of "strange bug" because it's not clear what the issue is without running the MRP (esp. if it only happens on a certain device).
Anyway, I'll be following the other shader-related crash issues, so this is just to help other users find things more easily.
@hsandt: uniform
crash on some android devices (Xiaomi Redmi 7A, Google Pixel 2 XL)
I've had this on my TODO list for a while, but haven't found enough time to check it out again. I would have to try it on Firebase Test Lab because I don't have the hardware to reproduce it.
maybe only Adreno 5xx affected by the uniform
crash
Is there any update on this crash? I am facing it on Godot version 4.2.1 also which is the latest stable version Device: OnePlus 3
I gave up 3 weeks ago, it takes too much time to test on Firebase (cloud service). I only have Adreno 6xx and 4xx. On Adreno 4xx Godot Vulkan apps do not start at all, the official demo app from Google does, so I will prefer the Adreno 4xx problems first, as long as I don't have Adreno 5xx yet.
Adreno Validation Layer VK_LAYER_ADRENO_debug
(on my Samsung Tab S7 - Adreno 6xx):
RuleBundleDescriptorSets: Developers should avoid making multiple API calls to bind descriptor sets for any draw
operation in a command buffer. Instead, descriptor sets should be bundled into a single API call to bind them.
In primary command buffer [0xb400007059be6040] there is(are) [1] violation(s) to this rule for draw operations.
The first violation occurs in render pass [0xb400007046d17e00] and subpass [0] when [3] calls to bind descriptor
sets happen before the draw command [vkCmdDrawIndexed(0xb400007059be6040, 6, 1, 0, 0, 0)].
I will try it out soon, reduce the vkCmdBindDescriptorSets
calls before vkCmdDrawIndexed
.
@clayjohn: Or do you know if there are good reasons to pass only one VkDescriptorSet
?
// descriptorSetCount = 1
vkCmdBindDescriptorSets(..., ..., ..., p_set_index, 1, &usi->vk_descriptor_set, 0, nullptr);
In the logs I see that after GdShader assignment VkDescriptorSet
is always set for 'Instancing' (SET2
), even for nodes without GdShader.
no crash if all nodes have a uniform
shader.
It looks to me as if the commands have to be executed in the correct order (on Adreno 5xx):
RenderingDeviceGraph::_run_draw_list_command
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(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) 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
uniform vec4 color : source_color;
void fragment() { COLOR .rgb = color.rgb; }