Skip to content

Commit d85eec1

Browse files
anisunitysebastienlagarde
authored andcommitted
Fixed potential asymmetrical resource release in the volumetric clouds (case 1388218). #6600
1 parent 2574e77 commit d85eec1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1212
- Fixed rendering in the editor when an incompatible API is added (case 1384634).
1313
- Fixed the fade in mode of the clouds not impacting the volumetric clouds shadows (case 1381652).
1414
- Fixed issue with typed loads on RGBA16F in Volumetric Lighting Filtering.
15+
- Fixed potential asymmetrical resource release in the volumetric clouds (case 1388218).
1516

1617
## [13.1.4] - 2021-12-04
1718

com.unity.render-pipelines.high-definition/Runtime/Lighting/VolumetricLighting/HDRenderPipeline.VolumetricClouds.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public partial class HDRenderPipeline
3232
int m_CombineCloudsKernelColorCopy;
3333
int m_CombineCloudsKernelColorRW;
3434
int m_CombineCloudsSkyKernel;
35+
bool m_ActiveVolumetricClouds;
3536

3637
// Combine pass via hardware blending, used in case of MSAA color target.
3738
Material m_CloudCombinePass;
@@ -53,7 +54,9 @@ struct VolumetricCloudsCameraData
5354

5455
void InitializeVolumetricClouds()
5556
{
56-
if (!m_Asset.currentPlatformRenderPipelineSettings.supportVolumetricClouds)
57+
// Keep track of the state for the release
58+
m_ActiveVolumetricClouds = m_Asset.currentPlatformRenderPipelineSettings.supportVolumetricClouds;
59+
if (!m_ActiveVolumetricClouds)
5760
return;
5861

5962
// Allocate the buffers for ambient probe evaluation
@@ -92,7 +95,7 @@ void InitializeVolumetricClouds()
9295

9396
void ReleaseVolumetricClouds()
9497
{
95-
if (!m_Asset.currentPlatformRenderPipelineSettings.supportVolumetricClouds)
98+
if (!m_ActiveVolumetricClouds)
9699
return;
97100

98101
// Destroy the material

0 commit comments

Comments
 (0)