mirror of
https://github.com/storytold/filmcraft.git
synced 2026-10-31 21:47:02 -06:00
GpuCompositor::upload converted f32 RGBA layers (effects rendered on the CPU, captions,
whole-frame fallbacks) and 16-bit YUV frames (ProRes render previews) to half floats on the UI
thread every time a frame was shown: 8.3 M values per 1080p RGBA layer, 4 M per ProRes frame.
filmcraft_gpu::prepare(plan) now does those conversions on the frame worker that built the plan
(parallel chunks; 16-bit codes through a cached per-bit-depth table) and the plan cache stores
them with the plan (frames::GpuPlan), bounded by count and bytes (1 GiB). composite_prepared()
only copies bytes into textures. The texels are bit-identical (new test compares the read-back
output of both paths for f32, 10-bit 4:2:2 and fallback-image plans).
bench, same-session A/B (GPU path, after-preview Full, 2 rounds, load avg 50–95):
UI-thread present time p50/p95: plays from previews 11–31 / 34–77 ms → 3.6–5.8 / 4–14 ms;
live effects play 17–28 / 31–56 ms → 4.1 / 12 ms (first run)
plays from previews: 184/8, 183/9, 189/3, 169/23 → 192/0, 192/0, 191/1, 192/0 shown/dropped
live effects play (CPU-bound, ~6 cores at this load): too noisy to compare (0–117 shown either way)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
26 lines
765 B
TOML
26 lines
765 B
TOML
[package]
|
|
name = "filmcraft-gpu"
|
|
description = "wgpu compositor: YUV/RGB layer sampling, linear-light premultiplied compositing in WGSL"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
filmcraft-color = { workspace = true }
|
|
filmcraft-frame = { workspace = true }
|
|
filmcraft-geom = { workspace = true }
|
|
filmcraft-render = { workspace = true }
|
|
wgpu = { version = "30", default-features = false, features = ["wgsl"] }
|
|
log = { workspace = true }
|
|
rayon = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
pollster = "0.4"
|
|
wgpu = { version = "30", features = ["wgsl", "metal", "vulkan", "dx12", "gles"] }
|
|
filmcraft-media = { workspace = true }
|
|
filmcraft-time = { workspace = true }
|