16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-21 17:09:19 +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:
maj00r
2026-06-14 21:22:50 +02:00
parent 56d72fb25e
commit 2ee5f93353
16 changed files with 1228 additions and 104 deletions

View File

@@ -189,6 +189,8 @@ log_pack_bench_impl( Eu7PackBench const &bench, char const *const title ) {
" stuck_skip=" + std::to_string( bench.stream_apply_stuck_skip ) );
WriteLog(
" diag ready_tex_ms=" + std::to_string( static_cast<int>( bench.stream_prefetch_ready_tex_ms ) ) +
" ready_umes_ms=" + std::to_string( static_cast<int>( bench.stream_prefetch_ready_umes_ms ) ) +
" umes_loads=" + std::to_string( bench.stream_prefetch_ready_umes_loads ) +
" peak_pending=" + std::to_string( bench.peak_pending_total ) );
WriteLog(
" peaks: ready_q=" + std::to_string( bench.peak_ready_queue ) +
@@ -324,6 +326,7 @@ pack_bench_note_chunk(
pack_bench_inc( &Eu7PackBench::main_chunk_cold_loads, cold_meshes );
g_pack_bench.last_chunk_ms = wall_ms;
g_pack_bench.last_apply_ms = pointer_apply_ms;
g_pack_bench.last_chunk_instances = instances;
g_pack_bench.last_chunk_cold = cold_meshes;
if( wall_ms > g_pack_bench.peak_chunk_ms ) {
@@ -344,6 +347,7 @@ pack_bench_note_chunk(
auto &stream { g_pack_bench_stream };
stream.last_chunk_ms = wall_ms;
stream.last_apply_ms = pointer_apply_ms;
stream.last_chunk_instances = instances;
stream.last_chunk_cold = cold_meshes;
if( wall_ms > stream.peak_chunk_ms ) {