From 5753a6be1de1ba42a4ec34c6e26c3727f7c6019b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Vauchelles?= Date: Thu, 3 Dec 2020 10:09:42 +0100 Subject: [PATCH 1/2] Fixed invalid loop length for probe baking (case 1289680) # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md # Conflicts: # com.unity.render-pipelines.high-definition/CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 1 + .../Editor/Lighting/Reflection/HDBakedReflectionSystem.cs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 7fc7a8cbfc7..9b2205e8577 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -59,6 +59,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed SSGI texture allocation when not using the RenderGraph. - Fixed NullReference Exception when setting Max Shadows On Screen to 0 in the HDRP asset. - Fixed issue with saving some quality settings in volume overrides (case 1293747) +- Fixed NullPointerException when baking probes from the lighting window (case 1289680) - Fixed issue where some ShaderGraph generated shaders were not SRP compatible because of UnityPerMaterial cbuffer layout mismatches [1292501] (https://issuetracker.unity3d.com/issues/a2-some-translucent-plus-alphaclipping-shadergraphs-are-not-srp-batcher-compatible) ### Changed diff --git a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs index 24c687329b2..a07b3fd9edd 100644 --- a/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs +++ b/com.unity.render-pipelines.high-definition/Editor/Lighting/Reflection/HDBakedReflectionSystem.cs @@ -322,7 +322,7 @@ IScriptableBakedReflectionSystemStageNotifier handle // == 5. == // Create new baked state array - var targetSize = m_HDProbeBakedStates.Length + addCount - remCount; + var targetSize = m_HDProbeBakedStates.Length - remCount + toBakeIndicesList.Count; var targetBakedStates = stackalloc HDProbeBakedState[targetSize]; // Copy baked state that are not removed var targetI = 0; @@ -330,12 +330,14 @@ IScriptableBakedReflectionSystemStageNotifier handle { if (CoreUnsafeUtils.IndexOf(remIndices, remCount, i) != -1) continue; + Assert.IsTrue(targetI < targetSize); targetBakedStates[targetI++] = m_HDProbeBakedStates[i]; } // Add new baked states for (int i = 0; i < toBakeIndicesList.Count; ++i) { var state = states[toBakeIndicesList.GetUnchecked(i)]; + Assert.IsTrue(targetI < targetSize); targetBakedStates[targetI++] = new HDProbeBakedState { instanceID = state.instanceID, From 7c3c102201b04cb03bf098f4dd206bb586194e34 Mon Sep 17 00:00:00 2001 From: sebastienlagarde Date: Tue, 15 Dec 2020 14:22:57 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- com.unity.render-pipelines.high-definition/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index 9b2205e8577..a475a46d9d1 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Fixed - Fixed probe volumes debug views. +- Fixed NullPointerException when baking probes from the lighting window (case 1289680) ### Changed - Removed the material pass probe volumes evaluation mode. @@ -59,7 +60,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed SSGI texture allocation when not using the RenderGraph. - Fixed NullReference Exception when setting Max Shadows On Screen to 0 in the HDRP asset. - Fixed issue with saving some quality settings in volume overrides (case 1293747) -- Fixed NullPointerException when baking probes from the lighting window (case 1289680) - Fixed issue where some ShaderGraph generated shaders were not SRP compatible because of UnityPerMaterial cbuffer layout mismatches [1292501] (https://issuetracker.unity3d.com/issues/a2-some-translucent-plus-alphaclipping-shadergraphs-are-not-srp-batcher-compatible) ### Changed