From 491a3c1ccbd0f46be655e97d2e3697135df6e3a2 Mon Sep 17 00:00:00 2001 From: skal Date: Mon, 23 Mar 2026 07:54:18 +0100 Subject: feat(gbuffer): wire_dag() + find_downstream_output() for temporal feedback - Add Effect::wire_dag() virtual (called from init_effect_nodes after full DAG built) - Add Effect::find_downstream_output() protected helper (first downstream consumer output) - GBufferEffect::wire_dag() auto-sets cnn_output_node_ via find_downstream_output, guarding against sink (external view, null texture) - GBufferEffect::post_render() null-checks src texture before CopyTextureToTexture - Tests: find_downstream_output cases + wire_dag integration in test_effect_base - Doc: SEQUENCE.md updated with wire_dag pattern, helper contract, and sink guard Co-Authored-By: Claude Sonnet 4.6 --- cnn_v3/src/gbuffer_effect.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cnn_v3/src/gbuffer_effect.h') diff --git a/cnn_v3/src/gbuffer_effect.h b/cnn_v3/src/gbuffer_effect.h index 8e777f8..76d4347 100644 --- a/cnn_v3/src/gbuffer_effect.h +++ b/cnn_v3/src/gbuffer_effect.h @@ -49,6 +49,10 @@ class GBufferEffect : public Effect { // Copies cnn_output_node_ → node_prev_tex_ after all effects have rendered. void post_render(WGPUCommandEncoder encoder, NodeRegistry& nodes) override; + // Auto-wires cnn_output_node_: finds the first downstream effect whose + // input_nodes intersect our output_nodes, and uses its output_nodes[0]. + void wire_dag(const std::vector& dag) override; + // Populate the internal scene with ~20 rotating cubes and a few pumping // spheres. Must be called once before the first render(). void set_scene(); -- cgit v1.2.3