From 2737a41bc475c10e76f45ddf64e38ffe7c5d33e1 Mon Sep 17 00:00:00 2001 From: Robert Cupisz Date: Mon, 15 Oct 2018 23:29:29 +0200 Subject: [PATCH] Fix leaking buffer --- Assets/VolumetricFog/Scripts/VolumetricFog.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/VolumetricFog/Scripts/VolumetricFog.cs b/Assets/VolumetricFog/Scripts/VolumetricFog.cs index d0f34c3..c9a8fc4 100644 --- a/Assets/VolumetricFog/Scripts/VolumetricFog.cs +++ b/Assets/VolumetricFog/Scripts/VolumetricFog.cs @@ -493,8 +493,6 @@ public class VolumetricFog : MonoBehaviour m_ambientLight[2] = ambient.b; m_InjectLightingAndDensity.SetFloats("_AmbientLight", m_ambientLight); - m_DummyCB = new ComputeBuffer(1, 4); - SetUpPointLightBuffers(kernel); SetUpTubeLightBuffers(kernel); SetUpAreaLightBuffers(kernel); @@ -682,6 +680,8 @@ public class VolumetricFog : MonoBehaviour // FogEllipsoidParams {float3 float float3 9xfloat} -> 64 bytes HashSet fogEllipsoids = LightManagerFogEllipsoids.Get(); CreateBuffer(ref m_FogEllipsoidParamsCB, fogEllipsoids == null ? 0 : fogEllipsoids.Count, 64); + + CreateBuffer(ref m_DummyCB, 1, 4); } void ReleaseTemporary(ref RenderTexture rt)