summaryrefslogtreecommitdiff
path: root/src/gpu/effect.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effect.h')
-rw-r--r--src/gpu/effect.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gpu/effect.h b/src/gpu/effect.h
index 8055783..6c50d84 100644
--- a/src/gpu/effect.h
+++ b/src/gpu/effect.h
@@ -34,6 +34,20 @@ class Effect {
const UniformsSequenceParams& params,
NodeRegistry& nodes) = 0;
+ // Called after ALL effects in the sequence have rendered for this frame.
+ // Use for end-of-frame bookkeeping (e.g. copying temporal feedback buffers).
+ virtual void post_render(WGPUCommandEncoder encoder, NodeRegistry& nodes) {
+ (void)encoder;
+ (void)nodes;
+ }
+
+ // Called once after the full DAG is built (init_effect_nodes).
+ // Override to auto-wire inter-effect dependencies (e.g. temporal feedback).
+ // Default is a no-op.
+ virtual void wire_dag(const std::vector<struct EffectDAGNode>& dag) {
+ (void)dag;
+ }
+
virtual void resize(int width, int height) {
width_ = width;
height_ = height;
@@ -60,6 +74,13 @@ class Effect {
Texture dummy_texture_;
TextureView dummy_texture_view_;
+ // DAG query helpers (callable from wire_dag overrides)
+ //
+ // Returns output_nodes[0] of the first effect in |dag| whose input_nodes
+ // intersect this effect's output_nodes_ (i.e. the first direct downstream
+ // consumer). Returns "" if no such effect exists or it has no outputs.
+ std::string find_downstream_output(const std::vector<EffectDAGNode>& dag) const;
+
// Helper: Create linear sampler (call in subclass constructor if needed)
void create_linear_sampler();