godotengine / godot

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

Vulkan Mobile: Baking lightmaps on Android causes the editor to crash #77001

Open Booklight12 opened 1 year ago

Booklight12 commented 1 year ago

Godot version

4.02

System information

Android, Guet 8100

Issue description

As the title suggests, light baking is not stable on Android and will generate a lot of errors, which may cause the device to restart if the project is too complicated. I suspect it may have something to do with a drive or memory leak. (Please run the upload example on Android, then click gi's Light Bake button several times, you will see a lot of errors, note that doing this on a phone with less than 6GB of RAM may cause a reboot!!)

Steps to reproduce

null

Minimal reproduction project

this

Bugsquad edit: exc.zip (MRP uploaded directly here, to prevent link rot)

Booklight12 commented 1 year ago

Screenshot_2023-05-12-20-03-46-828_org godotengine editor v4

Booklight12 commented 1 year ago

You can try adding a few more objects in your project and adding more complex shaders and see what happens (note that it may cause the device to reboot!!).

Calinou commented 1 year ago

Compute shaders are pretty broken on mobile due to bugs in graphics drivers which we have no control over. However, compute shaders are required to use the GPU-based lightmapper in Godot 4.x (unlike Godot 3.x which uses a CPU-based lightmapper). We should probably disallow baking lightmaps in the mobile editor as it will generally not work in practice.

I guess this is another use case for https://github.com/godotengine/godot-proposals/issues/3921, although baking lightmaps on a mobile device is expected to be very slow in any case (regardless if you use the CPU or GPU to do so).