FidelityFX Cas

FidelityFX Contrast Adaptive Sharpening runtime library.

Enumerations

Name

Description

FfxCasColorSpaceConversion

An enumeration of color space conversions used when creating a “FfxCASContext“. See “FfxCASContextDescription“.
FFX_CAS_COLOR_SPACE_LINEAR = 0 – Linear color space, will do nothing.
FFX_CAS_COLOR_SPACE_GAMMA20 = 1 – Convert gamma 2.0 to linear for input and linear to gamma 2.0 for output.
FFX_CAS_COLOR_SPACE_GAMMA22 = 2 – Convert gamma 2.2 to linear for input and linear to gamma 2.2 for output.
FFX_CAS_COLOR_SPACE_SRGB_OUTPUT = 3 – Only do sRGB conversion for output (input conversion will be done automatically).
FFX_CAS_COLOR_SPACE_SRGB_INPUT_OUTPUT = 4 – Convert sRGB to linear for input and linear to sRGB for output.

FfxCasInitializationFlagBits

An enumeration of bit flags used when creating a “FfxCASContext“. See “FfxCASContextDescription“.
FFX_CAS_SHARPEN_ONLY = (1 << 0) – A bit indicating if we sharpen only.

FfxCasPass

An enumeration of all the passes which constitute the CAS algorithm.
FFX_CAS_PASS_SHARPEN = 0 – A pass which sharpens only or upscales the color buffer.
FFX_CAS_PASS_COUNT – The number of passes performed by CAS.

Structs

Name

Description

FfxCasContext

A structure encapsulating the FidelityFX CAS context.

FfxCasContextDescription

A structure encapsulating the parameters required to initialize FidelityFX CAS.

FfxCasDispatchDescription

A structure encapsulating the parameters for dispatching the various passes of FidelityFX CAS.

Functions

Return type

Description

FFX_API FfxErrorCode

ffxCasContextCreate ( FfxCasContext * pContext, const FfxCasContextDescription * pContextDescription )
Create a FidelityFX CAS context from the parameters programmed to the “FfxCasContextDescription“ structure.

FFX_API FfxErrorCode

ffxCasContextDispatch ( FfxCasContext * pContext, const FfxCasDispatchDescription * pDispatchDescription )
..

FFX_API FfxErrorCode

Destroy the FidelityFX CAS context.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_CAS_CONTEXT_COUNT 1

FidelityFX CAS context count.

FFX_CAS_CONTEXT_SIZE (9206)

The size of the context specified in 32bit values.

FFX_CAS_VERSION_MAJOR (1)

Contrast Adaptive Sharpening major version.

FFX_CAS_VERSION_MINOR (2)

Contrast Adaptive Sharpening minor version.

FFX_CAS_VERSION_PATCH (0)

Contrast Adaptive Sharpening patch version.

Detailed description

FidelityFX Contrast Adaptive Sharpening runtime library.

Global functions

ffxCasContextCreate

Copied!

FFX_API  FfxErrorCode  ffxCasContextCreate (
    FfxCasContext * pContext,
    const FfxCasContextDescription * pContextDescription
)

Create a FidelityFX CAS context from the parameters programmed to the FfxCasContextDescription structure.

The context structure is the main object used to interact with the CAS, and is responsible for the management of the internal resources used by the CAS algorithm. When this API is called, multiple calls will be made via the pointers contained in the callbacks structure. These callbacks will attempt to retreive the device capabilities, , and pipelines required by CAS frame-to-frame function. Depending on configuration used when creating the FfxCasContext a different set of pipelines might be requested via the callback functions.

The FfxCasContext should be destroyed when use of it is completed, typically when an application is unloaded or CAS is disabled by a user. To destroy the CAS context you should call ffxCasContextDestroy.

Parameters:

pContext

A pointer to a FfxCasContext structure to populate.

pContextDescription

A pointer to a FfxCasContextDescription structure.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context or contextDescription was NULL.

FFX_ERROR_INCOMPLETE_INTERFACE

The operation failed because the FfxCasContextDescription.callbacks was not fully specified.

FFX_ERROR_BACKEND_API_ERROR

The operation failed because of an error returned from the backend.


ffxCasContextDispatch

Copied!

FFX_API  FfxErrorCode  ffxCasContextDispatch (
    FfxCasContext * pContext,
    const FfxCasDispatchDescription * pDispatchDescription
)

Parameters:

pContext

A pointer to a FfxCasContext structure to populate.

pDispatchDescription

A pointer to a FfxCasDispatchDescription structure.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context or dispatchDescription was NULL.

FFX_ERROR_BACKEND_API_ERROR

The operation failed because of an error returned from the backend.


ffxCasContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxCasContextDestroy (FfxCasContext * pContext)

Destroy the FidelityFX CAS context.

Parameters:

pContext

A pointer to a FfxCasContext structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context was NULL.


ffxCasGetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxCasGetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_CAS_CONTEXT_COUNT

Copied!

#define FFX_CAS_CONTEXT_COUNT 1

FidelityFX CAS context count.

Defines the number of internal effect contexts required by CAS


FFX_CAS_CONTEXT_SIZE

Copied!

#define FFX_CAS_CONTEXT_SIZE (9206)

The size of the context specified in 32bit values.


FFX_CAS_VERSION_MAJOR

Copied!

#define FFX_CAS_VERSION_MAJOR (1)

Contrast Adaptive Sharpening major version.


FFX_CAS_VERSION_MINOR

Copied!

#define FFX_CAS_VERSION_MINOR (2)

Contrast Adaptive Sharpening minor version.


FFX_CAS_VERSION_PATCH

Copied!

#define FFX_CAS_VERSION_PATCH (0)

Contrast Adaptive Sharpening patch version.