From 8c1c3a491cc28151d22099b2d693c0b12abe42ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Thu, 17 Dec 2020 12:51:41 +0100 Subject: [PATCH 1/2] Changed the behavior of custom passes when the Custom Pass Volume component is disabled --- .../RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs index 4979f357f1c..3f5c5c4ad01 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/RenderPass/CustomPass/CustomPassVolume.cs @@ -88,13 +88,12 @@ void OnEnable() void OnDisable() { UnRegister(this); + CleanupPasses(); #if UNITY_EDITOR UnityEditor.SceneVisibilityManager.visibilityChanged -= UpdateCustomPassVolumeVisibility; #endif } - void OnDestroy() => CleanupPasses(); - #if UNITY_EDITOR void UpdateCustomPassVolumeVisibility() { From a152ab8b499f2a1d5df6952db6c636139ec12c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antoine=20Leli=C3=A8vre?= Date: Thu, 17 Dec 2020 12:52:52 +0100 Subject: [PATCH 2/2] Updated changelog --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7ac109f0b0f..156ca20d8a2 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. - When in half res, RTR denoising is executed at half resolution and the upscale happens at the end. - Removed the upscale radius from the RTR. - Changed the message when the graphics device doesn't support ray tracing (case 1287355). +- When a Custom Pass Volume is disabled, the custom pass Cleanup() function is called, it allows to release resources when the volume isn't used anymore. ## [10.3.0] - 2020-12-01