Skip to content
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

Fix reporting external resource loading progress #75644

Conversation

maximkulkin
Copy link
Contributor

When loading resources without using subthreads, what you usually observe is progress always reported as zero up until it is fully loaded when it is reported as 1. The reason for that is if your scene has significant amount of external resources (e.g. meshes), neither text nor binary resource format loaders report progress on external resources. If using sub threads to load resources in parallel, the overall progress is computed as average progress on all subthreads scaled to half + progress on main loading thread also scaled to half. So that means that with sub thread loading main thread should only report progress for internal resources (subresources) and not external ones. But this is not the case when loading everything in one thread: in that case progress on external resources has to be accounted and reported.

This patch fixes load progress reporting for case when not using sub threads.

Fixes #56882

@maximkulkin maximkulkin requested a review from a team as a code owner April 4, 2023 10:53
@YuriSizov YuriSizov added this to the 4.1 milestone Apr 5, 2023
@akien-mga
Copy link
Member

Superseded by #74405. Thanks for the contribution nonetheless!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResourceLoader load_threaded_get_status progress: Array = [] is always [0]
3 participants