Bug when using Probe Volume (Unity 2023.2.0b15 - HDRP)

I’m using the new Probe Volume to replace the Light Probe in my project in Unity 2023.2.0b15 with HDRP. But when loading the scene I am getting an error endlessly. The editor no longer displays the level, forcing me to close and open it again. When I change to Light Probe the problem disappears.

Here is the error that appears in the debug:

ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: Bad indices/count arguments (managedBufferStartIndex:900 computeBufferStartIndex:900 count:-11)
UnityEngine.ComputeBuffer.SetData(System.Array data, System.Int32 managedBufferStartIndex, System.Int32 computeBufferStartIndex, System.Int32 count) (at <9ed359828c3647ccacf057308e97ae3e>:0)
UnityEngine.Rendering.ProbeBrickIndex.UploadIndexData() (at ./Library/PackageCache/com.unity.render-pipelines.core@16.0.4/Runtime/Lighting/ProbeVolume/ProbeBrickIndex.cs:179)
UnityEngine.Rendering.ProbeBrickIndex.GetRuntimeResources (UnityEngine.Rendering.ProbeReferenceVolume+RuntimeResources& rr) (at ./Library/PackageCache/com.unity.render-pipelines.core@16.0.4/Runtime/Lighting/ProbeVolume/ProbeBrickIndex.cs:278 )
UnityEngine.Rendering.ProbeReferenceVolume.GetRuntimeResources() (at ./Library/PackageCache/com.unity.render-pipelines.core@16.0.4/Runtime/Lighting/ProbeVolume/ProbeReferenceVolume.cs:1520)
Unityengine.Rendering.Probereference Volume.bindapvruntimeresources (unityengine.rendering.commandbuffer cmdbuffer, System.boolean isprobevolumeenable) Probevolume/probereference volvate. Binding.cs:40)
UnityEngine.Rendering.HighDefinition.HDRenderPipeline.ExecuteRenderRequest (UnityEngine.Rendering.HighDefinition.HDRenderPipeline+RenderRequest renderRequest, UnityEngine.Rendering.ScriptableRenderContext renderContext, UnityEngine.Rendering.CommandBuffer cmd, UnityEngine.Rendering.HighDefinition.AOVRequestData aovRequest ) (at ./Library/ PackageCache/com.unity.render-pipelines.high-definition@16.0.4/Runtime/RenderPipeline/HDRenderPipeline.cs:2632)
UnityEngine.Rendering.HighDefinition.HDRenderPipeline.Render (UnityEngine.Rendering.ScriptableRenderContext renderContext, System.Collections.Generic.List1[T] cameras) (at ./Library/PackageCache/com.unity.render-pipelines.high-definition @16.0.4/Runtime/RenderPipeline/HDRenderPipeline.cs:2272) UnityEngine.Rendering.RenderPipeline.InternalRender (UnityEngine.Rendering.ScriptableRenderContext context, System.Collections.Generic.List1[T] cameras) (at <9ed359828c3647ccacf057308e97ae3e>:0)
UnityEngine.Rendering.RenderPipelineManager.DoRenderLoop_Internal (UnityEngine.Rendering.RenderPipelineAsset pipe, System.IntPtr loopPtr, UnityEngine.Object renderRequest, Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle safety) (at <9ed359828c3647ccacf057308e97ae3 e>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

Hey. I suggest you file a bug report on this - looks like a bug to me.

1 Like

Thanks for the feedback! I will create the report!

Hi @BadRoomStudio , I’m hitting this bug as well, could I grab a link to bug so I can follow it’s progress?

Hi everyone, I can give a little more context in case it helps. The issues happens in ProbeBrickIndex.cs starting on line 636. When m_UpdateMinIndex and m_UpdateMaxIndex are calculated, sometimes the min index is greater than the max index, and that’s what’s causing the ArgumentOutOfRangeException:

            // Analytically compute min and max because doing it in the inner loop with Math.Min/Max is costly (not inlined)
            int chunkStart = entryInfo.firstChunkIndex * kIndexChunkSize;
            int newMin = chunkStart + brickMin.z * (size.x * size.y) + brickMin.x * size.y + brickMin.y;
            int newMax = chunkStart + Math.Max(0, (brickMax.z - 1)) * (size.x * size.y) + Math.Max(0, (brickMax.x - 1)) * size.y + Math.Max(0, (brickMax.y - 1));
            m_UpdateMinIndex = Math.Min(m_UpdateMinIndex, newMin);
            m_UpdateMaxIndex = Math.Max(m_UpdateMaxIndex, newMax);