Skip to content

FidelityFX CAS

Navigation: SDKGPUFidelityFX GPU References

FidelityFX CAS

FidelityFX Contrast Adaptive Sharpening GPU documentation.

Defines

FFX_CAS_AREA_LIMIT

#define FFX_CAS_AREA_LIMIT (4.0)

The maximum scaling ratio that CAS can support.

Source: sdk/include/FidelityFX/gpu/cas/ffx_cas.h (line 31, column 9)

Functions

ffxCasSupportScaling

FfxUInt32 ffxCasSupportScaling(FFX_PARAMETER_IN FfxFloat32 outX, FFX_PARAMETER_IN FfxFloat32 outY, FFX_PARAMETER_IN FfxFloat32 inX, FFX_PARAMETER_IN FfxFloat32 inY)

A function to check if the scaling ratio is supported by CAS.

Contrast Adaptive Sharpening (CAS) supports a maximum scaling ratio expressed in FFX_CAS_AREA_LIMIT.

Returns: True if CAS supports scaling in the given configuration.

Parameters:

  • outX (FFX_PARAMETER_IN FfxFloat32) – [in] The width of the target output, expressed in pixels.
  • outY (FFX_PARAMETER_IN FfxFloat32) – [in] The height of the target output, expressed in pixels.
  • inX (FFX_PARAMETER_IN FfxFloat32) – [in] The width of the input surface, expressed in pixels.
  • inY (FFX_PARAMETER_IN FfxFloat32) – [in] The height of the input surface, expressed in pixels.

Returns: FfxUInt32

Source: sdk/include/FidelityFX/gpu/cas/ffx_cas.h (line 46, column 11)

ffxCasSetup

FFX_STATIC void ffxCasSetup(FFX_PARAMETER_INOUT FfxUInt32x4 const0, FFX_PARAMETER_INOUT FfxUInt32x4 const1, FFX_PARAMETER_IN FfxFloat32 sharpness, FFX_PARAMETER_IN FfxFloat32 inputSizeInPixelsX, FFX_PARAMETER_IN FfxFloat32 inputSizeInPixelsY, FFX_PARAMETER_IN FfxFloat32 outputSizeInPixelsX, FFX_PARAMETER_IN FfxFloat32 outputSizeInPixelsY)

Call to setup required constant values (works on CPU or GPU).

Parameters:

  • const0 (FFX_PARAMETER_INOUT FfxUInt32x4) – [out] The first 4 32-bit values of the constant buffer which is populated by this function.
  • const1 (FFX_PARAMETER_INOUT FfxUInt32x4) – [out] The second 4 32-bit values of the constant buffer which is populated by this function.
  • sharpness (FFX_PARAMETER_IN FfxFloat32) – [in] Set to 0 for the default (lower ringing), 1 for maximum (higest ringing).
  • inputSizeInPixelsX (FFX_PARAMETER_IN FfxFloat32) – [in] The size of the input resolution in the X dimension.
  • inputSizeInPixelsY (FFX_PARAMETER_IN FfxFloat32) – [in] The size of the input resolution in the Y dimension.
  • outputSizeInPixelsX (FFX_PARAMETER_IN FfxFloat32) – [in] The size of the output resolution in the X dimension.
  • outputSizeInPixelsY (FFX_PARAMETER_IN FfxFloat32) – [in] The size of the output resolution in the Y dimension.

Returns: FFX_STATIC void

Source: sdk/include/FidelityFX/gpu/cas/ffx_cas.h (line 66, column 17)