M13.30: web depth and polish

- GPU in browser job workers: each job worker opens its own WebGPU device
  (deferred readbacks); the Render Queue export and the analyses' frame loops
  are futures (render::passes, offload::run_request_async) whose frames
  render in passes, awaiting the device between them. GPU particles and
  Advanced 3D read back under keys too. workers.jobs reports passes and
  readbacks; the smoke test measures them.
- Layer buffers in the browser's OPFS disk cache: frame workers back their
  layer caches with a PrefetchStore; the page plans what to fetch before a
  request from recent misses (LayerPrefetch over the shared DiskIndex).
- Templates embed footage (default on, size-capped with a warning) and
  creating from a template extracts it next to the new project / into
  browser storage.
- ICC LUT profiles (lut8/lut16/lutAtoB/lutBtoA, from the public ICC spec) in
  Simulate Output > My Custom RGB, baked into a 3D LUT for the viewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-04 02:57:17 -04:00
co-authored by Claude Opus 5.5
parent d39c0e818c
commit f3715aac32
46 changed files with 3304 additions and 387 deletions
+15 -1
View File
@@ -14,6 +14,7 @@ pub mod disk_cache;
use color::Region;
pub mod eval;
pub mod masks;
pub mod passes;
pub mod shapes;
pub mod styles;
pub mod text;
@@ -22,7 +23,7 @@ pub mod three_d;
use std::sync::Arc;
pub use auto::{AutoKey, AutoPick};
pub use cache::{CacheStats, LayerCache};
pub use cache::{CacheStats, LayerCache, LayerStore, PrefetchStore};
use effectcraft_color::BlendMode;
use effectcraft_effects::{Buf, EffectCtx, EffectEnv, EffectHost, LayerPixels, Params};
use effectcraft_geom::{Mat3, Mat4, vec2};
@@ -313,6 +314,13 @@ pub trait Accelerator: Send + Sync {
fn miss_gate(&self) -> Option<Arc<std::sync::atomic::AtomicBool>> {
None
}
/// With deferred readbacks: a future that resolves once the readbacks in flight have
/// landed (the browser delivers them from its event loop; natively the device is polled
/// before it returns, so the future is ready). `None` = nothing to wait for. See
/// [`passes::in_passes`].
fn settle(&self) -> Option<std::pin::Pin<Box<dyn std::future::Future<Output = ()> + '_>>> {
None
}
}
/// Where an effect stack runs (see [`Renderer::run_effects_on`]): a CPU buffer, or an image
@@ -631,6 +639,12 @@ impl<'a> Renderer<'a> {
EvalCtx { project: self.project, comp_id, comp, time: t, expr: self.expr, footage: Some(self.footage) }
}
/// This renderer with another accelerator (or none): the passes of
/// [`passes::in_passes`] render with the accelerator, its CPU fallback without.
pub fn with_accel(&self, accel: Option<&'a dyn Accelerator>) -> Renderer<'a> {
Renderer { accel, ..*self }
}
/// The accelerator to use for this render, if any (see [`Backend`]).
pub fn active_accel(&self) -> Option<&'a dyn Accelerator> {
let a = self.accel?;