-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
texture atlas example: mark each loaded image as CPU persistent #11202
Conversation
Hmm, this is kinda an unfortunate example. If we were loading sprites individually, we could use load_with_settings() and specify the persistence policy in the loader settings. Not really possible with the folder API... We could configure meta files per sprite, but in this case I suppose this is the best way. Really though, we should be able to still access the sprites the first frame they're loaded. So I'm not sure we need to Keep them anyways. Perhaps the asset event is getting sent a frame later? |
Would a |
Load folder is untyped, as it can load multiple different types of assets at once. I suppose we could restrict the with_settings variant to only load one type of asset, and skip the others. |
frame 1
frame 2
frame 3
frame 4:
|
Can you simply add each image as it finishes loading, instead of all at once at the end? |
This fixes the example, but shouldn't we do something for texture atlases in general? Having the user manually mark all their images as persistent feels hacky. |
We could default to Keep for anything not loaded through the GLTF loader I suppose 🤔 . |
My personal opinion is that everything should be |
# Objective - Since #10520, assets are unloaded from RAM by default. This breaks a number of scenario: - using `load_folder` - loading a gltf, then going through its mesh to transform them / compute a collider / ... - any assets/subassets scenario should be `Keep` as you can't know what the user will do with the assets - android suspension, where GPU memory is unloaded - Alternative to #11202 ## Solution - Keep assets on CPU memory by default
# Objective - Since bevyengine#10520, assets are unloaded from RAM by default. This breaks a number of scenario: - using `load_folder` - loading a gltf, then going through its mesh to transform them / compute a collider / ... - any assets/subassets scenario should be `Keep` as you can't know what the user will do with the assets - android suspension, where GPU memory is unloaded - Alternative to bevyengine#11202 ## Solution - Keep assets on CPU memory by default
# Objective - Since bevyengine#10520, assets are unloaded from RAM by default. This breaks a number of scenario: - using `load_folder` - loading a gltf, then going through its mesh to transform them / compute a collider / ... - any assets/subassets scenario should be `Keep` as you can't know what the user will do with the assets - android suspension, where GPU memory is unloaded - Alternative to bevyengine#11202 ## Solution - Keep assets on CPU memory by default
# Objective - Since bevyengine#10520, assets are unloaded from RAM by default. This breaks a number of scenario: - using `load_folder` - loading a gltf, then going through its mesh to transform them / compute a collider / ... - any assets/subassets scenario should be `Keep` as you can't know what the user will do with the assets - android suspension, where GPU memory is unloaded - Alternative to bevyengine#11202 ## Solution - Keep assets on CPU memory by default
# Objective - Since bevyengine#10520, assets are unloaded from RAM by default. This breaks a number of scenario: - using `load_folder` - loading a gltf, then going through its mesh to transform them / compute a collider / ... - any assets/subassets scenario should be `Keep` as you can't know what the user will do with the assets - android suspension, where GPU memory is unloaded - Alternative to bevyengine#11202 ## Solution - Keep assets on CPU memory by default
Objective
texture_atlas
crashes:Solution