-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Internal rewrite of bevy_asset with slight api changes. #272
Conversation
If we want to support web we likely will need async loading. |
Are you aware of #26 and the ongoing discussion about possibly adopting atelier-assets? |
@StarArawn Good point, it probably should stay in. @erlend-sh I didn't! atelier-assets looks good, if a little complex. Would be great to see what @cart thinks about it. |
The Scenes focus area also intentionally includes Asset features that will force us to make a decision about atelier-assets. The changes in this pr all seem like nice iterative improvements to the current system, but I don't want to go too far down the rabbit hole of making the current system better, when we might throw it all away 😄 |
Okay, cool, I'll close this then. |
Cool. Lets remember that this is here and we can pick it up if / when the time comes 😄 Thanks! |
These changes started as an async (async as in an async runtime) rewrite of the bevy_asset crate. During that process, I removed
AssetLoadRequestHandler
, redesigned howAssetLoaders
are stored and accessed, and changed thebevy_asset
api slightly, making it a little more typesafe and consistent. In the end, I removed the async runtime because async filesystem io isn't actually async and instead added arayon::ThreadPool
to do work in the background. Since the threadpool is isolated from the global pool, it should be alright to run io jobs on it. It would be easy enough to add back support for "async", but I don't think it's really that useful in this case.The most notable api change is that
AssetLoader
now hasAsset
as an associated type, rather than as a type parameter. I think this is better, but I may be able to find a way to change it back if preferred.