mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 21:03:47 -10:00
* RM0: each App's meshes and images, CPU and GPU bytes, after every RAEA_MEM_MARKS mark (raea-sys-memtally); docs/render-memory.feature RM0-RM4 * RM1-RM10: halcyon r109's sequence from killed at 24-25 GB to a 7.8 GB peak (footprint 5.5 GB), the look within run-to-run noise - RM1: materials' maps and Solari's traced meshes on the GPU only (RAEA_KEEP_CPU_ASSETS=1: the control) - RM2: a sequence's first 3D engine let go before a second opens - RM5: JS solids deduplicated by expression, their Manifolds in a two-generation cache (192 MB each); solid.free - RM6: a map whose picture changes by frame is one part and one material, its picture swapped as frames show it (raea-sys-material swapped.rs): the pool's 96 water maps were 96 meshes and 186 textures - RM7: Manifold shapes welded into indexed meshes (4.65 corners a vertex in halcyon; RAEA_NO_WELD=1: the control); a held frame settles to the same picture, boiling 0.30% against 0.38% - the shape text kept out of the store and the Edit (the engine spawns from the program's rows) - RM8: a BufferMesh of 64 KB or more kept on disk by its content (buffer:@NAME, raea's caches/buffers): shape text 274 MB -> 11.8 MB - RM9: material maps as BC7 with their mips (intel_tex_2), cached by content in raea's caches/maps, any size resampled to whole blocks (RAEA_NO_BC=1: the control): GPU images 733 MB -> 282 MB - RM10: raea-sys-contact's solids as bytes, a count and u16 surface points: 1.27 GB -> 0.37 GB mid-render - memtally names the biggest GPU images; RAEA_MEM_MARKS prints the program's text by column and shape call - tools/memprobe: memseq, heapwho/heapseq (malloc stack logging, holders.py), abenv/abseq/steadyab (A/B on one binary) docs/render-memory.feature has each step's numbers and gates. * raea-sys-memtally in tools/layers.toml: a system, as the layers gate asks * Size: render-memory's eight over-limit crates and files allowed once at today's sizes (Shane 11-29, for 0.1.13): the folders hold other lanes' uncommitted GI/RT work, so they're split once that lands * Fold render-memory's copies into what they copied (the dupes gate, 297/60 back to 293/57): one two-generation cache, raea_core_shape::Generations, for core/shape's meshes and runtime/calls' built Manifolds; swapped maps load their pictures with maps.rs's panel_picture; raea_io_home::write_whole for a file written whole or not at all (the BC7 maps first); spawn_sig(it, swapped) one function, its callers saying which; the store's spawn given its columns. Size allowances taken down to the folded sizes (solid.rs is back under 500) * Split the five crates render-memory took past 2000 lines, each where it parts cleanly, so the next lane has room (the size and rask gates; the one-time allowance is gone): - raea-core-tables (core/tables): a row's per-frame tables, from raea-sys-frame (re-exported there as tables) - raea-runtime-ecs (runtime/ecs): raea/ecs on Bevy's ECS, from raea-runtime-calls (ecs.rs re-exports it) - raea-sys-toon (systems/toon): toon surfaces and outlines, from raea-sys-material; its shaders keep the embedded path compositions name (raea_sys_material/toon.wesl) - raea-render-plugins (engine/render/plugins): RaeaPlugins, from raea-render (engine.rs re-exports it as raea_plugins; the imports only it used are gone) - raea-runtime-kinds (runtime/kinds): the rows of models, panels, decals, plates, fog, fire, splats, mesh sequences and grass, with placement and name_column, from raea-runtime-scene maps.rs's inline and panel pictures move to maps/pictures.rs (re-exported, 422 lines left) * Engine::open_in: a live engine (re)opened in its slot, the one there let go first (RM2 in one place, docs/render-memory.feature). raea-runtime-export's five opens go through it, so a fed render stepped again in the page's box keeps its AOVs as its first engine did; aov_on takes the engine in place. raea-runtime-export is back under its planned 2000 (LT1 and LX6 hold the rest) * Drop the dependencies render-memory's splits left behind (cargo shear, CI's unused-dependencies gate): raea-render's eleven systems crates went with RaeaPlugins to raea-render-plugins, raea-runtime-calls's bevy with raea/ecs to raea-runtime-ecs, raea-sys-material's raea-core-shape with toon to raea-sys-toon. raea-render's cargo-shear ignore goes too: spawn.rs reads a mesh buffer through raea_core_shape::buffer_json now --------- Co-authored-by: shinyobjectz <[email protected]>
50 lines
2.5 KiB
Rust
50 lines
2.5 KiB
Rust
//! A composition's frames read from React in Bevy: the page's holders and 3D parts (read.rs, holders.rs), stepping to a
|
|
//! frame (settle.rs), the 3D drawn in an App (ScenePlugin in plugin.rs), and the native calls a
|
|
//! composition makes for its scene, physics and matchmove. raea-runtime-export renders the frames to files.
|
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
use bevy::prelude::*;
|
|
use serde_json::{Map, Value};
|
|
|
|
use crate::{ReactKind, ReactOutbox, ReactProps};
|
|
pub use raea_runtime_bundle::*;
|
|
pub use raea_core_scene::{Node3, hex_of, num, see_through};
|
|
|
|
/// A composition bundled (raea_runtime_bundle), its folder first named as where its models' calls read from
|
|
pub fn bundle_composition(tsx: &Path, out_js: &Path, o: &CompOpts, portable: Option<&Path>) -> R<()> {
|
|
#[cfg(feature = "ml")]
|
|
crate::native::ml::set_dir(tsx.parent().unwrap());
|
|
raea_runtime_bundle::bundle_composition(tsx, out_js, o, portable)
|
|
}
|
|
|
|
pub use raea_runtime_scene::{LiveScene, Shot};
|
|
// `raea scene lint|explain|light` and the scene.* native calls (place() stands models on surfaces with scene.bounds),
|
|
// over raea-sys-contact and raea-sys-light-meter
|
|
mod contact;
|
|
|
|
mod read;
|
|
pub(crate) use read::*;
|
|
mod settle;
|
|
pub use settle::*;
|
|
mod holders;
|
|
pub use holders::*;
|
|
mod plugin;
|
|
pub use plugin::*;
|
|
pub(crate) use contact::register as register_scene;
|
|
// physics for compositions: rigid bodies (Rapier), parts cut from a glTF, goo (tools/goo): systems/bake, as native calls in scene/physics.rs
|
|
pub mod physics;
|
|
// matchmove: `track` and the matchmove.solve native call (raea-runtime-track)
|
|
pub use raea_runtime_track as track;
|
|
|
|
thread_local! {
|
|
/// each part's data-props as last parsed: its text and the props, and the scene it was last read in
|
|
static PROPS3D: std::cell::RefCell<bevy::ecs::entity::EntityHashMap<(String, std::sync::Arc<Map<String, Value>>, u64)>> = std::cell::RefCell::new(Default::default());
|
|
/// each part's data-3d and data-shape as last read, shared
|
|
static NAMES3D: std::cell::RefCell<bevy::ecs::entity::EntityHashMap<(std::sync::Arc<str>, Option<std::sync::Arc<str>>, Option<(usize, u64)>)>> = std::cell::RefCell::new(Default::default());
|
|
/// each part's data-at (an <Instances>' placements) as last read, shared while its text is the same (issue 84)
|
|
static AT3D: std::cell::RefCell<bevy::ecs::entity::EntityHashMap<std::sync::Arc<str>>> = std::cell::RefCell::new(Default::default());
|
|
/// scenes read (scene_of): what's in PROPS3D but not read in the last two is let go
|
|
static SCENE3D: std::cell::Cell<u64> = const { std::cell::Cell::new(0) };
|
|
}
|