From 9d1d4df877f96f1970dce2ab30cfae49d3d796e1 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 16 Feb 2026 08:26:45 +0100 Subject: feat(sequence): Phase 1 - Sequence v2 foundation - Add Node system with typed buffers (u8x4_norm, f32x4, f16x8, depth24) - Add NodeRegistry with aliasing support for ping-pong optimization - Add SequenceV2 base class with DAG execution - Add EffectV2 base class with multi-input/multi-output - Add comprehensive tests (5 test cases, all passing) - Corrected FATAL_CHECK usage (checks ERROR conditions, not success) Phase 1 complete: Core v2 architecture functional. Next: Phase 2 compiler (seq_compiler_v2.py) handoff(Claude): Phase 1 foundation complete, all tests passing (35/35) --- src/gpu/effect_v2.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/gpu/effect_v2.h (limited to 'src/gpu/effect_v2.h') diff --git a/src/gpu/effect_v2.h b/src/gpu/effect_v2.h new file mode 100644 index 0000000..0d4e18d --- /dev/null +++ b/src/gpu/effect_v2.h @@ -0,0 +1,47 @@ +// EffectV2: Base class for v2 effects with multi-input/multi-output support + +#pragma once + +#include "gpu/gpu.h" +#include "gpu/sequence_v2.h" +#include +#include + +class NodeRegistry; + +class EffectV2 { + public: + EffectV2(const GpuContext& ctx, const std::vector& inputs, + const std::vector& outputs); + virtual ~EffectV2() = default; + + // Optional: Declare temporary nodes (e.g., multi-pass intermediate buffers) + virtual void declare_nodes(NodeRegistry& registry) { + (void)registry; + } + + // Render effect (multi-input/multi-output) + virtual void render(WGPUCommandEncoder encoder, + const UniformsSequenceParams& params, + NodeRegistry& nodes) = 0; + + // Resize notification + virtual void resize(int width, int height) { + width_ = width; + height_ = height; + } + + const std::vector& input_nodes() const { + return input_nodes_; + } + const std::vector& output_nodes() const { + return output_nodes_; + } + + protected: + const GpuContext& ctx_; + std::vector input_nodes_; + std::vector output_nodes_; + int width_ = 1280; + int height_ = 720; +}; -- cgit v1.2.3