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 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() {