summaryrefslogtreecommitdiff
path: root/cnn_v3/src/gbuffer_effect.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-23 07:54:18 +0100
committerskal <pascal.massimino@gmail.com>2026-03-23 07:54:18 +0100
commit491a3c1ccbd0f46be655e97d2e3697135df6e3a2 (patch)
tree57e9d7d8732fe7a0625d99641e780b38ace4c765 /cnn_v3/src/gbuffer_effect.h
parent1e3813355e37f903314ec2069ff788c6f69becfd (diff)
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 <noreply@anthropic.com>
Diffstat (limited to 'cnn_v3/src/gbuffer_effect.h')
-rw-r--r--cnn_v3/src/gbuffer_effect.h4
1 files changed, 4 insertions, 0 deletions
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<EffectDAGNode>& 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();