@ -181,8 +181,11 @@ namespace FidelityFX
public override void ScheduleDispatch ( CommandBuffer commandBuffer , Fsr2 . DispatchDescription dispatchParams , int frameIndex , int dispatchX , int dispatchY )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputColor , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Color ) ;
if ( dispatchParams . ColorDepth ! = null )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputColor , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Color ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavExposureMipLumaChange , Resources . SceneLuminance , ShadingChangeMipLevel ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavExposureMip5 , Resources . SceneLuminance , 5 ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavAutoExposure , Resources . AutoExposure ) ;
@ -204,9 +207,15 @@ namespace FidelityFX
public override void ScheduleDispatch ( CommandBuffer commandBuffer , Fsr2 . DispatchDescription dispatchParams , int frameIndex , int dispatchX , int dispatchY )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputColor , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Color ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputDepth , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Depth ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputMotionVectors , dispatchParams . MotionVectors ) ;
if ( dispatchParams . ColorDepth ! = null )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputColor , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Color ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputDepth , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Depth ) ;
}
if ( dispatchParams . MotionVectors ! = null )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputMotionVectors , dispatchParams . MotionVectors ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputExposure , dispatchParams . Exposure ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavDilatedMotionVectors , Resources . DilatedMotionVectors [ frameIndex ] ) ;
@ -231,9 +240,15 @@ namespace FidelityFX
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvReactiveMask , dispatchParams . Reactive ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvTransparencyAndCompositionMask , Resources . DefaultReactive ) ; // Default reactive mask, as we don't support TCR (yet)
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvPrevDilatedMotionVectors , Resources . DilatedMotionVectors [ frameIndex ^ 1 ] ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputMotionVectors , dispatchParams . MotionVectors ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputColor , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Color ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputDepth , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Depth ) ;
if ( dispatchParams . MotionVectors ! = null )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputMotionVectors , dispatchParams . MotionVectors ) ;
}
if ( dispatchParams . ColorDepth ! = null )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputColor , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Color ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputDepth , dispatchParams . ColorDepth , 0 , RenderTextureSubElement . Depth ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputExposure , dispatchParams . Exposure ) ;
commandBuffer . SetComputeConstantBufferParam ( ComputeShader , CbFsr2 , Constants , 0 , Marshal . SizeOf < Fsr2 . Fsr2Constants > ( ) ) ;
@ -274,7 +289,7 @@ namespace FidelityFX
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputExposure , dispatchParams . Exposure ) ;
if ( ( ContextDescription . Flags & Fsr2 . InitializationFlags . EnableDisplayResolutionMotionVectors ) = = 0 )
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvDilatedMotionVectors , Resources . DilatedMotionVectors [ frameIndex ] ) ;
else
else if ( dispatchParams . MotionVectors ! = null )
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputMotionVectors , dispatchParams . MotionVectors ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInternalUpscaled , Resources . InternalUpscaled [ frameIndex ^ 1 ] ) ;
@ -287,7 +302,10 @@ namespace FidelityFX
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavInternalUpscaled , Resources . InternalUpscaled [ frameIndex ] ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavLockStatus , Resources . LockStatus [ frameIndex ] ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavUpscaledOutput , dispatchParams . Output ) ;
if ( dispatchParams . Output ! = null )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavUpscaledOutput , dispatchParams . Output ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavLumaHistory , Resources . LumaHistory [ frameIndex ] ) ;
commandBuffer . SetComputeConstantBufferParam ( ComputeShader , CbFsr2 , Constants , 0 , Marshal . SizeOf < Fsr2 . Fsr2Constants > ( ) ) ;
@ -346,7 +364,10 @@ namespace FidelityFX
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvInputExposure , dispatchParams . Exposure ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , SrvRcasInput , Resources . InternalUpscaled [ frameIndex ] ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavUpscaledOutput , dispatchParams . Output ) ;
if ( dispatchParams . Output ! = null )
{
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , UavUpscaledOutput , dispatchParams . Output ) ;
}
commandBuffer . SetComputeConstantBufferParam ( ComputeShader , CbFsr2 , Constants , 0 , Marshal . SizeOf < Fsr2 . Fsr2Constants > ( ) ) ;
commandBuffer . SetComputeConstantBufferParam ( ComputeShader , CbRcas , _rcasConstants , 0 , Marshal . SizeOf < Fsr2 . RcasConstants > ( ) ) ;