From 721c0e7c3ab66aaee54cf5e0f369e7471c8b4bcf Mon Sep 17 00:00:00 2001 From: Timon Date: Fri, 12 Jun 2026 20:22:23 +0000 Subject: [PATCH] Move `TaggedValue::ResourceHash` to macro definition site --- node-graph/graph-craft/src/document/value.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/node-graph/graph-craft/src/document/value.rs b/node-graph/graph-craft/src/document/value.rs index ab137a24c9..c5d11cafbd 100644 --- a/node-graph/graph-craft/src/document/value.rs +++ b/node-graph/graph-craft/src/document/value.rs @@ -90,6 +90,9 @@ macro_rules! tagged_value { ContextFeatures(ContextFeatures), #[serde(skip)] EditorApi(Arc), + /// Only used by the `resource` node, should never be serialized + #[serde(skip)] + ResourceHash(graphene_application_io::resource::ResourceHash), } impl CacheHash for TaggedValue { @@ -117,6 +120,7 @@ macro_rules! tagged_value { Self::ContextFeatures(features) => features.cache_hash(state), Self::RenderOutput(x) => x.cache_hash(state), Self::EditorApi(x) => x.cache_hash(state), + Self::ResourceHash(x) => x.cache_hash(state), } } } @@ -170,6 +174,7 @@ macro_rules! tagged_value { Self::DocumentNode(node) => Box::new(node), Self::ContextFeatures(features) => Box::new(features), Self::EditorApi(x) => Box::new(x), + Self::ResourceHash(x) => Box::new(x), } } @@ -219,6 +224,7 @@ macro_rules! tagged_value { Self::DocumentNode(node) => Arc::new(node), Self::ContextFeatures(features) => Arc::new(features), Self::EditorApi(x) => Arc::new(x), + Self::ResourceHash(x) => Arc::new(x), } } @@ -246,6 +252,7 @@ macro_rules! tagged_value { Self::DocumentNode(_) => concrete!(DocumentNode), Self::ContextFeatures(_) => concrete!(ContextFeatures), Self::EditorApi(_) => concrete!(&PlatformEditorApi), + Self::ResourceHash(_) => concrete!(graphene_application_io::resource::ResourceHash), } } @@ -351,6 +358,7 @@ macro_rules! tagged_value { Self::DocumentNode(node) => format!("DocumentNode({node:?})"), Self::ContextFeatures(features) => format!("ContextFeatures({features:?})"), Self::EditorApi(_) => "PlatformEditorApi".to_string(), + Self::ResourceHash(hash) => format!("ResourceHash({hash:?})"), } } } @@ -397,7 +405,6 @@ tagged_value! { VectorModification(Box), ImageData(Image), Resource(graphene_application_io::resource::ResourceId), - ResourceHash(graphene_application_io::resource::ResourceHash), // ========== // ENUM TYPES // ==========