Skip to main content

ItemDedupCache

Type Alias ItemDedupCache 

Source
pub type ItemDedupCache = Arc<Mutex<FxHashMap<u128, Arc<(Mesh, Option<u128>)>>>>;
Expand description

Shared content-dedup cache: maps a 128-bit structural item hash to the LOCAL (pre-placement, void-free, colour-free) item mesh PLUS its precomputed instancing rep_identity (Some when instancing tagged it, else None). Storing the rep beside the mesh lets a cache hit stamp it without re-running the O(verts) compute_mesh_hash_full per occurrence. Build ONE per loaded model with GeometryRouter::new_dedup_cache and inject it into every per-element / per-batch router via GeometryRouter::enable_content_dedup_shared so byte-identical geometry is meshed once regardless of how the work is partitioned across threads/batches.

Aliased Typeยง

pub struct ItemDedupCache { /* private fields */ }