mirror of
https://github.com/storytold/effectcraft.git
synced 2026-11-20 09:05:51 +00:00
Disk cache: record the source files each frame reads
Part of #3184 (step 1): renders now report which footage files they read, each with its identity (size and modification time) as read. Nothing uses the list yet: images, cache keys and cache behaviour are unchanged. - render: `reads` module with `FileStamp`, `ReadFile`, `ReadFiles` (sorted, deduplicated, bounded; marked incomplete when it can't vouch for every file) and the thread-safe `ReadLog`. `Renderer::reads` collects a frame's files; `FootageSource::recording` lets a source note what it reads. `file_stamp` uses the same identity. - Layer cache entries keep the files their buffer was made of and report them on every hit; derived entries (styles, blend space, flattened) keep their base's. Buffers from the disk cache or the browser store don't know their files yet and mark the list incomplete. - Media pool: every file read notes its identity, taken from the file it opens. Decoded frames, opened movies, GIFs, models and EXR channels keep it with the cache entry, so a frame served from memory reports its file without touching the disk. - Viewer frame worker collects each frame's list and carries it to where the disk entry is written (step 2 stores it). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
69114a8294
commit
91443ef25e
20 files changed
+968
-247
No files matched your search
@@ -487,7 +487,7 @@ fn model_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, b: &mut Builder) {
|
||||
LayerSource::Model { item } => {
|
||||
let Some(it) = r.project.item(*item) else { return };
|
||||
let ItemKind::Footage(f) = &it.kind else { return };
|
||||
let Some(m) = r.footage.model(*item, f) else { return };
|
||||
let Some(m) = r.read(|| r.footage.model(*item, f)) else { return };
|
||||
let unit = geo.map_or(1.0, |g| ctx.f(layer, g, "unitScale", 1.0));
|
||||
let clip = geo.map_or(0, |g| ctx.e(layer, g, "animation")) as usize;
|
||||
let clip = clip.checked_sub(1).filter(|c| *c < m.animations.len());
|
||||
@@ -700,7 +700,7 @@ fn card_layer(r: &Renderer, ctx: &EvalCtx, layer: &Layer, b: &mut Builder) {
|
||||
let world = b.outer * ctx.world_matrix(layer);
|
||||
if crate::text::per_char_3d(ctx, layer) {
|
||||
for (buf, m) in crate::text::per_char_planes(ctx, layer, r.opts.scale) {
|
||||
let buf = r.to_blend(Arc::new(buf), None);
|
||||
let buf = r.to_blend(Arc::new(buf), None, &Arc::default());
|
||||
card(b, &buf, world * m, mat);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -205,7 +205,9 @@ pub(crate) fn prepare_all<'a>(r: &Renderer, ctx: &EvalCtx<'_>, layer: &'a Layer,
|
||||
if crate::text::per_char_3d(ctx, layer) {
|
||||
return crate::text::per_char_planes(ctx, layer, r.opts.scale)
|
||||
.into_iter()
|
||||
.filter_map(|(buf, m)| prepare_with(r, ctx, layer, order, out, in_run, PlaneInput { buf: r.to_blend(Arc::new(buf), None), local: m }))
|
||||
.filter_map(|(buf, m)| {
|
||||
prepare_with(r, ctx, layer, order, out, in_run, PlaneInput { buf: r.to_blend(Arc::new(buf), None, &Arc::default()), local: m })
|
||||
})
|
||||
.collect();
|
||||
}
|
||||
prepare(r, ctx, layer, order, out, in_run).into_iter().collect()
|
||||
|
||||
Reference in new issue
Block a user