@@ -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