diff --git a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs index 0a391e2f87c..5102a634fd6 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Material/ShaderGraph/HDShaderPasses.cs @@ -238,7 +238,7 @@ public static PassDescriptor GenerateDepthForwardOnlyPass(bool supportLighting) RenderStateCollection GenerateRenderState() { - var renderState = CoreRenderStates.DepthOnly; + var renderState = new RenderStateCollection{ CoreRenderStates.DepthOnly }; if (!supportLighting) { diff --git a/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs b/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs index 19465d77189..fe20bb9fdc1 100644 --- a/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs +++ b/com.unity.shadergraph/Editor/Generation/Processors/Generator.cs @@ -389,7 +389,11 @@ void ProcessStackForPass(ContextData contextData, BlockFieldDescriptor[] passBlo if(renderState.TestActive(activeFields)) { renderStateBuilder.AppendLine(renderState.value); - break; + + // Cull is the only render state type that causes a compilation error + // when there are multiple Cull directive with different values in a pass. + if (type == RenderStateType.Cull) + break; } } }