Skip to content

Commit 0568ebf

Browse files
FrancescoC-unitysebastienlagarde
authored andcommitted
Fix double addition to sorted volume lists #1916
1 parent 6a042bd commit 0568ebf

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

com.unity.render-pipelines.core/Runtime/Volume/VolumeManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ public void Register(Volume volume, int layer)
124124
// Look for existing cached layer masks and add it there if needed
125125
foreach (var kvp in m_SortedVolumes)
126126
{
127-
if ((kvp.Key & (1 << layer)) != 0)
127+
// We add the volume to sorted lists only if the layer match and if it doesn't contain the volume already.
128+
if ((kvp.Key & (1 << layer)) != 0 && !kvp.Value.Contains(volume))
128129
kvp.Value.Add(volume);
129130
}
130131

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3131
- Fixed an issue where even when set to OnDemand, the sky lighting would still be updated when changing sky parameters.
3232
- Fixed SSS materials appearing black in matcap mode.
3333
- Fixed rendering of custom passes in the Custom Pass Volume inspector
34+
- Fixed issue with volume manager trying to access a null volume.
3435

3536
### Changed
3637
- Remove MSAA debug mode when renderpipeline asset has no MSAA

0 commit comments

Comments
 (0)