@ -325,20 +325,20 @@ namespace FidelityFX
private void SetupDispatchDescription ( )
{
// Set up the main FSR2 dispatch parameters
_dispatchDescription . Color = new Fsr2 . RenderTarget View ( BuiltinRenderTextureType . CameraTarget , RenderTextureSubElement . Color ) ;
_dispatchDescription . Depth = new Fsr2 . RenderTarget View ( BuiltinRenderTextureType . CameraTarget , RenderTextureSubElement . Depth ) ;
_dispatchDescription . MotionVectors = new Fsr2 . RenderTarget View ( BuiltinRenderTextureType . MotionVectors ) ;
_dispatchDescription . Exposure = Fsr2 . RenderTarget View . Unassigned ;
_dispatchDescription . Reactive = Fsr2 . RenderTarget View . Unassigned ;
_dispatchDescription . TransparencyAndComposition = Fsr2 . RenderTarget View . Unassigned ;
_dispatchDescription . Color = new Fsr2 . Resource View ( BuiltinRenderTextureType . CameraTarget , RenderTextureSubElement . Color ) ;
_dispatchDescription . Depth = new Fsr2 . Resource View ( BuiltinRenderTextureType . CameraTarget , RenderTextureSubElement . Depth ) ;
_dispatchDescription . MotionVectors = new Fsr2 . Resource View ( BuiltinRenderTextureType . MotionVectors ) ;
_dispatchDescription . Exposure = Fsr2 . Resource View . Unassigned ;
_dispatchDescription . Reactive = Fsr2 . Resource View . Unassigned ;
_dispatchDescription . TransparencyAndComposition = Fsr2 . Resource View . Unassigned ;
if ( ! enableAutoExposure & & exposure ! = null ) _dispatchDescription . Exposure = new Fsr2 . RenderTarget View ( exposure ) ;
if ( reactiveMask ! = null ) _dispatchDescription . Reactive = new Fsr2 . RenderTarget View ( reactiveMask ) ;
if ( transparencyAndCompositionMask ! = null ) _dispatchDescription . TransparencyAndComposition = new Fsr2 . RenderTarget View ( transparencyAndCompositionMask ) ;
if ( ! enableAutoExposure & & exposure ! = null ) _dispatchDescription . Exposure = new Fsr2 . Resource View ( exposure ) ;
if ( reactiveMask ! = null ) _dispatchDescription . Reactive = new Fsr2 . Resource View ( reactiveMask ) ;
if ( transparencyAndCompositionMask ! = null ) _dispatchDescription . TransparencyAndComposition = new Fsr2 . Resource View ( transparencyAndCompositionMask ) ;
var scaledRenderSize = GetScaledRenderSize ( ) ;
_dispatchDescription . Output = new Fsr2 . RenderTarget View ( Fsr2ShaderIDs . UavUpscaledOutput ) ;
_dispatchDescription . Output = new Fsr2 . Resource View ( Fsr2ShaderIDs . UavUpscaledOutput ) ;
_dispatchDescription . PreExposure = preExposure ;
_dispatchDescription . EnableSharpening = performSharpenPass ;
_dispatchDescription . Sharpness = sharpness ;
@ -357,7 +357,7 @@ namespace FidelityFX
_dispatchDescription . EnableAutoReactive = autoGenerateTransparencyAndComposition ;
if ( autoGenerateTransparencyAndComposition )
{
_dispatchDescription . ColorOpaqueOnly = new Fsr2 . RenderTarget View ( _colorOpaqueOnly ) ;
_dispatchDescription . ColorOpaqueOnly = new Fsr2 . Resource View ( _colorOpaqueOnly ) ;
_dispatchDescription . AutoTcThreshold = generateTransparencyAndCompositionParameters . autoTcThreshold ;
_dispatchDescription . AutoTcScale = generateTransparencyAndCompositionParameters . autoTcScale ;
_dispatchDescription . AutoReactiveScale = generateTransparencyAndCompositionParameters . autoReactiveScale ;
@ -374,9 +374,9 @@ namespace FidelityFX
private void SetupAutoReactiveDescription ( )
{
// Set up the parameters to auto-generate a reactive mask
_genReactiveDescription . ColorOpaqueOnly = new Fsr2 . RenderTarget View ( _colorOpaqueOnly ) ;
_genReactiveDescription . ColorPreUpscale = new Fsr2 . RenderTarget View ( BuiltinRenderTextureType . CameraTarget , RenderTextureSubElement . Color ) ;
_genReactiveDescription . OutReactive = new Fsr2 . RenderTarget View ( Fsr2ShaderIDs . UavAutoReactive ) ;
_genReactiveDescription . ColorOpaqueOnly = new Fsr2 . Resource View ( _colorOpaqueOnly ) ;
_genReactiveDescription . ColorPreUpscale = new Fsr2 . Resource View ( BuiltinRenderTextureType . CameraTarget , RenderTextureSubElement . Color ) ;
_genReactiveDescription . OutReactive = new Fsr2 . Resource View ( Fsr2ShaderIDs . UavAutoReactive ) ;
_genReactiveDescription . RenderSize = GetScaledRenderSize ( ) ;
_genReactiveDescription . Scale = generateReactiveParameters . scale ;
_genReactiveDescription . CutoffThreshold = generateReactiveParameters . cutoffThreshold ;
@ -420,7 +420,7 @@ namespace FidelityFX
var scaledRenderSize = GetScaledRenderSize ( ) ;
_dispatchCommandBuffer . GetTemporaryRT ( Fsr2ShaderIDs . UavAutoReactive , scaledRenderSize . x , scaledRenderSize . y , 0 , default , GraphicsFormat . R8_UNorm , 1 , true ) ;
_context . GenerateReactiveMask ( _genReactiveDescription , _dispatchCommandBuffer ) ;
_dispatchDescription . Reactive = new Fsr2 . RenderTarget View ( Fsr2ShaderIDs . UavAutoReactive ) ;
_dispatchDescription . Reactive = new Fsr2 . Resource View ( Fsr2ShaderIDs . UavAutoReactive ) ;
}
// The backbuffer is not set up to allow random-write access, so we need a temporary render texture for FSR2 to output to