-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Remove labeled_assets
from LoadedAsset
and ErasedLoadedAsset
#15481
base: main
Are you sure you want to change the base?
Conversation
labeled_assets
from labeled_assets
from LoadedAsset
and ErasedLoadedAsset
ce7c284
to
8cc63f6
Compare
Just to make it clear what the rationale for this is. This makes implementing asset saving easier, since we don't need to deal with recursive types. We just have to borrow the root assets, and borrow the subassets and we're done. Without this PR, for each subasset, we'd need to create a new type like |
8cc63f6
to
27d20ba
Compare
Rebased after #15509. Nothing really affected. |
6ec0177
to
547a3df
Compare
Rebased since this PR was a little stale. I folded in the accidental doc comment fix into the first commit. |
This makes it clear that loaded assets are not recursive.
…"root" asset. Now that subassets can't have nested subassets, we can completely remove the `TransformedSubasset` type and just return a mutable borrow. It is now up to the asset to know how to link up the subassets.
This makes it much clearer when we access `complete_asset.asset` as opposed to `asset.asset` or `loaded_asset.asset`.
547a3df
to
7a97f0a
Compare
Rebase after #15487 was merged, fairly trivial overall. This also had the funny side-effect that I could remove an |
Objective
Fixes #15417.
Solution
labeled_assets
fields fromLoadedAsset
andErasedLoadedAsset
.CompleteLoadedAsset
andCompleteErasedLoadedAsset
to hold thelabeled_subassets
.LoadContext::finish
ed, it produces aCompleteLoadedAsset
.CompleteLoadedAsset
is added to aLoadContext
(as a subasset), theirlabeled_assets
are merged, reporting any overlaps.One important detail to note: nested subassets with overlapping names could in theory have been used in the past for the purposes of asset preprocessing. Even though there was no way to access these "shadowed" nested subassets, asset preprocessing does get access to these nested subassets. This does not seem like a case we should support though. It is confusing at best.
Testing
Migration Guide
LoadedAsset
andErasedLoadedAsset
should be replaced withCompleteLoadedAsset
andCompleteErasedLoadedAsset
respectively.