@@ -305,8 +305,6 @@ void BuildCommandBuffers()
305305 context . camera = m_Camera ;
306306 context . sourceFormat = sourceFormat ;
307307
308- var tempDescriptor = context . GetDescriptor ( 24 , sourceFormat ) ;
309-
310308 // TODO: Investigate retaining command buffers on XR multi-pass right eye
311309 m_LegacyCmdBufferBeforeReflections . Clear ( ) ;
312310 m_LegacyCmdBufferBeforeLighting . Clear ( ) ;
@@ -370,7 +368,7 @@ void BuildCommandBuffers()
370368 // We need to use the internal Blit method to copy the camera target or it'll fail
371369 // on tiled GPU as it won't be able to resolve
372370 int tempTarget0 = m_TargetPool . Get ( ) ;
373- cmd . GetTemporaryRT ( tempTarget0 , tempDescriptor , FilterMode . Bilinear ) ;
371+ context . GetScreenSpaceTemporaryRT ( cmd , tempTarget0 , 24 , sourceFormat ) ;
374372 cmd . Blit ( cameraTarget , tempTarget0 ) ;
375373 context . source = tempTarget0 ;
376374
@@ -379,7 +377,7 @@ void BuildCommandBuffers()
379377 if ( opaqueOnlyEffects > 1 )
380378 {
381379 tempTarget1 = m_TargetPool . Get ( ) ;
382- cmd . GetTemporaryRT ( tempTarget1 , tempDescriptor , FilterMode . Bilinear ) ;
380+ context . GetScreenSpaceTemporaryRT ( cmd , tempTarget1 , 24 , sourceFormat ) ;
383381 context . destination = tempTarget1 ;
384382 }
385383 else context . destination = cameraTarget ;
@@ -415,7 +413,7 @@ void BuildCommandBuffers()
415413 // Same as before, first blit needs to use the builtin Blit command to properly handle
416414 // tiled GPUs
417415 int tempRt = m_TargetPool . Get ( ) ;
418- m_LegacyCmdBuffer . GetTemporaryRT ( tempRt , tempDescriptor , FilterMode . Bilinear ) ;
416+ context . GetScreenSpaceTemporaryRT ( m_LegacyCmdBuffer , tempRt , 24 , sourceFormat ) ;
419417 m_LegacyCmdBuffer . Blit ( cameraTarget , tempRt , RuntimeUtilities . copyStdMaterial , stopNaNPropagation ? 1 : 0 ) ;
420418 m_NaNKilled = stopNaNPropagation ;
421419
@@ -600,8 +598,6 @@ public void Render(PostProcessRenderContext context)
600598 TextureLerper . instance . BeginFrame ( context ) ;
601599 var cmd = context . command ;
602600
603- var tempDescriptor = context . GetDescriptor ( 24 , context . sourceFormat ) ;
604-
605601 // Update & override layer settings first (volume blending) if the opaque only pass
606602 // hasn't been called this frame.
607603 UpdateSettingsIfNeeded ( context ) ;
@@ -611,7 +607,7 @@ public void Render(PostProcessRenderContext context)
611607 if ( stopNaNPropagation && ! m_NaNKilled )
612608 {
613609 lastTarget = m_TargetPool . Get ( ) ;
614- cmd . GetTemporaryRT ( lastTarget , tempDescriptor , FilterMode . Bilinear ) ;
610+ context . GetScreenSpaceTemporaryRT ( cmd , lastTarget , 24 , context . sourceFormat ) ;
615611 cmd . BlitFullscreenTriangle ( context . source , lastTarget , RuntimeUtilities . copySheet , 1 ) ;
616612 context . source = lastTarget ;
617613 m_NaNKilled = true ;
@@ -636,7 +632,7 @@ public void Render(PostProcessRenderContext context)
636632
637633 var taaTarget = m_TargetPool . Get ( ) ;
638634 var finalDestination = context . destination ;
639- cmd . GetTemporaryRT ( taaTarget , tempDescriptor , FilterMode . Bilinear ) ;
635+ context . GetScreenSpaceTemporaryRT ( cmd , taaTarget , 24 , context . sourceFormat ) ;
640636 context . destination = taaTarget ;
641637 temporalAntialiasing . Render ( context ) ;
642638 context . source = taaTarget ;
@@ -686,7 +682,7 @@ int RenderInjectionPoint(PostProcessEvent evt, PostProcessRenderContext context,
686682 var finalDestination = context . destination ;
687683
688684 var cmd = context . command ;
689- cmd . GetTemporaryRT ( tempTarget , context . GetDescriptor ( 24 , context . sourceFormat ) , FilterMode . Bilinear ) ;
685+ context . GetScreenSpaceTemporaryRT ( cmd , tempTarget , 24 , context . sourceFormat ) ;
690686 context . destination = tempTarget ;
691687 RenderList ( sortedBundles [ evt ] , context , marker ) ;
692688 context . source = tempTarget ;
@@ -737,10 +733,9 @@ void RenderList(List<SerializedBundleRef> list, PostProcessRenderContext context
737733 m_Targets . Add ( context . destination ) ; // Last target is always destination
738734
739735 // Render
740- var tempDescriptor = context . GetDescriptor ( 24 , context . sourceFormat ) ;
741- cmd . GetTemporaryRT ( tempTarget1 , tempDescriptor , FilterMode . Bilinear ) ;
736+ context . GetScreenSpaceTemporaryRT ( cmd , tempTarget1 , 24 , context . sourceFormat ) ;
742737 if ( count > 2 )
743- cmd . GetTemporaryRT ( tempTarget2 , tempDescriptor , FilterMode . Bilinear ) ;
738+ context . GetScreenSpaceTemporaryRT ( cmd , tempTarget2 , 24 , context . sourceFormat ) ;
744739
745740 for ( int i = 0 ; i < count ; i ++ )
746741 {
@@ -775,7 +770,7 @@ int RenderBuiltins(PostProcessRenderContext context, bool isFinalPass, int relea
775770 {
776771 // Render to an intermediate target as this won't be the final pass
777772 tempTarget = m_TargetPool . Get ( ) ;
778- cmd . GetTemporaryRT ( tempTarget , context . GetDescriptor ( 24 , context . sourceFormat ) , FilterMode . Bilinear ) ;
773+ context . GetScreenSpaceTemporaryRT ( cmd , tempTarget , 24 , context . sourceFormat ) ;
779774 context . destination = tempTarget ;
780775
781776 // Handle FXAA's keep alpha mode
@@ -866,7 +861,7 @@ void RenderFinalPass(PostProcessRenderContext context, int releaseTargetAfterUse
866861 {
867862 tempTarget = m_TargetPool . Get ( ) ;
868863 var finalDestination = context . destination ;
869- context . command . GetTemporaryRT ( tempTarget , context . GetDescriptor ( 24 , context . sourceFormat ) , FilterMode . Bilinear ) ;
864+ context . GetScreenSpaceTemporaryRT ( context . command , tempTarget , 24 , context . sourceFormat ) ;
870865 context . destination = tempTarget ;
871866 subpixelMorphologicalAntialiasing . Render ( context ) ;
872867 context . source = tempTarget ;
@@ -906,7 +901,7 @@ int RenderEffect<T>(PostProcessRenderContext context, bool useTempTarget = false
906901
907902 var finalDestination = context . destination ;
908903 var tempTarget = m_TargetPool . Get ( ) ;
909- context . command . GetTemporaryRT ( tempTarget , context . GetDescriptor ( 24 , context . sourceFormat ) , FilterMode . Bilinear ) ;
904+ context . GetScreenSpaceTemporaryRT ( context . command , tempTarget , 24 , context . sourceFormat ) ;
910905 context . destination = tempTarget ;
911906 effect . renderer . Render ( context ) ;
912907 context . source = tempTarget ;
0 commit comments