atagen

monolith

public
Star0
Watch0

Commit 915d54ae64cf

tarball

atagen <boss@atagen.co>2026-10-19 10:36 UTC

1 file changed+7-1
render-vk: save the pipeline cache after warm-up

The cache was only written on drop, so a crash lost the whole warm-up and the exit path of a lost device read cache data back from it. Pipelines::save_cache now skips a lost device and runs once after warm().
Modified file: crates/render-vk/src/pipeline.rs+7 additions−1 deletions
@@ -149,9 +149,13 @@ impl Pipelines {
149149 }
150150 }
151151 tracing::debug!(elapsed = ?began.elapsed(), "warmed pipelines");
152+ self.save_cache();
152153 }
153154
154- fn save_cache(&self) {
155+ fn save_cache(&mut self) {
156+ if crate::error::device_lost() {
157+ return;
158+ }
155159 let Some(path) = &self.cache_path else {
156160 return;
157161 };
@@ -183,6 +187,8 @@ impl Pipelines {
183187 if let Err(e) = written {
184188 tracing::debug!("cannot save the pipeline cache: {e}");
185189 let _ = std::fs::remove_file(&tmp);
190+ } else {
191+ self.loaded_len = data.len();
186192 }
187193 }