FidelityFX LPM

FidelityFX Luma Preserving Mapper runtime library.

Enumerations

Name

Description

FfxLpmInitializationFlagBits

An enumeration of bit flags used when creating a “FfxLpmContext“. See “FfxLpmContextDescription“.

FfxLpmPass

An enumeration of all the passes which constitute the LPM algorithm.
FFX_LPM_PASS_FILTER = 0 – A pass which filters the color buffer using LPM’s tone and gamut mapping solution.
FFX_LPM_PASS_COUNT – The number of passes performed by LPM.

Structs

Name

Description

FfxLpmContext

A structure encapsulating the FidelityFX Luma Preserving 1.0 context.

FfxLpmContextDescription

A structure encapsulating the parameters required to initialize FidelityFX Luma Preserving Mapper.

FfxLpmDispatchDescription

A structure encapsulating the parameters for dispatching the various passes of FidelityFX Luma Preserving Mapper 1.0.

Functions

Return type

Description

FFX_API FfxErrorCode

ffxLpmContextCreate ( FfxLpmContext * pContext, const FfxLpmContextDescription * pContextDescription )
Create a FidelityFX Luma Preserving 1.0 context from the parameters programmed to the “FfxLpmContextDescription“ structure.

FFX_API FfxErrorCode

ffxLpmContextDispatch ( FfxLpmContext * pContext, const FfxLpmDispatchDescription * pDispatchDescription )
Dispatches work to the FidelityFX LPM context.

FFX_API FfxErrorCode

Destroy the FidelityFX LPM context.

FFX_API FfxErrorCode

FfxPopulateLpmConsts ( bool incon, bool insoft, bool incon2, bool inclip, bool inscaleOnly, uint32_t& outcon, uint32_t& outsoft, uint32_t& outcon2, uint32_t& outclip, uint32_t& outscaleOnly )
Sets up the constant buffer data necessary for LPM compute.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_LPM_CONTEXT_COUNT 1

FidelityFX Luma Preserving Mapper context count.

FFX_LPM_CONTEXT_SIZE (9300)

The size of the context specified in 32bit values.

FFX_LPM_VERSION_MAJOR (1)

FidelityFX Luma Preserving Mapper 1.3 major version.

FFX_LPM_VERSION_MINOR (4)

FidelityFX Luma Preserving Mapper 1.3 minor version.

FFX_LPM_VERSION_PATCH (0)

FidelityFX Luma Preserving Mapper 1.3 patch version.

Detailed description

FidelityFX Luma Preserving Mapper runtime library.

Global functions

ffxLpmContextCreate

Copied!

FFX_API  FfxErrorCode  ffxLpmContextCreate (
    FfxLpmContext * pContext,
    const FfxLpmContextDescription * pContextDescription
)

Create a FidelityFX Luma Preserving 1.0 context from the parameters programmed to the FfxLpmContextDescription structure.

The context structure is the main object used to interact with the Luma Preserving Mapper 1.0 API, and is responsible for the management of the internal resources used by the LPM 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 create the internal resources, and pipelines required by LPM frame-to-frame function. Depending on the precise configuration used when creating the FfxLpmContext a different set of resources and pipelines might be requested via the callback functions.

The FfxLpmContext should be destroyed when use of it is completed, typically when an application is unloaded or LPM tone and gamut mapping is disabled by a user. To destroy the LPM context you should call ffxLpmContextDestroy.

Parameters:

pContext

A pointer to a FfxLpmContext structure to populate.

pContextDescription

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

FFX_ERROR_BACKEND_API_ERROR

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


ffxLpmContextDispatch

Copied!

FFX_API  FfxErrorCode  ffxLpmContextDispatch (
    FfxLpmContext * pContext,
    const FfxLpmDispatchDescription * pDispatchDescription
)

Dispatches work to the FidelityFX LPM context.

Parameters:

pContext

A pointer to a FfxLpmContext structure to populate.

pDispatchDescription

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


ffxLpmContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxLpmContextDestroy (FfxLpmContext * pContext)

Destroy the FidelityFX LPM context.

Parameters:

pContext

A pointer to a FfxLpmContext structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context was NULL.


FfxPopulateLpmConsts

Copied!

FFX_API  FfxErrorCode  FfxPopulateLpmConsts (
    bool incon,
    bool insoft,
    bool incon2,
    bool inclip,
    bool inscaleOnly,
    uint32_t& outcon,
    uint32_t& outsoft,
    uint32_t& outcon2,
    uint32_t& outclip,
    uint32_t& outscaleOnly
)

Sets up the constant buffer data necessary for LPM compute.

Parameters:

incon

insoft

incon2

inclip

inscaleOnly

outcon

outsoft

outcon2

outclip

outscaleOnly

Return values:

FFX_OK

The operation completed successfully.


ffxLpmGetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxLpmGetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_LPM_CONTEXT_COUNT

Copied!

#define FFX_LPM_CONTEXT_COUNT 1

FidelityFX Luma Preserving Mapper context count.

Defines the number of internal effect contexts required by LPM


FFX_LPM_CONTEXT_SIZE

Copied!

#define FFX_LPM_CONTEXT_SIZE (9300)

The size of the context specified in 32bit values.


FFX_LPM_VERSION_MAJOR

Copied!

#define FFX_LPM_VERSION_MAJOR (1)

FidelityFX Luma Preserving Mapper 1.3 major version.


FFX_LPM_VERSION_MINOR

Copied!

#define FFX_LPM_VERSION_MINOR (4)

FidelityFX Luma Preserving Mapper 1.3 minor version.


FFX_LPM_VERSION_PATCH

Copied!

#define FFX_LPM_VERSION_PATCH (0)

FidelityFX Luma Preserving Mapper 1.3 patch version.