diff --git a/com.unity.render-pipelines.high-definition/CHANGELOG.md b/com.unity.render-pipelines.high-definition/CHANGELOG.md index d2be1a036f8..e8f743772e4 100644 --- a/com.unity.render-pipelines.high-definition/CHANGELOG.md +++ b/com.unity.render-pipelines.high-definition/CHANGELOG.md @@ -69,6 +69,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fixed Correlated Color Temperature not being applied in Player builds for Enlighten realtime GI lights (case 1370438); - Fixed artifacts on gpu light culling when the frustum near and far are very spread out (case 1386436) - Fixed missing unit in ray tracing related tooltips and docs (case 1397491). +- Fixed errors spamming when in player mode due to ray tracing light cluster debug view (case 1390471). ## [14.0.0] - 2021-11-17 diff --git a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs index e4661374205..4b699c55d34 100644 --- a/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs +++ b/com.unity.render-pipelines.high-definition/Runtime/RenderPipeline/Raytracing/HDRaytracingLightCluster.cs @@ -621,7 +621,7 @@ class LightClusterDebugPassData public int lightClusterDebugKernel; public Vector3 clusterCellSize; public Material debugMaterial; - public ComputeBuffer lightCluster; + public ComputeBufferHandle lightCluster; public ComputeShader lightClusterDebugCS; public TextureHandle depthStencilBuffer; @@ -631,6 +631,10 @@ class LightClusterDebugPassData public void EvaluateClusterDebugView(RenderGraph renderGraph, HDCamera hdCamera, TextureHandle depthStencilBuffer, TextureHandle depthPyramid) { + // TODO: Investigate why this behavior causes a leak in player mode only. + if (FullScreenDebugMode.LightCluster != m_RenderPipeline.m_CurrentDebugDisplaySettings.data.fullScreenDebugMode) + return; + TextureHandle debugTexture; using (var builder = renderGraph.AddRenderPass("Debug Texture for the Light Cluster", out var passData, ProfilingSampler.Get(HDProfileId.RaytracingDebugCluster))) { @@ -639,7 +643,7 @@ public void EvaluateClusterDebugView(RenderGraph renderGraph, HDCamera hdCamera, passData.texWidth = hdCamera.actualWidth; passData.texHeight = hdCamera.actualHeight; passData.clusterCellSize = clusterCellSize; - passData.lightCluster = m_LightCluster; + passData.lightCluster = builder.ReadComputeBuffer(renderGraph.ImportComputeBuffer(m_LightCluster)); passData.lightClusterDebugCS = m_RenderPipelineRayTracingResources.lightClusterDebugCS; passData.lightClusterDebugKernel = passData.lightClusterDebugCS.FindKernel("DebugLightCluster"); passData.debugMaterial = m_DebugMaterial;