Skip to content

Commit 8c99ef0

Browse files
FrancescoC-unitysebastienlagarde
authored andcommitted
Fix double addition to sorted volume lists #1916
1 parent eceb0f1 commit 8c99ef0

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
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313
- Fixed a null ref exception when baking reflection probes.
1414
- Fixed shadow resolution settings level in the light explorer.
1515
- Fixed rendering of custom passes in the Custom Pass Volume inspector
16+
- Fixed issue with volume manager trying to access a null volume.
1617

1718
## [7.5.1] - 2020-09-02
1819

0 commit comments

Comments
 (0)