From 7041babc9e5333d01191f3eb80fd711bd26cd4f7 Mon Sep 17 00:00:00 2001 From: skal Date: Tue, 17 Feb 2026 08:46:01 +0100 Subject: feat: add time-based effect activation with auto-passthrough Effects now accept start/end time parameters and automatically passthrough when inactive. Implements buffer chain integrity via compile-time validation. - Effect base class: dispatch_render() checks time bounds, auto-passthroughs 1:1 input/output effects outside [start, end] interval - seq_compiler.py: validates producer/consumer lifespan constraints for multi-output effects, adds --validate flag, always validates before codegen - Updated all 9 effect classes and test fixtures to pass start/end times - check_all.sh: includes timeline validation step - Tests: 34/34 passing, demo runs successfully Co-Authored-By: Claude Sonnet 4.5 --- src/gpu/effect.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/gpu/effect.h') diff --git a/src/gpu/effect.h b/src/gpu/effect.h index d40e750..0d7e35e 100644 --- a/src/gpu/effect.h +++ b/src/gpu/effect.h @@ -14,7 +14,8 @@ class NodeRegistry; class Effect { public: Effect(const GpuContext& ctx, const std::vector& inputs, - const std::vector& outputs); + const std::vector& outputs, float start_time, + float end_time); virtual ~Effect() = default; // Optional: Declare temporary nodes (e.g., multi-pass intermediate buffers) @@ -22,7 +23,12 @@ class Effect { (void)registry; } - // Render effect (multi-input/multi-output) + // Dispatch render with automatic passthrough outside [start, end] + void dispatch_render(WGPUCommandEncoder encoder, + const UniformsSequenceParams& params, + NodeRegistry& nodes); + + // Render effect (multi-input/multi-output) - override in derived classes virtual void render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params, NodeRegistry& nodes) = 0; @@ -46,5 +52,12 @@ class Effect { std::vector output_nodes_; int width_ = 1280; int height_ = 720; + + private: + float start_time_; + float end_time_; + + // Auto-passthrough helper for 1:1 input/output effects + void blit_input_to_output(WGPUCommandEncoder encoder, NodeRegistry& nodes); }; #endif // EFFECT_H -- cgit v1.2.3