@ -102,6 +102,7 @@ namespace UnityEngine.Rendering.PostProcessing
public Vector2 jitter { get ; private set ; }
public Vector2Int renderSize = > _renderSize ;
public Vector2Int displaySize = > _displaySize ;
public RenderTargetIdentifier colorOpaqueOnly { get ; set ; }
private Fsr2Context _fsrContext ;
private Vector2Int _renderSize ;
@ -163,7 +164,7 @@ namespace UnityEngine.Rendering.PostProcessing
context . camera . rect = _originalRect ;
}
public void Render ( PostProcessRenderContext context , RenderTargetIdentifier opaqueOnly )
public void Render ( PostProcessRenderContext context )
{
var cmd = context . command ;
cmd . BeginSample ( "FSR2" ) ;
@ -180,11 +181,11 @@ namespace UnityEngine.Rendering.PostProcessing
cmd . SetGlobalTexture ( Fsr2ShaderIDs . SrvInputDepth , BuiltinRenderTextureType . CameraTarget , RenderTextureSubElement . Depth ) ;
cmd . SetGlobalTexture ( Fsr2ShaderIDs . SrvInputMotionVectors , BuiltinRenderTextureType . MotionVectors ) ;
SetupDispatchDescription ( context , opaqueOnly ) ;
SetupDispatchDescription ( context ) ;
if ( autoGenerateReactiveMask )
{
SetupAutoReactiveDescription ( context , opaqueOnly ) ;
SetupAutoReactiveDescription ( context ) ;
cmd . GetTemporaryRT ( Fsr2ShaderIDs . UavAutoReactive , _renderSize . x , _renderSize . y , 0 , default , GraphicsFormat . R8_UNorm , 1 , true ) ;
_fsrContext . GenerateReactiveMask ( _genReactiveDescription , cmd ) ;
@ -263,7 +264,7 @@ namespace UnityEngine.Rendering.PostProcessing
jitter = new Vector2 ( jitterX , jitterY ) ;
}
private void SetupDispatchDescription ( PostProcessRenderContext context , RenderTargetIdentifier opaqueOnly )
private void SetupDispatchDescription ( PostProcessRenderContext context )
{
var camera = context . camera ;
@ -299,7 +300,7 @@ namespace UnityEngine.Rendering.PostProcessing
_dispatchDescription . EnableAutoReactive = autoGenerateTransparencyAndComposition ;
if ( autoGenerateTransparencyAndComposition )
{
_dispatchDescription . ColorOpaqueOnly = opaqueOnly ;
_dispatchDescription . ColorOpaqueOnly = c olorO paqueOnly;
_dispatchDescription . AutoTcThreshold = generateTransparencyAndCompositionParameters . autoTcThreshold ;
_dispatchDescription . AutoTcScale = generateTransparencyAndCompositionParameters . autoTcScale ;
_dispatchDescription . AutoReactiveScale = generateTransparencyAndCompositionParameters . autoReactiveScale ;
@ -313,9 +314,9 @@ namespace UnityEngine.Rendering.PostProcessing
}
}
private void SetupAutoReactiveDescription ( PostProcessRenderContext context , RenderTargetIdentifier opaqueOnly )
private void SetupAutoReactiveDescription ( PostProcessRenderContext context )
{
_genReactiveDescription . ColorOpaqueOnly = opaqueOnly ;
_genReactiveDescription . ColorOpaqueOnly = c olorO paqueOnly;
_genReactiveDescription . ColorPreUpscale = null ;
_genReactiveDescription . OutReactive = null ;
_genReactiveDescription . RenderSize = _renderSize ;