FidelityFX SPD

FidelityFX Single Pass Downsampler runtime library.

Enumerations

Name

Description

FfxSpdInitializationFlagBits

An enumeration of bit flags used when creating a “FfxSpdContext“. See “FfxSpdContextDescription“.
FFX_SPD_SAMPLER_LOAD = (1 << 0) – A bit indicating if we should use resource loads (favor loads over sampler)
FFX_SPD_SAMPLER_LINEAR = (1 << 1) – A bit indicating if we should use sampler to load resources.
FFX_SPD_WAVE_INTEROP_LDS = (1 << 2) – A bit indicating if we should use LDS.
FFX_SPD_WAVE_INTEROP_WAVE_OPS = (1 << 3) – A bit indicating if we should use WAVE OPS (favor wave ops over LDS)
FFX_SPD_MATH_NONPACKED = (1 << 4) – A bit indicating if we should use floating point math.
FFX_SPD_MATH_PACKED = (1 << 5) – A bit indicating if we should use 16-bit half precision floating point math (favored)

FfxSpdPass

An enumeration of the pass which constitutes the SPD algorithm.
FFX_SPD_PASS_DOWNSAMPLE = 0 – A pass which which downsamples all mips.
FFX_SPD_PASS_COUNT – The number of passes in SPD.

Structs

Name

Description

FfxSpdContext

A structure encapsulating the FidelityFX single pass downsampler context.

FfxSpdContextDescription

A structure encapsulating the parameters required to initialize FidelityFX Single Pass Downsampler.

FfxSpdDispatchDescription

A structure encapsulating the parameters for dispatching of FidelityFX Single Pass Downsampler.

Functions

Return type

Description

FFX_API FfxErrorCode

ffxSpdContextCreate ( FfxSpdContext * pContext, const FfxSpdContextDescription * pContextDescription )
Create a FidelityFX Single Pass Downsampler context from the parameters programmed to the “FfxSpdContextDescription“ structure.

FFX_API FfxErrorCode

ffxSpdContextDispatch ( FfxSpdContext * pContext, const FfxSpdDispatchDescription * pDispatchDescription )
Dispatches work to the FidelityFX SPD context.

FFX_API FfxErrorCode

Destroy the FidelityFX SPD context.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_SPD_CONTEXT_COUNT 1

FidelityFX SPD context count.

FFX_SPD_CONTEXT_SIZE (9300)

The size of the context specified in 32bit values.

FFX_SPD_VERSION_MAJOR (2)

FidelityFX SPD major version.

FFX_SPD_VERSION_MINOR (2)

FidelityFX SPD minor version.

FFX_SPD_VERSION_PATCH (0)

FidelityFX SPD patch version.

SPD_MAX_MIP_LEVELS 12

If this ever changes, need to also reflect a change in number of resources in ffx_spd_resources.h.

Detailed description

FidelityFX Single Pass Downsampler runtime library.

Global functions

ffxSpdContextCreate

Copied!

FFX_API  FfxErrorCode  ffxSpdContextCreate (
    FfxSpdContext * pContext,
    const FfxSpdContextDescription * pContextDescription
)

Create a FidelityFX Single Pass Downsampler context from the parameters programmed to the FfxSpdContextDescription structure.

The context structure is the main object used to interact with the Single Pass Downsampler API, and is responsible for the management of the internal resources used by the SPD 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 SPD to function. Depending on the precise configuration used when creating the FfxSpdContext a different set of resources and pipelines might be requested via the callback functions.

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

Parameters:

pContext

A pointer to a FfxSpdContext structure to populate.

pContextDescription

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

FFX_ERROR_BACKEND_API_ERROR

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


ffxSpdContextDispatch

Copied!

FFX_API  FfxErrorCode  ffxSpdContextDispatch (
    FfxSpdContext * pContext,
    const FfxSpdDispatchDescription * pDispatchDescription
)

Dispatches work to the FidelityFX SPD context.

Parameters:

pContext

A pointer to a FfxSpdContext structure to populate.

pDispatchDescription

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


ffxSpdContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxSpdContextDestroy (FfxSpdContext * pContext)

Destroy the FidelityFX SPD context.

Parameters:

pContext

A pointer to a FfxSpdContext structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context was NULL.


ffxSpdGetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxSpdGetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_SPD_CONTEXT_COUNT

Copied!

#define FFX_SPD_CONTEXT_COUNT 1

FidelityFX SPD context count.

Defines the number of internal effect contexts required by SPD


FFX_SPD_CONTEXT_SIZE

Copied!

#define FFX_SPD_CONTEXT_SIZE (9300)

The size of the context specified in 32bit values.


FFX_SPD_VERSION_MAJOR

Copied!

#define FFX_SPD_VERSION_MAJOR (2)

FidelityFX SPD major version.


FFX_SPD_VERSION_MINOR

Copied!

#define FFX_SPD_VERSION_MINOR (2)

FidelityFX SPD minor version.


FFX_SPD_VERSION_PATCH

Copied!

#define FFX_SPD_VERSION_PATCH (0)

FidelityFX SPD patch version.


SPD_MAX_MIP_LEVELS

Copied!

#define SPD_MAX_MIP_LEVELS 12

If this ever changes, need to also reflect a change in number of resources in ffx_spd_resources.h.