summaryrefslogtreecommitdiff
path: root/cnn_v3/src/gbuffer_effect.h
diff options
context:
space:
mode:
Diffstat (limited to 'cnn_v3/src/gbuffer_effect.h')
-rw-r--r--cnn_v3/src/gbuffer_effect.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/cnn_v3/src/gbuffer_effect.h b/cnn_v3/src/gbuffer_effect.h
index 13d394d..8e777f8 100644
--- a/cnn_v3/src/gbuffer_effect.h
+++ b/cnn_v3/src/gbuffer_effect.h
@@ -46,6 +46,9 @@ class GBufferEffect : public Effect {
void render(WGPUCommandEncoder encoder, const UniformsSequenceParams& params,
NodeRegistry& nodes) override;
+ // Copies cnn_output_node_ → node_prev_tex_ after all effects have rendered.
+ void post_render(WGPUCommandEncoder encoder, NodeRegistry& nodes) 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();
@@ -68,6 +71,16 @@ class GBufferEffect : public Effect {
std::string node_depth_;
std::string node_shadow_;
std::string node_transp_;
+ std::string node_prev_tex_; // persistent prev-frame CNN output (rgba8unorm)
+
+ // Name of the CNN effect's output node; set by caller before first render.
+ // When non-empty, the CNN output is copied into node_prev_tex_ each frame.
+ std::string cnn_output_node_;
+
+ public:
+ void set_cnn_output_node(const std::string& name) { cnn_output_node_ = name; }
+
+ private:
// Owned scene and camera — populated by set_scene()
Scene scene_;