@@ -34,6 +34,13 @@ internal enum TextureType
34
34
FixedTiledUAV , HalfTiledUAV , FloatTiledUAV // Texture array
35
35
}
36
36
37
+ enum Pass
38
+ {
39
+ DepthCopy ,
40
+ CompositionDeferred ,
41
+ CompositeForward
42
+ }
43
+
37
44
PropertySheet m_PropertySheet ;
38
45
RTHandle m_DepthCopy ;
39
46
RTHandle m_LinearDepth ;
@@ -335,7 +342,7 @@ void PushDownsampleCommands(PostProcessRenderContext context, CommandBuffer cmd)
335
342
{
336
343
m_DepthCopy . PushAllocationCommand ( cmd ) ;
337
344
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 ) ;
339
346
}
340
347
341
348
// Temporary buffer allocations.
@@ -521,7 +528,7 @@ public void RenderAfterOpaque(PostProcessRenderContext context)
521
528
DoLazyInitialization ( context ) ;
522
529
RebuildCommandBuffers ( context ) ;
523
530
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 ) ;
525
532
cmd . EndSample ( "Ambient Occlusion" ) ;
526
533
}
527
534
@@ -540,7 +547,7 @@ public void CompositeAmbientOnly(PostProcessRenderContext context)
540
547
cmd . BeginSample ( "Ambient Occlusion Composite" ) ;
541
548
cmd . SetRenderTarget ( m_MRT , BuiltinRenderTextureType . CameraTarget ) ;
542
549
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 ) ;
544
551
cmd . EndSample ( "Ambient Occlusion Composite" ) ;
545
552
}
546
553
0 commit comments