Skip to content

Commit 8234978

Browse files
committed
add note about unloading assets from ram in wasm (#12166)
# Objective - Fixes #12057 ## Solution - Add a note about memory management in Wasm
1 parent faa1387 commit 8234978

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/bevy_render/src/render_asset.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ bitflags::bitflags! {
6666
///
6767
/// If you have an asset that doesn't actually need to end up in the render world, like an Image
6868
/// that will be decoded into another Image asset, use `MAIN_WORLD` only.
69+
///
70+
/// ## Platform-specific
71+
///
72+
/// On Wasm, it is not possible for now to free reserved memory. To control memory usage, load assets
73+
/// in sequence and unload one before loading the next. See this
74+
/// [discussion about memory management](https://github.com/WebAssembly/design/issues/1397) for more
75+
/// details.
6976
#[repr(transparent)]
7077
#[derive(Serialize, TypePath, Deserialize, Hash, Clone, Copy, PartialEq, Eq, Debug)]
7178
pub struct RenderAssetUsages: u8 {

0 commit comments

Comments
 (0)