Skip to content

Commit

Permalink
add note about unloading assets from ram in wasm (#12166)
Browse files Browse the repository at this point in the history
# Objective

- Fixes #12057 

## Solution

- Add a note about memory management in Wasm
  • Loading branch information
mockersf authored Feb 28, 2024
1 parent 35cec8b commit 6f849d3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/bevy_render/src/render_asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6f849d3

Please sign in to comment.