Skip to content

Commit 964ab96

Browse files
Fix double addition to sorted list (#1916)
1 parent 786e269 commit 964ab96

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

com.unity.render-pipelines.core/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ The version number for this package has increased due to a version update of a r
5757
- Fix hierarchicalbox gizmo outside facing check in symetry or homothety mode no longer move the center
5858
- Fix artifacts on Adreno 630 GPUs when using ACES Tonemapping
5959
- Fixed a null ref in the volume component list when there is no volume components in the project.
60+
- Fixed issue with volume manager trying to access a null volume.
6061

6162
### Changed
6263
- Restored usage of ENABLE_VR to fix compilation errors on some platforms.

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

0 commit comments

Comments
 (0)