godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.98k stars 20.18k forks source link

Meshes and gizmos are not rendered on Android when using Mobile renderer #87801

Open TacoGuyAT opened 7 months ago

TacoGuyAT commented 7 months ago

Tested versions

System information

Godot v4.2.1.stable - Android Custom ROM RROS-Q-8.7.3-20211222-m1872-Unofficial - Vulkan (Mobile) - integrated Adreno (TM) 616 - SD710 (8 Threads)

Issue description

Godot 4 Mobile renderer seems to not render 3D objects and gizmos for me. Debugger output gets flooded with:

E 0:00:03:0294   render_pipeline_create: vkCreateGraphicsPipelines failed with error 5.
  <C++ Error>    Condition "err" is true. Returning: PipelineID()
  <C++ Source>   drivers/vulkan/rendering_device_driver_vulkan.cpp:2921 @ render_pipeline_create()
E 0:00:03:0294   render_pipeline_create: Condition "!pipeline.driver_id" is true. Returning: RID()
  <C++ Source>   servers/rendering/rendering_device.cpp:2977 @ render_pipeline_create()
E 0:00:03:0295   _generate_version: Condition "pipeline.is_null()" is true. Returning: RID()
  <C++ Source>   servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61 @ _generate_version()
E 0:00:03:0295   draw_list_set_push_constant: This render pipeline requires (0) bytes of push constant data, supplied: (16)
  <C++ Error>    Condition "p_data_size != dl->validation.pipeline_push_constant_size" is true.
  <C++ Source>   servers/rendering/rendering_device.cpp:3590 @ draw_list_set_push_constant()
E 0:00:03:0295   draw_list_draw: No render pipeline was set before attempting to draw.
  <C++ Error>    Condition "!dl->validation.pipeline_active" is true.
  <C++ Source>   servers/rendering/rendering_device.cpp:3609 @ draw_list_draw()

Screenshot_20240201-013103127 Screenshot_20240201-000906825

When comparing RenderDoc captures to PC (both using Mobile renderer), the first render pass is empty on Android, while the rest seems to be fine: image

Mobile: Screenshot_20240131-231522760 PC: image

Steps to reproduce

Launch any Godot game or editor

Minimal reproduction project (MRP)

N/A

clayjohn commented 7 months ago

Could you post the full error output from running this on 4.2.1?

With these errors it's usually the first few errors that are the most helpful so it would be good to see which ones happen first.

TacoGuyAT commented 7 months ago

Could you post the full error output from running this on 4.2.1?

Do you mean some specific log file? The only thing I see is these logs in the editor (on Android)/debugger (on PC) output, which is this single error repeating over and over. Here's start of the logs: image

System log also shows this shader compilation error (which could be it, I guess?):

02-01 06:30:16.568 16866 19432 I Adreno  : Shader compilation failed for shaderType: 0
02-01 06:30:16.568 16866 19432 I Adreno  : Info log: 'ReflectionProbeData' : the number of ubo/ssbo exceeds limit 
02-01 06:30:16.568 16866 19432 I Adreno  : 
02-01 06:30:16.568 16866 19432 E godot   : USER ERROR: vkCreateGraphicsPipelines failed with error 5 for shader 'SceneForwardMobileShaderRD:0'.
02-01 06:30:16.568 16866 19432 E godot   :    at: render_pipeline_create (drivers/vulkan/rendering_device_vulkan.cpp:6534)
02-01 06:30:16.568 16866 19432 E godot   : USER ERROR: Condition "pipeline.is_null()" is true. Returning: RID()
02-01 06:30:16.568 16866 19432 E godot   :    at: _generate_version (servers/rendering/renderer_rd/pipeline_cache_rd.cpp:61)
02-01 06:30:16.568 16866 19432 E godot   : USER ERROR: This render pipeline requires (0) bytes of push constant data, supplied: (16)
02-01 06:30:16.568 16866 19432 E godot   :    at: draw_list_set_push_constant (drivers/vulkan/rendering_device_vulkan.cpp:7447)
02-01 06:30:16.568 16866 19432 E godot   : USER ERROR: No render pipeline was set before attempting to draw.
02-01 06:30:16.568 16866 19432 E godot   :    at: draw_list_draw (drivers/vulkan/rendering_device_vulkan.cpp:7464)

It repeats before each of vkCreateGraphicsPipelines error 5

clayjohn commented 7 months ago

Can you try changing the rendering/limits/cluster_builder/max_clustered_elements project setting to 32?

I think it might help

Calinou commented 7 months ago

Android versions below 9.0 have pretty broken Vulkan support (regardless of GPU), so it's possible that not much can be done about this. It may be possible to have a workaround that works for 2D only (or 3D without working reflections), still.

TacoGuyAT commented 7 months ago

Android versions below 9.0 have pretty broken Vulkan support

Oh, it's running Android 10. I didn't noticed when copying, but ROM name from Godot's info doesn't contain Android version, huh. By the way, Q in RROS-Q stands for version 10, which are official Android codenames.

Can you try changing the rendering/limits/cluster_builder/max_clustered_elements project setting to 32?

I think it might help

Nope, still the same

TacoGuyAT commented 6 months ago

After some experiments I was able to kinda launch the engine. Some Vulkan apps worked fine for me, but I've found out that the reason why these worked for me is because they ship Freedreno driver directly inside an app: https://github.com/PojavLauncherTeam/PojavLauncher/blob/v3_openjdk/app_pojavlauncher/src/main/jniLibs/arm64-v8a/libvulkan_freedreno.so

So while original ROM & custom ROM drivers both seem to fail on this exact spot, Mesa/Turnip/Freedreno (v23.0.4) one shows this in the editor: image image

Standalone games work better, but still lots of problems, though that might also intersect with Freedreno issues too: (Mobile, white and green squares are on-screen controls) image (PC, intended look) image