diff --git a/crates/larp-gpu/src/pipeline/make.rs b/crates/larp-gpu/src/pipeline/make.rs index 8771f9a..5e2df68 100644 --- a/crates/larp-gpu/src/pipeline/make.rs +++ b/crates/larp-gpu/src/pipeline/make.rs @@ -979,13 +979,18 @@ fn progress() { let spawned = std::thread::Builder::new().name("larp-pipelines-progress".into()).spawn(|| { // What was finished when the batch began, and since when the queue is empty. let mut batch_from = FINISHED.load(Ordering::Relaxed); + let mut batch_made_from = super::blobs::MADE.load(Ordering::Relaxed); + let mut batch_loaded_from = super::blobs::LOADED.load(Ordering::Relaxed); let mut empty_since: Option = None; - let mut shown: Option<(u64, u64)> = None; + let mut shown: Option<(u64, u64, bool)> = None; loop { std::thread::sleep(Duration::from_millis(250)); let waiting = WAITING.load(Ordering::Relaxed); let made = FINISHED.load(Ordering::Relaxed).saturating_sub(batch_from); let of = made + waiting; + let compiled = super::blobs::MADE.load(Ordering::Relaxed).saturating_sub(batch_made_from); + let loaded = super::blobs::LOADED.load(Ordering::Relaxed).saturating_sub(batch_loaded_from); + let loading_cache = loaded > 0 && loaded >= compiled; let hold = HOLD.load(Ordering::Relaxed); if waiting == 0 { let since = *empty_since.get_or_insert_with(Instant::now); @@ -1004,6 +1009,8 @@ fn progress() { } if !HOLD.load(Ordering::Relaxed) { batch_from = FINISHED.load(Ordering::Relaxed); + batch_made_from = super::blobs::MADE.load(Ordering::Relaxed); + batch_loaded_from = super::blobs::LOADED.load(Ordering::Relaxed); if shown.take().is_some() { crate::overlay::hide_top(); } @@ -1012,9 +1019,9 @@ fn progress() { } else { empty_since = None; } - if (hold || of >= SHOWN_FROM) && shown != Some((made, of)) { - shown = Some((made, of)); - crate::overlay::show_at_top(progress_panel(made, of)); + if (hold || of >= SHOWN_FROM) && shown != Some((made, of, loading_cache)) { + shown = Some((made, of, loading_cache)); + crate::overlay::show_at_top(progress_panel(made, of, loading_cache)); } } }); @@ -1025,10 +1032,11 @@ fn progress() { } /// The progress panel: the count, and a bar under it. -fn progress_panel(made: u64, of: u64) -> crate::overlay::Panel { +fn progress_panel(made: u64, of: u64, loading_cache: bool) -> crate::overlay::Panel { use crate::overlay::{Band, Panel, Row, Span, Tone}; const COLUMNS: u16 = 40; - let title = larp_core::i18n::text("overlay.compiling_pipelines"); + let key = if loading_cache { "overlay.loading_pipelines" } else { "overlay.compiling_pipelines" }; + let title = larp_core::i18n::text(key); let count = format!("{made} / {of}"); let count_w = larp_core::i18n::display_width(&count) as u16; let filled = if of == 0 { u16::MAX } else { (made * u64::from(u16::MAX) / of) as u16 }; diff --git a/locales/de.json b/locales/de.json index 3e6d765..49cc799 100644 --- a/locales/de.json +++ b/locales/de.json @@ -151,6 +151,7 @@ "menu.when.reset": "sofort(Reset)", "menu.when.start": "nächster Start", "overlay.compiling_pipelines": "Kompiliere Pipelines", + "overlay.loading_pipelines": "Lade Pipeline-Cache", "perf.01pct_low": "0,1%-Low", "perf.1pct_low": "1%-Low", "perf.compiling": "kompiliert", diff --git a/locales/en.json b/locales/en.json index dcb9f28..506f94a 100644 --- a/locales/en.json +++ b/locales/en.json @@ -151,6 +151,7 @@ "menu.when.reset": "now, resets", "menu.when.start": "next start", "overlay.compiling_pipelines": "Compiling pipelines", + "overlay.loading_pipelines": "Loading cached pipelines", "perf.01pct_low": "0.1% low", "perf.1pct_low": "1% low", "perf.compiling": "compiling", diff --git a/locales/es.json b/locales/es.json index dc18a8e..058f390 100644 --- a/locales/es.json +++ b/locales/es.json @@ -151,6 +151,7 @@ "menu.when.reset": "ahora, reinicia", "menu.when.start": "próximo inicio", "overlay.compiling_pipelines": "Compilando pipelines", + "overlay.loading_pipelines": "Cargando caché de pipelines", "perf.01pct_low": "0,1% mín.", "perf.1pct_low": "1% mín.", "perf.compiling": "compilando", diff --git a/locales/fr.json b/locales/fr.json index b96820c..ae36708 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -151,6 +151,7 @@ "menu.when.reset": "immédiat(reset)", "menu.when.start": "proch. lanc.", "overlay.compiling_pipelines": "Compilation des pipelines", + "overlay.loading_pipelines": "Chargement du cache des pipelines", "perf.01pct_low": "0,1% low", "perf.1pct_low": "1% low", "perf.compiling": "compilation", diff --git a/locales/pl.json b/locales/pl.json index bb18414..ab715ac 100644 --- a/locales/pl.json +++ b/locales/pl.json @@ -151,6 +151,7 @@ "menu.when.reset": "teraz(reset)", "menu.when.start": "nast. start", "overlay.compiling_pipelines": "Kompilacja potoków", + "overlay.loading_pipelines": "Ładowanie pamięci podręcznej potoków", "perf.01pct_low": "0,1% low", "perf.1pct_low": "1% low", "perf.compiling": "kompilacja", diff --git a/locales/pt-BR.json b/locales/pt-BR.json index dd3a17d..e4b18d9 100644 --- a/locales/pt-BR.json +++ b/locales/pt-BR.json @@ -151,6 +151,7 @@ "menu.when.reset": "agora(reinicia)", "menu.when.start": "próx. início", "overlay.compiling_pipelines": "Compilando pipelines", + "overlay.loading_pipelines": "Carregando cache de pipelines", "perf.01pct_low": "0,1% low", "perf.1pct_low": "1% low", "perf.compiling": "compilando", diff --git a/locales/tr.json b/locales/tr.json index 7d2224c..90c2eb6 100644 --- a/locales/tr.json +++ b/locales/tr.json @@ -151,6 +151,7 @@ "menu.when.reset": "hemen(sıfırla)", "menu.when.start": "sonraki açılış", "overlay.compiling_pipelines": "Ardışık düzenler derleniyor", + "overlay.loading_pipelines": "Önbellekteki ardışık düzenler yükleniyor", "perf.01pct_low": "%0,1 düşük", "perf.1pct_low": "%1 düşük", "perf.compiling": "derleniyor", diff --git a/locales/zh-CN.json b/locales/zh-CN.json index a5af764..adeed0f 100644 --- a/locales/zh-CN.json +++ b/locales/zh-CN.json @@ -151,6 +151,7 @@ "menu.when.reset": "立即生效(重置)", "menu.when.start": "下次启动", "overlay.compiling_pipelines": "正在编译管线", + "overlay.loading_pipelines": "正在加载管线缓存", "perf.01pct_low": "0.1% 低帧", "perf.1pct_low": "1% 低帧", "perf.compiling": "编译中", diff --git a/locales/zh-TW.json b/locales/zh-TW.json index 3bd4e6e..30c9828 100644 --- a/locales/zh-TW.json +++ b/locales/zh-TW.json @@ -151,6 +151,7 @@ "menu.when.reset": "立即生效(重置)", "menu.when.start": "下次啟動", "overlay.compiling_pipelines": "正在編譯管線", + "overlay.loading_pipelines": "正在載入管線快取", "perf.01pct_low": "0.1% 低幀", "perf.1pct_low": "1% 低幀", "perf.compiling": "編譯中",