diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 2df55553207..f30f5746b4c 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -28,6 +28,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed virtual texture layer reference names allowing invalid characters [1304146] - Fixed issue with SRP Batcher compatibility [1310624] - Fixed issue with Hybrid renderer compatibility [1296776] +- Fixed an issue where the shader variant limit exceeded message was not getting passed [1304168] (https://issuetracker.unity3d.com/product/unity/issues/guid/1304168) ## [11.0.0] - 2020-10-21 diff --git a/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs b/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs index 245007c9597..ff49b9e64f4 100644 --- a/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs +++ b/com.unity.shadergraph/Editor/Data/Implementation/GraphObject.cs @@ -22,6 +22,11 @@ class GraphObject : ScriptableObject, ISerializationCallbackReceiver [SerializeField] string m_AssetGuid; + internal string AssetGuid + { + get => m_AssetGuid; + } + [NonSerialized] GraphData m_Graph; diff --git a/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs b/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs index 63746047c35..94e08c28fff 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs @@ -113,7 +113,16 @@ void BuildShader() if (m_GraphData.GetKeywordPermutationCount() > ShaderGraphPreferences.variantLimit) { - m_GraphData.AddValidationError(m_OutputNode.objectId, ShaderKeyword.kVariantLimitWarning, Rendering.ShaderCompilerMessageSeverity.Error); + string graphName = ""; + if (m_GraphData.owner != null) + { + string path = AssetDatabase.GUIDToAssetPath(m_GraphData.owner.AssetGuid); + if (path != null) + { + graphName = Path.GetFileNameWithoutExtension(path); + } + } + Debug.LogError($"Error in Shader Graph {graphName}:{ShaderKeyword.kVariantLimitWarning}"); m_ConfiguredTextures = shaderProperties.GetConfiguredTextures(); m_Builder.AppendLines(ShaderGraphImporter.k_ErrorShader);