Fix reporting external resource loading progress #75644
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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