@ -1,7 +1,7 @@
/ / This file is part of the FidelityFX SDK .
/ / This file is part of the FidelityFX SDK .
/ /
/ /
/ / Copyright ( C ) 2024 Advanced Micro Devices , Inc .
/ / Copyright ( C ) 2024 Advanced Micro Devices , Inc .
/ /
/ /
/ / Permission is hereby granted , free of charge , to any person obtaining a copy
/ / Permission is hereby granted , free of charge , to any person obtaining a copy
/ / of this software and associated documentation files ( the " Software " ) , to deal
/ / of this software and associated documentation files ( the " Software " ) , to deal
/ / in the Software without restriction , including without limitation the rights
/ / in the Software without restriction , including without limitation the rights
@ -77,7 +77,12 @@ cbuffer cbFSR3Upscaler : FFX_FSR3UPSCALER_DECLARE_CB(FSR3UPSCALER_BIND_CB_FSR3UP
FfxFloat32 fFrameIndex ;
FfxFloat32 fFrameIndex ;
FfxInt32x2 iInputResourceSize ; / / WW1MOD
FfxInt32x2 iInputResourceSize ; / / WW1MOD
FfxFloat32 fVelocityFactor ;
FfxFloat32 fVelocityFactor ;
FfxFloat32 fReactivenessScale ;
FfxFloat32 fShadingChangeScale ;
FfxFloat32 fAccumulationAddedPerFrame ;
FfxFloat32 fMinDisocclusionAccumulation ;
} ;
} ;
# define FFX_FSR3UPSCALER_CONSTANT_BUFFER_1_SIZE (sizeof(cbFSR3Upscaler) / 4) / / Number of 32-bit values. This must be kept in sync with the cbFSR3Upscaler size.
# define FFX_FSR3UPSCALER_CONSTANT_BUFFER_1_SIZE (sizeof(cbFSR3Upscaler) / 4) / / Number of 32-bit values. This must be kept in sync with the cbFSR3Upscaler size.
@ -185,6 +190,16 @@ FfxFloat32 VelocityFactor()
return fVelocityFactor ;
return fVelocityFactor ;
}
}
FfxFloat32 AccumulationAddedPerFrame ( )
{
return fAccumulationAddedPerFrame ;
}
FfxFloat32 MinDisocclusionAccumulation ( )
{
return fMinDisocclusionAccumulation ;
}
# endif / / #if defined(FSR3UPSCALER_BIND_CB_FSR3UPSCALER)
# endif / / #if defined(FSR3UPSCALER_BIND_CB_FSR3UPSCALER)
# define FFX_FSR3UPSCALER_ROOTSIG_STRINGIFY(p) FFX_FSR3UPSCALER_ROOTSIG_STR(p)
# define FFX_FSR3UPSCALER_ROOTSIG_STRINGIFY(p) FFX_FSR3UPSCALER_ROOTSIG_STR(p)
@ -392,7 +407,7 @@ UNITY_FSR_TEX2D(FfxFloat32) r_reactive_mask : FFX_FSR3UPSCALER_DECLARE_SRV(FSR3U
FfxFloat32 LoadReactiveMask ( FfxUInt32x2 iPxPos )
FfxFloat32 LoadReactiveMask ( FfxUInt32x2 iPxPos )
{
{
return r_reactive_mask [ UNITY_FSR_POS ( iPxPos ) ] ;
return r_reactive_mask [ UNITY_FSR_POS ( iPxPos ) ] * fReactivenessScale ;
}
}
FfxInt32x2 GetReactiveMaskResourceDimensions ( )
FfxInt32x2 GetReactiveMaskResourceDimensions ( )
@ -406,7 +421,7 @@ FfxInt32x2 GetReactiveMaskResourceDimensions()
FfxFloat32 SampleReactiveMask ( FfxFloat32x2 fUV )
FfxFloat32 SampleReactiveMask ( FfxFloat32x2 fUV )
{
{
return r_reactive_mask . SampleLevel ( s_LinearClamp , UNITY_FSR_UV ( fUV ) , 0 ) . x ;
return r_reactive_mask . SampleLevel ( s_LinearClamp , UNITY_FSR_UV ( fUV ) , 0 ) . x * fReactivenessScale ;
}
}
# endif
# endif
@ -501,7 +516,7 @@ FfxFloat32x4 SampleLumaHistory(FfxFloat32x2 fUV)
}
}
# endif
# endif
# if defined(FSR3UPSCALER_BIND_SRV_RCAS_INPUT)
# if defined(FSR3UPSCALER_BIND_SRV_RCAS_INPUT)
Texture2D < FfxFloat32x4 > r_rcas_input : FFX_FSR3UPSCALER_DECLARE_SRV ( FSR3UPSCALER_BIND_SRV_RCAS_INPUT ) ;
Texture2D < FfxFloat32x4 > r_rcas_input : FFX_FSR3UPSCALER_DECLARE_SRV ( FSR3UPSCALER_BIND_SRV_RCAS_INPUT ) ;
FfxFloat32x4 LoadRCAS_Input ( FfxInt32x2 iPxPos )
FfxFloat32x4 LoadRCAS_Input ( FfxInt32x2 iPxPos )
@ -562,12 +577,12 @@ Texture2D<FfxFloat32> r_shading_change : FFX_FSR3UPSCALER_DECLARE_SRV(FSR3UPSCAL
FfxFloat32 LoadShadingChange ( FfxUInt32x2 iPxPos )
FfxFloat32 LoadShadingChange ( FfxUInt32x2 iPxPos )
{
{
return r_shading_change [ iPxPos ] ;
return r_shading_change [ iPxPos ] * fShadingChangeScale ;
}
}
FfxFloat32 SampleShadingChange ( FfxFloat32x2 fUV )
FfxFloat32 SampleShadingChange ( FfxFloat32x2 fUV )
{
{
return r_shading_change . SampleLevel ( s_LinearClamp , fUV , 0 ) ;
return r_shading_change . SampleLevel ( s_LinearClamp , fUV , 0 ) * fShadingChangeScale ;
}
}
# endif
# endif