diff options
| author | skal <pascal.massimino@gmail.com> | 2026-03-23 07:31:14 +0100 |
|---|---|---|
| committer | skal <pascal.massimino@gmail.com> | 2026-03-23 07:31:14 +0100 |
| commit | 1e3813355e37f903314ec2069ff788c6f69becfd (patch) | |
| tree | cb9ace6456a40eabb4ab0478f912c1adadffb6d1 /src/gpu/sequence.cc | |
| parent | 13cf1438caa56b34529d4031ddf73d38286b70e5 (diff) | |
feat(cnn_v3): GBufferEffect temporal feedback via post_render()
- Add Effect::post_render() virtual hook, called after all effects in
the sequence have rendered each frame. Default is no-op.
- Sequence::render_effects() runs a second pass invoking post_render()
on all DAG nodes after the render pass completes.
- GBufferEffect: declare internal node_prev_tex_ (U8X4_NORM) for
persistent prev-frame CNN output. post_render() copies cnn_output_node_
→ node_prev_tex_ via CopyTextureToTexture. render() binds node_prev_tex_
as prev_cnn (binding 6) — zero on frame 0 (matches training convention).
- Expose set_cnn_output_node(name) API; call once at setup.
- Drop brittle ping-pong / input_nodes_[0] fallback.
- Update doc/SEQUENCE.md: post_render() semantics, frame execution order,
temporal feedback canonical pattern, node types table with G-buffer types.
- Update cnn_v3/docs/HOWTO.md: temporal feedback wiring section.
36/36 tests passing.
handoff(Gemini): prev.rgb temporal feedback now correct and generic.
Set set_cnn_output_node("sink") (or CNN output node name) once at setup.
Diffstat (limited to 'src/gpu/sequence.cc')
| -rw-r--r-- | src/gpu/sequence.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gpu/sequence.cc b/src/gpu/sequence.cc index 91ca187..78647b2 100644 --- a/src/gpu/sequence.cc +++ b/src/gpu/sequence.cc @@ -269,6 +269,11 @@ void Sequence::render_effects(WGPUCommandEncoder encoder) { for (const auto& dag_node : effect_dag_) { dag_node.effect->dispatch_render(encoder, params_, nodes_); } + // End-of-frame hook: allows effects to persist data for the next frame + // (e.g. temporal feedback copies) after all rendering is done. + for (const auto& dag_node : effect_dag_) { + dag_node.effect->post_render(encoder, nodes_); + } } void Sequence::resize(int width, int height) { |
