M12.2: merge main (ROI, viewer tools); gate GPU display textures

Region-of-interest frames render on the CPU path; the viewer keeps main's
frame drawing (Show Channel, exposure, ROI) and reads GPU-composited frames
back. Keeping frames as native egui-wgpu textures stays implemented behind
RenderSource::gpu_display (off).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-02 11:14:18 -04:00
co-authored by Claude Opus 5.5
54 changed files with 7969 additions and 801 deletions
+2 -4
View File
@@ -1,5 +1,5 @@
//! The viewer on the GPU compositor (egui_kittest with wgpu): frames are drawn from GPU textures
//! and match the CPU viewer. Skips without a GPU adapter (CI). Set `EC_SNAPSHOT_DIR` to keep PNGs.
//! The viewer on the GPU compositor (egui_kittest with wgpu): frames composited on the GPU match
//! the CPU viewer. Skips without a GPU adapter (CI). Set `EC_SNAPSHOT_DIR` to keep PNGs.
use effectcraft_engine::Session;
use effectcraft_ui_egui::EffectcraftApp;
@@ -31,13 +31,11 @@ fn viewer_draws_gpu_frames_that_match_the_cpu() {
let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_pixels_per_point(1.0).wgpu().build_eframe(|_| EffectcraftApp::new(s));
settle(&mut h);
assert!(h.state().gpu_adapter().is_some(), "GPU compositor on egui-wgpu's device");
assert!(h.state().viewer_on_gpu(), "viewer frame comes from the GPU");
let gpu_px = h.state_mut().viewer_pixels().expect("read back the GPU frame");
let gpu_shot = h.render().expect("render");
// Mercury Software Only: the same frame from the CPU.
h.state_mut().session.execute("render.backend", json!({"backend": "cpu"})).unwrap();
settle(&mut h);
assert!(!h.state().viewer_on_gpu());
let cpu_px = h.state_mut().viewer_pixels().expect("CPU frame");
let cpu_shot = h.render().expect("render");
assert_eq!(gpu_px.size, cpu_px.size);