diff --git a/crates/fparkan-assets/src/lib.rs b/crates/fparkan-assets/src/lib.rs index aeb91d9..ac64648 100644 --- a/crates/fparkan-assets/src/lib.rs +++ b/crates/fparkan-assets/src/lib.rs @@ -48,6 +48,7 @@ use std::sync::Arc; const TEXTURES_ARCHIVE: &str = "textures.lib"; const LIGHTMAP_ARCHIVE: &str = "lightmap.lib"; +const VISUAL_DEPENDENCY_PROGRESS_INTERVAL: usize = 64; /// Canonical terrain archive paths derived from a mission land reference. #[derive(Clone, Debug, Eq, PartialEq)] @@ -479,6 +480,15 @@ pub enum VisualDependencyPhase { Texture, } +/// Throttled visual-dependency expansion progress. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct VisualDependencyProgress { + /// Dependency class currently being expanded. + pub phase: VisualDependencyPhase, + /// Number of requests reached in this class during the current expansion. + pub request_count: usize, +} + /// Errors raised while preparing CPU-side assets. #[derive(Debug)] pub enum AssetError { @@ -1137,6 +1147,39 @@ pub fn extend_graph_report_with_visual_dependencies_and_progress( + repository: &R, + report: &mut PrototypeGraphReport, + graph: &mut PrototypeGraph, + prototypes: &[EffectivePrototype], + mut on_progress: impl FnMut(VisualDependencyProgress), ) { if graph.visual_dependencies_expanded { return; @@ -1159,6 +1202,9 @@ pub fn extend_graph_report_with_visual_dependencies_and_progress { report.wear_resolved_count += 1; @@ -1213,8 +1264,17 @@ pub fn extend_graph_report_with_visual_dependencies_and_progress MissionLoadPhase::GraphVisualWears, VisualDependencyPhase::Material => MissionLoadPhase::GraphVisualMaterials, VisualDependencyPhase::Texture => MissionLoadPhase::GraphVisualTextures, @@ -721,6 +723,13 @@ fn load_mission_with_options_and_progress( record_load_phase(&mut trace, &mut on_phase, runtime_phase); last_graph_visual_phase = Some(runtime_phase); } + if progress.phase == VisualDependencyPhase::Texture && progress.request_count > 1 { + record_load_phase( + &mut trace, + &mut on_phase, + MissionLoadPhase::GraphVisualTextureRequests(progress.request_count), + ); + } }, ); if !prototype_report.is_success() { diff --git a/docs/tomes/05-render.md b/docs/tomes/05-render.md index 9565f22..1acb056 100644 --- a/docs/tomes/05-render.md +++ b/docs/tomes/05-render.md @@ -1097,9 +1097,18 @@ separate profiling and compatibility target. `GraphVisuals` is now split observationally into `GraphVisualWears`, `GraphVisualMaterials` and `GraphVisualTextures`; it preserves the existing graph traversal, edge order and validation semantics. Repeating the controlled -180-second Part 2 probe ended at `GraphVisualTextures`. Thus Part 2 had passed -WEAR and MAT0 expansion before timeout; its remaining bottleneck is TEXM -validation/archive work, not Vulkan submission or the base prototype graph. +180-second Part 2 probe once ended at `GraphVisualTextures`. That particular +execution had passed WEAR and MAT0 expansion before timeout, but a checkpoint +is only the last phase reached in one run: it is not proof of a single global +bottleneck or of Vulkan involvement. + +Visual expansion now reports each dependency-class entrance, its first request +and every 64th later request; this is diagnostic-only and does not alter +traversal, edges or validation. A +later controlled 180-second Part 2 probe ended at `GraphVisualMaterials`, +before the first TEXM progress marker. The differing checkpoints rule out the +previous overly narrow claim that TEXM is the sole remaining target. Profiling +must compare WEAR, MAT0, TEXM, graph allocation and archive I/O quantitatively. Mission loading now raises the decoded-payload cache entry budget from 64 to 256 while retaining its 64 MiB byte budget. This avoids premature entry-count