-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Threaded resource loading can still cause stutters #80770
Comments
The RenderingServer is single-threaded. What this and the other issue have imo in common is the misunderstanding what the Resourceloader threaded can help with. The Resourceloader threaded can only help with stutters caused by IO loading. The Resourceloader threaded can not help with stutters caused by server setup, e.g. a single-threaded RenderingServer that is stalled and takes too long to setup a new 4k texture. E.g. if you load a 3D character mesh with full assets like materials and 4k texture in Godot with background threads you are guaranteed to have unsolvable runtime stutters because the RenderingServer can not handle this setup in time after the threaded loading was finished as the servers have no time sliced setups for heavy assets. |
I thought there were a few threading improvements that should make it possible to avoid such issues. E.g. this PR #45852 |
Unfortunately this is still relevant in 4.2 beta 5, |
Still relevant on 4.2.2 stable My workaround is using load in a thread instead:
|
Godot version
4.2 dev3
System information
Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 (NVIDIA; 30.0.15.1403) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)
Issue description
I have a title screen with some big animation divided into multiple spritesheets. Only the first spritesheet is loaded with the scene, for other spritesheets I used threaded loading to make loading faster and also avoid stutters. Unfortunately it doesn't seem to help.
ResourceLoader.load_threaded_get(current_loaded_texture)
specifically causes stutters (I do check forTHREAD_LOAD_LOADED
).I attached MRP that displays the issue quite clearly. It's best observed in a non-dev build.
I think #79117 is similar, but it mentions
load_threaded_request()
instead.Steps to reproduce
use_textures
load_threaded_get()
is no longer called and the animation is smoothMinimal reproduction project
https://ufile.io/4ndknuqp
(the project was too big for direct upload)
The text was updated successfully, but these errors were encountered: