Browse Source

Use the correct method to release temporary render textures. Fixes memory leaks from RT's not getting released properly.

stable
Nico de Poel 3 years ago
parent
commit
1a063e971f
  1. 5
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs

5
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/PostProcessLayer.cs

@ -286,7 +286,7 @@ namespace UnityEngine.Rendering.PostProcessing
{ {
if (m_opaqueOnly != null) if (m_opaqueOnly != null)
{ {
m_opaqueOnly.Release();
RenderTexture.ReleaseTemporary(m_opaqueOnly);
m_opaqueOnly = null; m_opaqueOnly = null;
} }
@ -297,7 +297,8 @@ namespace UnityEngine.Rendering.PostProcessing
// Blit the upscaled image to the backbuffer // Blit the upscaled image to the backbuffer
Graphics.Blit(m_upscaledOutput, dst); Graphics.Blit(m_upscaledOutput, dst);
m_upscaledOutput.Release();
RenderTexture.ReleaseTemporary(m_upscaledOutput);
m_upscaledOutput = null;
return; return;
} }

Loading…
Cancel
Save