@ -157,16 +157,12 @@ namespace FidelityFX
ref var color = ref dispatchParams . Color ;
ref var depth = ref dispatchParams . Depth ;
ref var motionVectors = ref dispatchParams . MotionVectors ;
ref var exposure = ref dispatchParams . Exposure ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputColor , color . RenderTarget , color . MipLevel , color . SubElement ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputDepth , depth . RenderTarget , depth . MipLevel , depth . SubElement ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputMotionVectors , motionVectors . RenderTarget , motionVectors . MipLevel , motionVectors . SubElement ) ;
if ( dispatchParams . Exposure . HasValue )
{
var exposure = dispatchParams . Exposure . Value ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputExposure , exposure . RenderTarget , exposure . MipLevel , exposure . SubElement ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . UavDilatedMotionVectors , Resources . DilatedMotionVectors [ frameIndex ] ) ;
@ -189,28 +185,16 @@ namespace FidelityFX
ref var color = ref dispatchParams . Color ;
ref var depth = ref dispatchParams . Depth ;
ref var motionVectors = ref dispatchParams . MotionVectors ;
ref var exposure = ref dispatchParams . Exposure ;
ref var reactive = ref dispatchParams . Reactive ;
ref var tac = ref dispatchParams . TransparencyAndComposition ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputColor , color . RenderTarget , color . MipLevel , color . SubElement ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputDepth , depth . RenderTarget , depth . MipLevel , depth . SubElement ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputMotionVectors , motionVectors . RenderTarget , motionVectors . MipLevel , motionVectors . SubElement ) ;
if ( dispatchParams . Exposure . HasValue )
{
var exposure = dispatchParams . Exposure . Value ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputExposure , exposure . RenderTarget , exposure . MipLevel , exposure . SubElement ) ;
}
if ( dispatchParams . Reactive . HasValue )
{
var reactive = dispatchParams . Reactive . Value ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvReactiveMask , reactive . RenderTarget , reactive . MipLevel , reactive . SubElement ) ;
}
if ( dispatchParams . TransparencyAndComposition . HasValue )
{
var tac = dispatchParams . TransparencyAndComposition . Value ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvTransparencyAndCompositionMask , tac . RenderTarget , tac . MipLevel , tac . SubElement ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvReconstructedPrevNearestDepth , Fsr2ShaderIDs . UavReconstructedPrevNearestDepth ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvDilatedMotionVectors , Resources . DilatedMotionVectors [ frameIndex ] ) ;
@ -284,11 +268,8 @@ namespace FidelityFX
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputMotionVectors , motionVectors . RenderTarget , motionVectors . MipLevel , motionVectors . SubElement ) ;
}
if ( dispatchParams . Exposure . HasValue )
{
var exposure = dispatchParams . Exposure . Value ;
ref var exposure = ref dispatchParams . Exposure ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputExposure , exposure . RenderTarget , exposure . MipLevel , exposure . SubElement ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvDilatedReactiveMasks , Fsr2ShaderIDs . UavDilatedReactiveMasks ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInternalUpscaled , Resources . InternalUpscaled [ frameIndex ^ 1 ] ) ;
@ -327,12 +308,8 @@ namespace FidelityFX
public override void ScheduleDispatch ( CommandBuffer commandBuffer , Fsr2 . DispatchDescription dispatchParams , int frameIndex , int dispatchX , int dispatchY )
{
if ( dispatchParams . Exposure . HasValue )
{
var exposure = dispatchParams . Exposure . Value ;
ref var exposure = ref dispatchParams . Exposure ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputExposure , exposure . RenderTarget , exposure . MipLevel , exposure . SubElement ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvRcasInput , Resources . InternalUpscaled [ frameIndex ] ) ;
ref var output = ref dispatchParams . Output ;
@ -391,31 +368,19 @@ namespace FidelityFX
public override void ScheduleDispatch ( CommandBuffer commandBuffer , Fsr2 . DispatchDescription dispatchParams , int frameIndex , int dispatchX , int dispatchY )
{
if ( dispatchParams . ColorOpaqueOnly . HasValue )
{
var opaqueOnly = dispatchParams . ColorOpaqueOnly . Value ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvOpaqueOnly , opaqueOnly . RenderTarget , opaqueOnly . MipLevel , opaqueOnly . SubElement ) ;
}
ref var color = ref dispatchParams . Color ;
ref var motionVectors = ref dispatchParams . MotionVectors ;
ref var opaqueOnly = ref dispatchParams . ColorOpaqueOnly ;
ref var reactive = ref dispatchParams . Reactive ;
ref var tac = ref dispatchParams . TransparencyAndComposition ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvOpaqueOnly , opaqueOnly . RenderTarget , opaqueOnly . MipLevel , opaqueOnly . SubElement ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputColor , color . RenderTarget , color . MipLevel , color . SubElement ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvInputMotionVectors , motionVectors . RenderTarget , motionVectors . MipLevel , motionVectors . SubElement ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvPrevColorPreAlpha , Resources . PrevPreAlpha [ frameIndex ^ 1 ] ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvPrevColorPostAlpha , Resources . PrevPostAlpha [ frameIndex ^ 1 ] ) ;
if ( dispatchParams . Reactive . HasValue )
{
var reactive = dispatchParams . Reactive . Value ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvReactiveMask , reactive . RenderTarget , reactive . MipLevel , reactive . SubElement ) ;
}
if ( dispatchParams . TransparencyAndComposition . HasValue )
{
var tac = dispatchParams . TransparencyAndComposition . Value ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . SrvTransparencyAndCompositionMask , tac . RenderTarget , tac . MipLevel , tac . SubElement ) ;
}
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . UavAutoReactive , Resources . AutoReactive ) ;
commandBuffer . SetComputeTextureParam ( ComputeShader , KernelIndex , Fsr2ShaderIDs . UavAutoComposition , Resources . AutoComposition ) ;