Skip to content

Commit 219adba

Browse files
Init order fix for post process
1 parent 43abae6 commit 219adba

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

com.unity.render-pipelines.high-definition/Runtime/PostProcessing/PostProcessSystem.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources
160160
var postProcessSettings = hdAsset.currentPlatformRenderPipelineSettings.postProcessSettings;
161161
m_LutSize = postProcessSettings.lutSize;
162162

163-
// Call after initializing m_LutSize as it's needed for render target allocation.
164-
InitializeNonRenderGraphResources(hdAsset);
165-
166163
// Grading specific
167164
m_HableCurve = new HableCurve();
168165

@@ -172,8 +169,6 @@ public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources
172169
// TODO: Write a version that uses structured buffer instead of texture to do atomic as Metal doesn't support atomics on textures.
173170
m_MotionBlurSupportsScattering = m_MotionBlurSupportsScattering && (SystemInfo.graphicsDeviceType != GraphicsDeviceType.Metal);
174171

175-
FillEmptyExposureTexture();
176-
177172
// Initialize our target pool to ease RT management
178173
m_Pool = new TargetPool();
179174

@@ -192,6 +187,9 @@ public PostProcessSystem(HDRenderPipelineAsset hdAsset, RenderPipelineResources
192187
// if only rendering has an alpha channel (and not post-processing), then we just copy the alpha to the output (but we don't process it).
193188
m_KeepAlpha = hdAsset.currentPlatformRenderPipelineSettings.supportsAlpha;
194189
}
190+
191+
// Call after initializing m_LutSize and m_KeepAlpha as it's needed for render target allocation.
192+
InitializeNonRenderGraphResources(hdAsset);
195193
}
196194

197195
public void Cleanup()
@@ -257,6 +255,8 @@ public void InitializeNonRenderGraphResources(HDRenderPipelineAsset hdAsset)
257255
enableRandomWrite: true, name: "Empty EV100 Exposure"
258256
);
259257

258+
FillEmptyExposureTexture();
259+
260260
// Misc targets
261261
m_TempTexture1024 = RTHandles.Alloc(
262262
1024, 1024, colorFormat: GraphicsFormat.R16G16_SFloat,

0 commit comments

Comments
 (0)