mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 07:59:18 +02:00
Add EU7 PACK v11 UTEX, section unload, and LRU streaming caches
Bake deduplicated section texture lists (UTEX) and read them at runtime so texture warm/prefetch no longer scans every instance. Evict PACK sections outside a 16 km keep ring and cap mesh/nodedata/texture warm caches to stop RAM and apply cost from growing without bound during long fast camera flight. - Bake v11 (format=4): UMES + UTEX + CHNK; mesh/texture ordering by frequency - Runtime: incremental UTEX warm, adaptive apply slices, preempt/catchup tuning - Unload: track instances per section, Region erase, pack pool release - LRU: mesh/nodedata (2000, ref-counted), warmed textures (2048) - Bench/diagnostics: unload and cache eviction counters - Fix pack instance erase in Region; resolve duplicate helper symbols
This commit is contained in:
@@ -444,6 +444,33 @@ basic_cell::insert( TMemCell *Memorycell ) {
|
||||
void
|
||||
basic_cell::erase( TAnimModel *Instance ) {
|
||||
|
||||
if( Instance->m_eu7_pack && Instance->m_instanceable ) {
|
||||
m_instancesopaque.erase(
|
||||
std::remove_if(
|
||||
std::begin( m_instancesopaque ), std::end( m_instancesopaque ),
|
||||
[=]( TAnimModel *instance ) {
|
||||
return instance == Instance; } ),
|
||||
std::end( m_instancesopaque ) );
|
||||
if( Instance->Model() != nullptr ) {
|
||||
instance_bucket_key key;
|
||||
key.pModel = Instance->Model();
|
||||
auto const *mat { Instance->Material() };
|
||||
if( mat != nullptr ) {
|
||||
for( int i { 0 }; i < 5; ++i ) { key.skins[ i ] = mat->replacable_skins[ i ]; }
|
||||
}
|
||||
auto bucket { m_instancebuckets_opaque.find( key ) };
|
||||
if( bucket != m_instancebuckets_opaque.end() ) {
|
||||
bucket->second.erase(
|
||||
std::remove( std::begin( bucket->second ), std::end( bucket->second ), Instance ),
|
||||
std::end( bucket->second ) );
|
||||
if( bucket->second.empty() ) {
|
||||
m_instancebuckets_opaque.erase( bucket );
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
auto const flags = Instance->Flags();
|
||||
auto alpha =
|
||||
( Instance->Material() != nullptr ?
|
||||
|
||||
Reference in New Issue
Block a user