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.


Related pages

  • Visit the FidelityFX SDK product page for download links and more information.

Looking for more documentation on GPUOpen?

AMD GPUOpen software blogs

Our handy software release blogs will help you make good use of our tools, SDKs, and effects, as well as sharing the latest features with new releases.

GPUOpen Manuals

Don’t miss our manual documentation! And if slide decks are what you’re after, you’ll find 100+ of our finest presentations here.

AMD GPUOpen Performance Guides

The home of great performance and optimization advice for AMD RDNAâ„¢ 2 GPUs, AMD Ryzenâ„¢ CPUs, and so much more.

Getting started: AMD GPUOpen software

New or fairly new to AMD’s tools, libraries, and effects? This is the best place to get started on GPUOpen!

AMD GPUOpen Getting Started Development and Performance

Looking for tips on getting started with developing and/or optimizing your game, whether on AMD hardware or generally? We’ve got you covered!

AMD GPUOpen Technical blogs

Browse our technical blogs, and find valuable advice on developing with AMD hardware, ray tracing, Vulkan®, DirectX®, Unreal Engine, and lots more.

Find out more about our software!

AMD GPUOpen Effects - AMD FidelityFX technologies

Create wonder. No black boxes. Meet the AMD FidelityFX SDK!

AMD GPUOpen Samples

Browse all our useful samples. Perfect for when you’re needing to get started, want to integrate one of our libraries, and much more.

AMD GPUOpen developer SDKs

Discover what our SDK technologies can offer you. Query hardware or software, manage memory, create rendering applications or machine learning, and much more!

AMD GPUOpen Developer Tools

Analyze, Optimize, Profile, Benchmark. We provide you with the developer tools you need to make sure your game is the best it can be!