From 1ed3c22489c4953f47e21fc52822fe58d411a822 Mon Sep 17 00:00:00 2001 From: Pavlos Mavridis Date: Tue, 23 Feb 2021 12:57:48 +0100 Subject: [PATCH] Fixed issue with compositor custom pass hooks added/removed repeatedly --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Runtime/Compositor/CompositionManager.cs | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 5ee255d0390..e8377734d01 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed performance issue with ShaderGraph and Alpha Test - Fixed error when increasing the maximum planar reflection limit (case 1306530). - Fixed alpha output in debug view and AOVs when using shadow matte (case 1311830). +- Fixed issue with compositor custom pass hooks added/removed repeatedly (case 1315971). ### Changed - Changed Window/Render Pipeline/HD Render Pipeline Wizard to Window/Rendering/HDRP Wizard diff --git a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs index 4ebc91559a6..1536e3e7845 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/Compositor/CompositionManager.cs @@ -61,6 +61,10 @@ public bool enableOutput { if (m_OutputCamera) { + // If the state did not change, don't do anything + if (m_OutputCamera.enabled == value) + return; + m_OutputCamera.enabled = value; // Aside from the output compositor camera, we also have to change the cameras of the layers @@ -496,7 +500,7 @@ public void UpdateLayerSetup() void Update() { // TODO: move all validation calls to onValidate. Before doing it, this needs some extra testing to ensure nothing breaks - if (ValidatePipeline() == false || ValidateAndFixRuntime() == false || RuntimeCheck() == false) + if (enableOutput == false || ValidatePipeline() == false || ValidateAndFixRuntime() == false || RuntimeCheck() == false) { return; }