@ -59,6 +59,8 @@ namespace FidelityFX
protected static readonly int CbSpd = Shader . PropertyToID ( "cbSPD" ) ;
protected static readonly int CbRcas = Shader . PropertyToID ( "cbRCAS" ) ;
protected static readonly int CbGenReactive = Shader . PropertyToID ( "cbGenerateReactive" ) ;
protected virtual bool AllowFP16 = > true ;
protected Fsr2Pipeline ( Fsr2 . ContextDescription contextDescription , Fsr2Resources resources , ComputeBuffer constants )
{
@ -131,14 +133,17 @@ namespace FidelityFX
kernelIndex = shaderRef . FindKernel ( "CS" ) ;
bool useLut = ( SystemInfo . computeSubGroupSize = = 6 4 ) ;
// Allow 16-bit floating point as a configuration option, except on passes that explicitly disable it
bool supportedFP16 = ( ( flags & Fsr2 . InitializationFlags . EnableFP16Usage ) ! = 0 & & AllowFP16 ) ;
// This mirrors the permutation rules from the CreatePipeline* functions
// This matche s the permutation rules from the CreatePipeline* functions
if ( ( flags & Fsr2 . InitializationFlags . EnableHighDynamicRange ) ! = 0 ) shaderRef . EnableKeyword ( "FFX_FSR2_OPTION_HDR_COLOR_INPUT" ) ;
if ( ( flags & Fsr2 . InitializationFlags . EnableDisplayResolutionMotionVectors ) = = 0 ) shaderRef . EnableKeyword ( "FFX_FSR2_OPTION_LOW_RESOLUTION_MOTION_VECTORS" ) ;
if ( ( flags & Fsr2 . InitializationFlags . EnableMotionVectorsJitterCancellation ) ! = 0 ) shaderRef . EnableKeyword ( "FFX_FSR2_OPTION_JITTERED_MOTION_VECTORS" ) ;
if ( ( flags & Fsr2 . InitializationFlags . EnableDepthInverted ) ! = 0 ) shaderRef . EnableKeyword ( "FFX_FSR2_OPTION_INVERTED_DEPTH" ) ;
if ( useLut ) shaderRef . EnableKeyword ( "FFX_FSR2_OPTION_REPROJECT_USE_LANCZOS_TYPE" ) ;
// TODO: enable FFX_HALF if FP16 is supported (except RCAS)
if ( supportedFP16 ) shaderRef . EnableKeyword ( "FFX_HALF" ) ;
}
private void UnloadComputeShader ( )
@ -249,6 +254,9 @@ namespace FidelityFX
internal class Fsr2AccumulatePipeline : Fsr2Pipeline
{
// Workaround: Disable FP16 path for the accumulate pass on NVIDIA due to reduced occupancy and high VRAM throughput.
protected override bool AllowFP16 = > SystemInfo . graphicsDeviceVendorID ! = 0 x10DE ;
public Fsr2AccumulatePipeline ( Fsr2 . ContextDescription contextDescription , Fsr2Resources resources , ComputeBuffer constants )
: base ( contextDescription , resources , constants )
{