Skip to content
This repository was archived by the owner on Nov 30, 2020. It is now read-only.

Commit e7faf73

Browse files
committed
Fix for #402
1 parent 22589c5 commit e7faf73

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

PostProcessing/Runtime/PostProcessLayer.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,11 @@ void OnEnable()
122122
if (RuntimeUtilities.scriptableRenderPipelineActive)
123123
return;
124124

125-
CheckInitLegacy();
125+
InitLegacy();
126126
}
127127

128-
void CheckInitLegacy()
128+
void InitLegacy()
129129
{
130-
if (m_Camera != null && m_CurrentContext != null)
131-
return;
132-
133130
m_LegacyCmdBufferBeforeReflections = new CommandBuffer { name = "Deferred Ambient Occlusion" };
134131
m_LegacyCmdBufferBeforeLighting = new CommandBuffer { name = "Deferred Ambient Occlusion" };
135132
m_LegacyCmdBufferOpaque = new CommandBuffer { name = "Opaque Only Post-processing" };
@@ -272,7 +269,8 @@ void OnPreCull()
272269
if (RuntimeUtilities.scriptableRenderPipelineActive)
273270
return;
274271

275-
CheckInitLegacy();
272+
if (m_Camera == null || m_CurrentContext == null)
273+
InitLegacy();
276274

277275
// Resets the projection matrix from previous frame in case TAA was enabled.
278276
// We also need to force reset the non-jittered projection matrix here as it's not done

0 commit comments

Comments
 (0)