feat(runtime): split model asset load checkpoints
Docs Deploy / Build and Deploy MkDocs (push) Successful in 35s
Test / Lint (push) Failing after 2m17s
Test / Test (push) Skipped
Test / Render parity (push) Skipped

This commit is contained in:
2026-07-18 11:20:13 +04:00
parent c55d835d35
commit 421c9d7aa3
3 changed files with 20 additions and 13 deletions
+6 -3
View File
@@ -458,8 +458,10 @@ pub struct AssetPreparationReport {
/// Asset preparation checkpoint emitted while resolving visual dependencies. /// Asset preparation checkpoint emitted while resolving visual dependencies.
#[derive(Clone, Copy, Debug, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum AssetPreparationPhase { pub enum AssetPreparationPhase {
/// Decode a model and its corresponding WEAR table. /// Decode and validate an MSH model.
ModelAndWear, ModelMesh,
/// Decode the corresponding WEAR table.
WearTable,
/// Resolve MAT0 material documents referenced by a WEAR table. /// Resolve MAT0 material documents referenced by a WEAR table.
Materials, Materials,
/// Decode diffuse textures and baked lightmaps. /// Decode diffuse textures and baked lightmaps.
@@ -1513,7 +1515,7 @@ fn prepare_visual_with_repository_internal<R: ResourceRepository>(
}); });
}; };
on_phase(AssetPreparationPhase::ModelAndWear); on_phase(AssetPreparationPhase::ModelMesh);
let model = prepare_model_cached(repository, mesh_key, preparation_cache)?; let model = prepare_model_cached(repository, mesh_key, preparation_cache)?;
let model_id = AssetId::new((identity_policy.model)(proto)); let model_id = AssetId::new((identity_policy.model)(proto));
let prepared_model = PreparedModel { let prepared_model = PreparedModel {
@@ -1529,6 +1531,7 @@ fn prepare_visual_with_repository_internal<R: ResourceRepository>(
name: wear_name, name: wear_name,
type_id: Some(WEAR_KIND), type_id: Some(WEAR_KIND),
}; };
on_phase(AssetPreparationPhase::WearTable);
let wear = prepare_wear_cached(repository, &wear_key, preparation_cache)?; let wear = prepare_wear_cached(repository, &wear_key, preparation_cache)?;
let wear_id = AssetId::new((identity_policy.wear)(proto)); let wear_id = AssetId::new((identity_policy.wear)(proto));
let prepared_wear = PreparedWear { let prepared_wear = PreparedWear {
+6 -3
View File
@@ -120,8 +120,10 @@ pub enum MissionLoadPhase {
GraphVisuals, GraphVisuals,
/// Prepare all reachable visual/resource dependencies. /// Prepare all reachable visual/resource dependencies.
Assets, Assets,
/// Decode model meshes and their WEAR tables. /// Decode and validate MSH model meshes.
AssetModels, AssetModelMeshes,
/// Decode WEAR material tables.
AssetWearTables,
/// Resolve MAT0 material documents. /// Resolve MAT0 material documents.
AssetMaterials, AssetMaterials,
/// Decode diffuse textures and baked lightmaps. /// Decode diffuse textures and baked lightmaps.
@@ -707,7 +709,8 @@ fn load_mission_with_options_and_progress(
let mut last_asset_phase = None; let mut last_asset_phase = None;
let mut observe_asset_phase = |phase| { let mut observe_asset_phase = |phase| {
let runtime_phase = match phase { let runtime_phase = match phase {
AssetPreparationPhase::ModelAndWear => MissionLoadPhase::AssetModels, AssetPreparationPhase::ModelMesh => MissionLoadPhase::AssetModelMeshes,
AssetPreparationPhase::WearTable => MissionLoadPhase::AssetWearTables,
AssetPreparationPhase::Materials => MissionLoadPhase::AssetMaterials, AssetPreparationPhase::Materials => MissionLoadPhase::AssetMaterials,
AssetPreparationPhase::Textures => MissionLoadPhase::AssetTextures, AssetPreparationPhase::Textures => MissionLoadPhase::AssetTextures,
}; };
+8 -7
View File
@@ -1063,14 +1063,15 @@ provenance while avoiding repeat format work for repeated components. The same
demonstrate an additional checkpoint advance from this cache; it must not be demonstrate an additional checkpoint advance from this cache; it must not be
reported as a measured startup improvement. reported as a measured startup improvement.
`Assets` now has three ordered diagnostic sub-checkpoints: `AssetModels` `Assets` now has four ordered diagnostic sub-checkpoints: `AssetModelMeshes`
(MSH and WEAR), `AssetMaterials` (MAT0) and `AssetTextures` (diffuse TEXM and (MSH), `AssetWearTables` (WEAR), `AssetMaterials` (MAT0) and `AssetTextures`
lightmaps). The callback is observational: it neither changes the preparation (diffuse TEXM and lightmaps). The callback is observational: it neither changes
order nor deduplicates requests. A fresh controlled 60-second canonical GOG the preparation order nor deduplicates requests. A fresh controlled 60-second
`Autodemo.00` first-root probe reached `AssetModels` and did not reach canonical GOG `Autodemo.00` first-root probe reached `AssetWearTables` but not
`AssetMaterials`; its created process was terminated and no native frame was `AssetMaterials`; its created process was terminated and no native frame was
reported. This narrows the next investigation to model/WEAR preparation, but reported. At least one MSH therefore finished before the timeout, but this does
does not by itself attribute the delay to either decoder or I/O. not attribute the remaining interval to WEAR decoding rather than later
MSH/WEAR iteration or archive I/O.
The same source-axis proof now applies to `TerrainWorld`: its `Land.msh` surface The same source-axis proof now applies to `TerrainWorld`: its `Land.msh` surface
height query and `Land.map` areal/grid lookup use XY ground coordinates, return height query and `Land.map` areal/grid lookup use XY ground coordinates, return