Skip to main content

Module asset_eviction

Module asset_eviction 

Source
Expand description

GPU asset eviction — reclaims orphaned GPU meshes/materials each frame.

The insert-only projection never removes a GpuMesh/GpuMaterial once uploaded, so despawns and inline material edits leak GPU memory. This system runs the AssetEviction pass in TickPhase::Maintenance — after ecs_maintenance compacts orphan rows — to diff the cache against live entity references and free the orphans. The AssetEviction state and the AssetStore both live in the [ServiceRegistry], so the system fetches and ticks them without any manual wiring.