FidelityFX Lens

FidelityFX Lens runtime library.

Enumerations

Name

Description

FfxLensInitializationFlagBits

An enumeration of bit flags used when creating a “FfxLensContext“. See “FfxLensContextDescription“.
FFX_LENS_MATH_NONPACKED = (1 << 0) – A bit indicating if we should use floating point math.
FFX_LENS_MATH_PACKED = (1 << 1) – A bit indicating if we should use 16-bit half precision floating point math (favored)

FfxLensPass

An enumeration of the pass which constitutes the Lens algorithm.
FFX_LENS_PASS_MAIN_PASS = 0 – A pass which which applies the lens effect.
FFX_LENS_PASS_COUNT – The number of passes in Lens.

Structs

Name

Description

FfxLensContext

A structure encapsulating the FidelityFX Lens context.

FfxLensContextDescription

A structure encapsulating the parameters required to initialize FidelityFX Lens.

FfxLensDispatchDescription

A structure encapsulating the parameters for dispatching of FidelityFX Lens.

Functions

Return type

Description

FFX_API FfxErrorCode

ffxLensContextCreate ( FfxLensContext * pContext, const FfxLensContextDescription * pContextDescription )
Create a FidelityFX Lens Downsampler context from the parameters programmed to the “FfxLensContextDescription“ structure.

FFX_API FfxErrorCode

ffxLensContextDispatch ( FfxLensContext * pContext, const FfxLensDispatchDescription * pDispatchDescription )
Dispatches work to the FidelityFX Lens context.

FFX_API FfxErrorCode

Destroy the FidelityFX Lens context.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_LENS_CONTEXT_COUNT 1

FidelityFX Lens context count.

FFX_LENS_CONTEXT_SIZE (9200)

The size of the context specified in 32bit values.

FFX_LENS_VERSION_MAJOR (1)

FidelityFX Lens major version.

FFX_LENS_VERSION_MINOR (1)

FidelityFX Lens minor version.

FFX_LENS_VERSION_PATCH (0)

FidelityFX Lens patch version.

Detailed description

FidelityFX Lens runtime library.

Global functions

ffxLensContextCreate

Copied!

FFX_API  FfxErrorCode  ffxLensContextCreate (
    FfxLensContext * pContext,
    const FfxLensContextDescription * pContextDescription
)

Create a FidelityFX Lens Downsampler context from the parameters programmed to the FfxLensContextDescription structure.

The context structure is the main object used to interact with the Lens API, and is responsible for the management of the internal resources used by the Lens algorithm. When this API is called, multiple calls will be made via the pointers contained in the backendInterface structure. This backend will attempt to retrieve the device capabilities, and create the internal resources, and pipelines required by Lens to function. Depending on the precise configuration used when creating the FfxLensContext a different set of resources and pipelines might be requested via the callback functions.

The FfxLensContext should be destroyed when use of it is completed, typically when an application is unloaded or Lens upscaling is disabled by a user. To destroy the Lens context you should call ffxLensContextDestroy.

Parameters:

pContext

A pointer to a FfxLensContext structure to populate.

pContextDescription

A pointer to a FfxLensContextDescription 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 FfxLensContextDescription.callbacks was not fully specified.

FFX_ERROR_BACKEND_API_ERROR

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


ffxLensContextDispatch

Copied!

FFX_API  FfxErrorCode  ffxLensContextDispatch (
    FfxLensContext * pContext,
    const FfxLensDispatchDescription * pDispatchDescription
)

Dispatches work to the FidelityFX Lens context.

Parameters:

pContext

A pointer to a FfxLensContext structure to populate.

pDispatchDescription

A pointer to a FfxLensDispatchDescription 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.


ffxLensContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxLensContextDestroy (FfxLensContext * pContext)

Destroy the FidelityFX Lens context.

Parameters:

pContext

A pointer to a FfxLensContext structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context was NULL.


ffxLensGetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxLensGetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_LENS_CONTEXT_COUNT

Copied!

#define FFX_LENS_CONTEXT_COUNT 1

FidelityFX Lens context count.

Defines the number of internal effect contexts required by Lens


FFX_LENS_CONTEXT_SIZE

Copied!

#define FFX_LENS_CONTEXT_SIZE (9200)

The size of the context specified in 32bit values.


FFX_LENS_VERSION_MAJOR

Copied!

#define FFX_LENS_VERSION_MAJOR (1)

FidelityFX Lens major version.


FFX_LENS_VERSION_MINOR

Copied!

#define FFX_LENS_VERSION_MINOR (1)

FidelityFX Lens minor version.


FFX_LENS_VERSION_PATCH

Copied!

#define FFX_LENS_VERSION_PATCH (0)

FidelityFX Lens patch version.