@ -159,7 +159,7 @@ namespace FidelityFX
// If auto exposure is enabled use the auto exposure SRV, otherwise what the app sends
if ( ( _contextDescription . Flags & Fsr2 . InitializationFlags . EnableAutoExposure ) ! = 0 )
dispatchParams . Exposure = new Fsr2 . RenderTargetView ( _resources . AutoExposure ) ;
else if ( dispatchParams . Exposure . IsEmpty )
else if ( ! dispatchParams . Exposure . IsValid )
dispatchParams . Exposure = new Fsr2 . RenderTargetView ( _resources . DefaultExposure ) ;
if ( dispatchParams . EnableAutoReactive )
@ -170,7 +170,7 @@ namespace FidelityFX
if ( resetAccumulation )
{
RenderTargetIdentifier opaqueOnly = dispatchParams . ColorOpaqueOnly . IsEmpty ? Fsr2ShaderIDs . SrvOpaqueOnly : dispatchParams . ColorOpaqueOnly . RenderTarget ;
RenderTargetIdentifier opaqueOnly = dispatchParams . ColorOpaqueOnly . IsValid ? dispatchParams . ColorOpaqueOnly . RenderTarget : Fsr2ShaderIDs . SrvOpaqueOnly ;
commandBuffer . Blit ( _resources . PrevPreAlpha [ frameIndex ^ 1 ] , opaqueOnly ) ;
}
}
@ -180,8 +180,8 @@ namespace FidelityFX
_resources . DestroyTcrAutogenResources ( ) ;
}
if ( dispatchParams . Reactive . IsEmpty ) dispatchParams . Reactive = new Fsr2 . RenderTargetView ( _resources . DefaultReactive ) ;
if ( dispatchParams . TransparencyAndComposition . IsEmpty ) dispatchParams . TransparencyAndComposition = new Fsr2 . RenderTargetView ( _resources . DefaultReactive ) ;
if ( ! dispatchParams . Reactive . IsValid ) dispatchParams . Reactive = new Fsr2 . RenderTargetView ( _resources . DefaultReactive ) ;
if ( ! dispatchParams . TransparencyAndComposition . IsValid ) dispatchParams . TransparencyAndComposition = new Fsr2 . RenderTargetView ( _resources . DefaultReactive ) ;
Fsr2Resources . CreateAliasableResources ( commandBuffer , _contextDescription , dispatchParams ) ;
SetupConstants ( dispatchParams , resetAccumulation ) ;
@ -436,27 +436,27 @@ namespace FidelityFX
private void DebugCheckDispatch ( Fsr2 . DispatchDescription dispatchParams )
{
if ( dispatchParams . Color . IsEmpty )
if ( ! dispatchParams . Color . IsValid )
{
Debug . LogError ( "Color resource is null" ) ;
}
if ( dispatchParams . Depth . IsEmpty )
if ( ! dispatchParams . Depth . IsValid )
{
Debug . LogError ( "Depth resource is null" ) ;
}
if ( dispatchParams . MotionVectors . IsEmpty )
if ( ! dispatchParams . MotionVectors . IsValid )
{
Debug . LogError ( "MotionVectors resource is null" ) ;
}
if ( dispatchParams . Output . IsEmpty )
if ( ! dispatchParams . Output . IsValid )
{
Debug . LogError ( "Output resource is null" ) ;
}
if ( ! dispatchParams . Exposure . IsEmpty & & ( _contextDescription . Flags & Fsr2 . InitializationFlags . EnableAutoExposure ) ! = 0 )
if ( dispatchParams . Exposure . IsValid & & ( _contextDescription . Flags & Fsr2 . InitializationFlags . EnableAutoExposure ) ! = 0 )
{
Debug . LogWarning ( "Exposure resource provided, however auto exposure flag is present" ) ;
}