FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust
GPU3d: GPU export rendering is Auto by default (#30)
Manuel Camacho7b73c8e88782
diff --git a/crates/export/src/lib.rs b/crates/export/src/lib.rsindex e94756eb2..185d45aea 100644--- a/crates/export/src/lib.rs+++ b/crates/export/src/lib.rs@@ -273,7 +273,7 @@ pub struct ExportSettings {#[serde(default)]pub hardware_encoding: HardwareEncoding,/// Composite the exported frames on the GPU instead of the CPU reference renderer (Export ▸- /// GPU rendering: Auto / Off). Off = today's CPU behaviour exactly.+ /// GPU rendering: Auto / Off, Auto by default). Off = the CPU reference renderer exactly.#[serde(default)]pub gpu_rendering: GpuRendering,/// VBR maximum bitrate (None = 1.5 × target).@@ -458,7 +458,7 @@ impl Default for ExportSettings {h264_level: None,bitrate_mode: BitrateMode::default(),hardware_encoding: HardwareEncoding::default(),- gpu_rendering: GpuRendering::Off,+ gpu_rendering: GpuRendering::Auto,max_bitrate_kbps: None,adaptive_bitrate: None,keyframe_distance: None,diff --git a/crates/export/src/settings.rs b/crates/export/src/settings.rsindex 87587ba4a..d79b86a47 100644--- a/crates/export/src/settings.rs+++ b/crates/export/src/settings.rs@@ -78,12 +78,15 @@ pub enum HardwareEncoding {/// Whether the picture of an export may be composited on the GPU (`filmcraft-gpu`'s off-screen/// compositor) instead of the CPU reference renderer. Auto = use the GPU when the app registered/// a GPU frame renderer and the machine has an adapter; the CPU result is the fallback either-/// way. Off = today's CPU behaviour exactly (default until GPU export is faster than CPU export).+/// way. Auto is the default: on an effects-heavy edit it exports 2.4× (1080p) to 3.2× (4K)+/// faster, and a single plain clip takes the same time (`docs/performance.md`). The GPU matches+/// the CPU within the compositor's parity tolerance, not bit for bit, so an export's bytes can+/// depend on the machine's GPU. Off = the CPU reference renderer, byte-reproducible everywhere.#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]#[serde(rename_all = "camelCase")]pub enum GpuRendering {- Auto,#[default]+ Auto,Off,}diff --git a/crates/export/src/settings_tests.rs b/crates/export/src/settings_tests.rsindex b4fcbc57c..21975aa27 100644--- a/crates/export/src/settings_tests.rs+++ b/crates/export/src/settings_tests.rs@@ -534,3 +534,13 @@ fn extreme_bitrates_do_not_overflow_encoder_setup() {assert!(result.unwrap().unwrap().is_err(), "an unrepresentable encoder buffer rate must be rejected");}}++#[test]+fn gpu_rendering_is_auto_by_default() {+ assert_eq!(ExportSettings::default().gpu_rendering, crate::GpuRendering::Auto);+ // settings saved before the field existed get the default too+ let s: ExportSettings = serde_json::from_value(serde_json::json!({"format": "h264"})).unwrap();+ assert_eq!(s.gpu_rendering, crate::GpuRendering::Auto);+ let off: ExportSettings = serde_json::from_value(serde_json::json!({"format": "h264", "gpuRendering": "off"})).unwrap();+ assert_eq!(off.gpu_rendering, crate::GpuRendering::Off);+}diff --git a/docs/performance.md b/docs/performance.mdindex 5fd62d739..070e408b1 100644--- a/docs/performance.md+++ b/docs/performance.md@@ -95,6 +95,29 @@ compositor's savings are a larger part of the export.What is left in a frame without overlays is the Y'CbCr → linear float conversion of the camerapicture (4.5 ms in the synthetic case) and the conversion to 8 bits (2 ms).+## Results (GPU3: GPU export rendering, Off → Auto, #30)++Export ▸ GPU Rendering composites the exported frames on the GPU (`filmcraft-gpu`'s off-screen+compositor, a pool of up to four renderers) instead of the CPU reference renderer, which stays the+fallback for anything the GPU stage does not run. Linux, Ryzen 7 9700X (16 threads) + Radeon+RX 7900 (Mesa 26.2.2), 2026-10-08 / 09, same build, `cargo xtask bench --sections export --only+<scene> --hw off|auto`: 191 frames to H.264 + AAC with the built-in encoder. `h264` is one 1080p+clip; `h264_fx` the same clip on V1 with Proc Amp, Gaussian Blur and Vignette, plus two+picture-in-picture copies (50 % with Brightness & Contrast, 33 % at 70 % opacity with Sharpen).+Every Auto row rendered all its frames on the GPU, without fallbacks.++| scene | Off: s / CPU ms per frame | **Auto**: s / CPU ms per frame |+|---|---|---|+| `h264`, 1080p (load 12–33) | 5.96, 6.08 / 292 | 6.07, 6.36 / 281 |+| `h264_fx`, 1080p (load 12–33) | 13.00, 12.67 / 737 | **5.63, 5.00 / 238** |+| `h264_fx`, 4K sequence and clip (load 2–19) | 38.74, 39.34 / 2955 | **11.99 / 775** |++On a plain clip the export is decoding- and encoding-bound and both take the same time; with+layers and effects the GPU is 2.4× (1080p) to 3.2× (4K) faster, with a third to a quarter of the+CPU. GPU rendering is therefore **Auto by default**. The GPU result matches the CPU within the+compositor's parity tolerance, not bit for bit: Off keeps exports byte-reproducible on every+machine. (The 4K row used the same scene with the sequence, clip and positions scaled to 4K.)+## Results (GPU2: standard effects on the GPU compositor, #30, before → after)Before = this change with clips that carry standard effects sent back to the CPU layer path in