pub struct AssetRegistry { /* private fields */ }Expand description
Static mesh/material registry. IDs are typed by separate arenas and generations. Geometry is immutable; deleting a registry entry does not invalidate already prepared frames.
Implementations§
Source§impl AssetRegistry
impl AssetRegistry
Sourcepub fn new(limits: AssetLimits) -> Result<Self, RenderError>
pub fn new(limits: AssetLimits) -> Result<Self, RenderError>
Initialize explicit per-registry limits; no file/network access or GPU allocation.
Sourcepub fn managed_bytes(&self) -> u64
pub fn managed_bytes(&self) -> u64
Accounted CPU payload, including prepared frames and retired shared assets.
Sourcepub fn register_mesh(
&mut self,
vertices: Vec<MeshVertex>,
indices: Vec<u32>,
) -> Result<ResourceId, RenderError>
pub fn register_mesh( &mut self, vertices: Vec<MeshVertex>, indices: Vec<u32>, ) -> Result<ResourceId, RenderError>
Retain validated static triangles. Both Vec capacities are checked/accounted, not just length.
Sourcepub fn register_material(
&mut self,
color: [f32; 4],
) -> Result<ResourceId, RenderError>
pub fn register_material( &mut self, color: [f32; 4], ) -> Result<ResourceId, RenderError>
Register finite linear RGBA in 0..1; no implicit clamping or textures in this profile.
Sourcepub fn remove_mesh(&mut self, id: ResourceId) -> Result<(), RenderError>
pub fn remove_mesh(&mut self, id: ResourceId) -> Result<(), RenderError>
Remove registration; payload reservation remains until its last prepared owner drops.
Sourcepub fn remove_material(&mut self, id: ResourceId) -> Result<(), RenderError>
pub fn remove_material(&mut self, id: ResourceId) -> Result<(), RenderError>
Remove material registration without invalidating already prepared frames.
Sourcepub fn prepare(
&self,
snapshot: SceneSnapshot,
) -> Result<PreparedScene, RenderError>
pub fn prepare( &self, snapshot: SceneSnapshot, ) -> Result<PreparedScene, RenderError>
Resolve every identity/selection before preparation. Static assets accept animation/morph 0 only. Consumes snapshot admission on success and releases it on controlled failure.