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

Commit 5e6aea3

Browse files
committed
Moved pass numbers to enum
1 parent 95f080f commit 5e6aea3

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

PostProcessing/Runtime/Effects/MultiScaleVO.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ internal enum TextureType
3434
FixedTiledUAV, HalfTiledUAV, FloatTiledUAV // Texture array
3535
}
3636

37+
enum Pass
38+
{
39+
DepthCopy,
40+
CompositionDeferred,
41+
CompositeForward
42+
}
43+
3744
PropertySheet m_PropertySheet;
3845
RTHandle m_DepthCopy;
3946
RTHandle m_LinearDepth;
@@ -335,7 +342,7 @@ void PushDownsampleCommands(PostProcessRenderContext context, CommandBuffer cmd)
335342
{
336343
m_DepthCopy.PushAllocationCommand(cmd);
337344
cmd.SetRenderTarget(m_DepthCopy.id);
338-
cmd.DrawProcedural(Matrix4x4.identity, m_PropertySheet.material, 0, MeshTopology.Triangles, 3);
345+
cmd.DrawProcedural(Matrix4x4.identity, m_PropertySheet.material, (int)Pass.DepthCopy, MeshTopology.Triangles, 3);
339346
}
340347

341348
// Temporary buffer allocations.
@@ -521,7 +528,7 @@ public void RenderAfterOpaque(PostProcessRenderContext context)
521528
DoLazyInitialization(context);
522529
RebuildCommandBuffers(context);
523530
cmd.SetGlobalTexture(ShaderIDs.MSVOcclusionTexture, m_Result.id);
524-
cmd.BlitFullscreenTriangle(context.source, context.destination, m_PropertySheet, 2);
531+
cmd.BlitFullscreenTriangle(context.source, context.destination, m_PropertySheet, (int)Pass.CompositeForward);
525532
cmd.EndSample("Ambient Occlusion");
526533
}
527534

@@ -540,7 +547,7 @@ public void CompositeAmbientOnly(PostProcessRenderContext context)
540547
cmd.BeginSample("Ambient Occlusion Composite");
541548
cmd.SetRenderTarget(m_MRT, BuiltinRenderTextureType.CameraTarget);
542549
cmd.SetGlobalTexture(ShaderIDs.MSVOcclusionTexture, m_Result.id);
543-
cmd.DrawProcedural(Matrix4x4.identity, m_PropertySheet.material, 1, MeshTopology.Triangles, 3, 1, m_PropertySheet.properties);
550+
cmd.DrawProcedural(Matrix4x4.identity, m_PropertySheet.material, (int)Pass.CompositionDeferred, MeshTopology.Triangles, 3, 1, m_PropertySheet.properties);
544551
cmd.EndSample("Ambient Occlusion Composite");
545552
}
546553

0 commit comments

Comments
 (0)