From 6944733a6a2f05c18e7e0b73f847a4c9144801fd Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 10 Feb 2026 12:48:43 +0100 Subject: feat: Add multi-layer CNN support with framebuffer capture and blend control Implements automatic layer chaining and generic framebuffer capture API for multi-layer neural network effects with proper original input preservation. Key changes: - Effect::needs_framebuffer_capture() - generic API for pre-render capture - MainSequence: auto-capture to "captured_frame" auxiliary texture - CNNEffect: multi-layer support via layer_index/total_layers params - seq_compiler: expands "layers=N" to N chained effect instances - Shader: @binding(4) original_input available to all layers - Training: generates layer switches and original input binding - Blend: mix(original, result, blend_amount) uses layer 0 input Timeline syntax: CNNEffect layers=3 blend=0.7 Co-Authored-By: Claude Sonnet 4.5 --- src/gpu/effect.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gpu/effect.h') diff --git a/src/gpu/effect.h b/src/gpu/effect.h index 8f35f3c..f008c8d 100644 --- a/src/gpu/effect.h +++ b/src/gpu/effect.h @@ -44,6 +44,12 @@ class Effect { return false; } + // If true, MainSequence will capture current framebuffer to "captured_frame" + // auxiliary texture before rendering this effect + virtual bool needs_framebuffer_capture() const { + return false; + } + protected: const GpuContext& ctx_; UniformBuffer uniforms_; -- cgit v1.2.3