From 9866ce55b20160f628335df7abc854f08ddeaf60 Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Wed, 1 Dec 2021 16:09:21 -0800 Subject: [PATCH 1/2] Fix for 1383046 (already fixed in 2022.1+ via another much larger PR, this addresses just this specific issue for 2021.2) --- com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs b/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs index a887f2393fe..d99eedb15fe 100644 --- a/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs +++ b/com.unity.shadergraph/Editor/Data/Util/FunctionRegistry.cs @@ -55,7 +55,9 @@ public void ProvideFunction(string name, GraphPrecision graphPrecision, Concrete var startIndex = builder.length; generator(builder); var length = builder.length - startIndex; - var code = builder.ToString(startIndex, length); + + // trim fixes mismatched whitespace issue when nodes come from subgraphs + var code = builder.ToString(startIndex, length).Trim(); // validate some assumptions around generics bool isGenericName = name.Contains("$"); From 04eba287028d4c6ff3bfa108f312d4b598ed691f Mon Sep 17 00:00:00 2001 From: Chris Tchou Date: Wed, 1 Dec 2021 16:28:38 -0800 Subject: [PATCH 2/2] Adding changelog --- com.unity.shadergraph/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 25db46e8f78..1d3a2984611 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. Version Updated The version number for this package has increased due to a version update of a related graphics package. +### Fixed + - Fixed a validation error in ShaderGraph when using the SimpleNoise node both inside and outside a subgraph [1383046] (https://issuetracker.unity3d.com/issues/validation-error-is-usually-thrown-when-simple-noise-node-is-both-in-a-shadergraph-and-in-a-sub-graph) + ## [12.1.2] - 2021-10-22 ### Fixed