From e6a8d5c5733816f0e6ba4536776e4766ce020f20 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Thu, 16 Feb 2023 15:00:08 +0100 Subject: [PATCH] Add input caching to old blur implementation (#1018) --- node-graph/interpreted-executor/src/node_registry.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node-graph/interpreted-executor/src/node_registry.rs b/node-graph/interpreted-executor/src/node_registry.rs index 804985a7..6910f2df 100644 --- a/node-graph/interpreted-executor/src/node_registry.rs +++ b/node-graph/interpreted-executor/src/node_registry.rs @@ -7,7 +7,7 @@ use std::collections::HashMap; use graphene_core::raster::color::Color; use graphene_core::raster::*; use graphene_core::structural::Then; -use graphene_core::value::{ForgetNode, ValueNode}; +use graphene_core::value::{ClonedNode, ForgetNode, ValueNode}; use graphene_core::{Node, NodeIO, NodeIOTypes}; use graphene_std::any::{ComposeTypeErased, DowncastBothNode, DowncastBothRefNode, DynAnyNode, IntoTypeErasedNode}; @@ -175,6 +175,9 @@ fn node_registry() -> HashMap::new(args[2]); let empty_image: ValueNode = ValueNode::new(Image::empty()); let empty: TypeNode<_, (), Image> = TypeNode::new(empty_image.then(CloneNode::new())); + use graphene_core::Node; + let radius = ClonedNode::new(radius.eval(())); + let sigma = ClonedNode::new(sigma.eval(())); //let image = &image as &dyn for<'a> Node<'a, (), Output = &'a Image>; // dirty hack: we abuse that the cache node will ignore the input if it is evaluated a second time