From 8234978ab04575fcc3661c6a0254dceca586754a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Wed, 28 Feb 2024 01:39:49 +0100 Subject: [PATCH] add note about unloading assets from ram in wasm (#12166) # Objective - Fixes #12057 ## Solution - Add a note about memory management in Wasm --- crates/bevy_render/src/render_asset.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/bevy_render/src/render_asset.rs b/crates/bevy_render/src/render_asset.rs index 3eb0d2f0b610e..ebb3e717e1654 100644 --- a/crates/bevy_render/src/render_asset.rs +++ b/crates/bevy_render/src/render_asset.rs @@ -66,6 +66,13 @@ bitflags::bitflags! { /// /// If you have an asset that doesn't actually need to end up in the render world, like an Image /// that will be decoded into another Image asset, use `MAIN_WORLD` only. + /// + /// ## Platform-specific + /// + /// On Wasm, it is not possible for now to free reserved memory. To control memory usage, load assets + /// in sequence and unload one before loading the next. See this + /// [discussion about memory management](https://github.com/WebAssembly/design/issues/1397) for more + /// details. #[repr(transparent)] #[derive(Serialize, TypePath, Deserialize, Hash, Clone, Copy, PartialEq, Eq, Debug)] pub struct RenderAssetUsages: u8 {