godotengine / godot

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

New Vulkan errors in Godot 4.3 when rendering Billboard enabled AnimatedSprite3D on specific Android device #96300

Open lrasomattos opened 2 months ago

lrasomattos commented 2 months ago

Tested versions

Reproducible in: 4.3.stable, 4.3.rc1 Not reproducible in: 4.3.beta3, 4.3.beta2, 4.3.beta1, 4.2.stable

System information

Device: Moto G84, OS: Android 14, Renderer: Vulkan (Mobile Renderer), GPU: Adreno 619

Issue description

After updating from Godot 4.2.stable to 4.3.stable, one of our developers experienced a significant performance drop on their device (Moto G84), resulting in a very low frame rate. This issue was not present in version 4.2.stable. Upon investigation, we found the following error messages repeatedly appearing in the debugger:

E 0:00:08:0275   render_pipeline_create: vkCreateGraphicsPipelines failed with error -13.
  <C++ Error>    Condition "err" is true. Returning: PipelineID()
  <C++ Source>   drivers/vulkan/rendering_device_driver_vulkan.cpp:4596 @ render_pipeline_create()

E 0:00:08:0275   render_pipeline_create: Condition "!pipeline.driver_id" is true. Returning: RID()
  <C++ Source>   servers/rendering/rendering_device.cpp:3317 @ render_pipeline_create()

E 0:00:08:0275   _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:08:0275   draw_list_bind_render_pipeline: Parameter "pipeline" is null.
  <C++ Source>   servers/rendering/rendering_device.cpp:3840 @ draw_list_bind_render_pipeline()

E 0:00:08:0275   draw_list_draw: The vertex format used to create the pipeline does not match the vertex format bound.
  <C++ Error>    Condition "dl->validation.pipeline_vertex_format != dl->validation.vertex_format" is true.
  <C++ Source>   servers/rendering/rendering_device.cpp:4058 @ draw_list_draw()`

By testing previous versions of Godot, we found that this error occurs starting from version 4.3.rc1 but not in earlier versions, such as 4.3.beta3. We also detected that the issue specifically arises when rendering AnimatedSprite3D objects with Billboard enabled in our game.

Given the Moto G84's specifications, it should be able to handle our project without issues. So this could potentially be related to Vulkan compatibility with the device's GPU (Adreno 619).

Steps to reproduce

Please note that this issue has only been observed on one specific device (Moto G84), and we are not entirely confident about the reproduction steps' general applicability. But it's been occurring consistently in our tries, even when building the project on different machines and project settings. Nevertheless, here are the steps to reproduce the issue:

  1. Create a new scene in Godot.
  2. Set this new scene as the Main Scene.
  3. Add an AnimatedSprite3D node.
  4. Set the AnimatedSprite3D's flag Billboard to "enabled"
  5. Assign a new SpriteFrames resource to the AnimatedSprite3D. (it needs something to be rendered)
  6. Add the Godot Icon as one of the frames in the SpriteFrames.
  7. Add a Camera3D node to the scene.
  8. Position the Camera3D so that the AnimatedSprite3D is visible.
  9. Configure the project for Android export.
  10. Run the project with Remote Debugging enabled and check for the error messages in the Debugger.

Minimal reproduction project (MRP)

bug_reproduction.zip

akien-mga commented 2 months ago

Relevant changes in 4.3-rc1: https://godotengine.github.io/godot-interactive-changelog/#4.3-rc1

CC @godotengine/rendering @Alex2782

Alex2782 commented 2 months ago

I could not reproduce it on my Adreno devices, but on 3 out of 17 tested devices on Firebase Test Lab. Maybe it has something to do with Android 14.

vkCreateGraphicsPipelines failed with error -13 -> VK_ERROR_UNKNOWN = -13

Could you perform bisecting regressions? @lrasomattos

https://downloads.tuxfamily.org/godotengine/4.3/ Unfortunately, I don't see any README.txt files there to determine commit hashes. Are there any other options? @akien-mga


Godot Engine v4.3.stable.official, not reproducible on:


Tests on Firebase Test Lab -------------- OK on 13 devices (Adreno 7xx, Mali, Android 10 - 14) -------------------------------- ### vkCreateGraphicsPipelines failed with error -13 - OnePlus Nord CE3 Lite, `Adreno (TM) 619` - Android 14, Vulkan 1.1.128 - Galaxy A52s, `Adreno (TM) 642L` - Android 14, Vulkan 1.1.128 - XQ-DC54, `Adreno (TM) 619` - Android 14, Vulkan 1.1.128 ``` 08-30 17:30:21.471 22713 23252 E godot : USER ERROR: vkCreateGraphicsPipelines failed with error -13. 08-30 17:30:21.471 22713 23252 E godot : at: render_pipeline_create (drivers/vulkan/rendering_device_driver_vulkan.cpp:4596) 08-30 17:30:21.471 22713 23252 E godot : USER ERROR: Condition "!pipeline.driver_id" is true. Returning: RID() 08-30 17:30:21.471 22713 23252 E godot : at: render_pipeline_create (servers/rendering/rendering_device.cpp:3317) ``` - moto g(30), `Adreno (TM) 610` - Android 11, Vulkan 1.1.128 ``` 08-30 17:31:42.450 8624 8980 E godot : USER ERROR: Condition "err != VK_SUCCESS && err != VK_SUBOPTIMAL_KHR" is true. Returning: FAILED 08-30 17:31:42.451 8624 8980 E godot : at: command_queue_execute_and_present (drivers/vulkan/rendering_device_driver_vulkan.cpp:2344) 08-30 17:31:42.455 8624 8624 V Godot : OnStop: GodotFragment{3802ae6} (e1970d34-27e0-4f12-8f17-61f8589595c7 id=0x7f070033) 08-30 17:31:42.460 8624 8624 D LifecycleMonitor: Lifecycle status change: com.godot.game.GodotApp@98e6337 in: STOPPED 08-30 17:31:42.475 8624 8624 V GodotActivity: Destroying GodotActivity com.godot.game.GodotApp@98e6337... 08-30 17:31:42.495 8624 8624 V Godot : OnDestroy: GodotFragment{3802ae6} (e1970d34-27e0-4f12-8f17-61f8589595c7 id=0x7f070033) ``` Maybe this error can be ignored because of “Gametime” onboarding dialog. `moto g(30)` ![web-build_20240831_29zm_caprip-31-en_US-portrait_artifacts_1](https://github.com/user-attachments/assets/f6aa26dc-436b-457e-960e-fbdbf91e9a3c) -------------------------
lrasomattos commented 2 months ago

Hi! Thanks for jumping on this so quickly!

Could you perform bisecting regressions? @lrasomattos

Unfortunately, we don’t have direct access to the device that's having the issue. And the person who does isn’t on the tech side - and tbh I'm not used to this as well - so coordinating the regression tests and creating an MRP with them has been pretty tough. With a deadline approaching, I don't think I’ll be able to tackle this right now. That said, thanks for the link, I'm new to all this, so I learned quite a bit in there.

Meanwhile, I’m thinking of using a simple "look at camera" script as a quick workaround instead of enabling Billboard. Hopefully, I can get back to this later when things calm down a bit.