Skip to content

FidelityFX SPD

Navigation: SDKEffect Components

FidelityFX SPD

FidelityFX Single Pass Downsampler runtime library.

Defines

FFX_SPD_VERSION_MAJOR

#define FFX_SPD_VERSION_MAJOR (2)

FidelityFX SPD major version.

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 38, column 9)

FFX_SPD_VERSION_MINOR

#define FFX_SPD_VERSION_MINOR (2)

FidelityFX SPD minor version.

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 43, column 9)

FFX_SPD_VERSION_PATCH

#define FFX_SPD_VERSION_PATCH (0)

FidelityFX SPD patch version.

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 48, column 9)

FFX_SPD_CONTEXT_COUNT

#define FFX_SPD_CONTEXT_COUNT 1

FidelityFX SPD context count.

Defines the number of internal effect contexts required by SPD

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 55, column 9)

FFX_SPD_CONTEXT_SIZE

#define FFX_SPD_CONTEXT_SIZE (9300)

The size of the context specified in 32bit values.

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 60, column 9)

SPD_MAX_MIP_LEVELS

#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.

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 66, column 9)

Functions

ffxSpdContextCreate

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 (FfxSpdContext *) – [out] A pointer to a FfxSpdContext structure to populate.
  • pContextDescription (const FfxSpdContextDescription *) – [in] A pointer to a FfxSpdContextDescription structure.

Returns: FFX_API FfxErrorCode

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 183, column 22)

ffxSpdContextDispatch

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

Dispatches work to the FidelityFX SPD context.

Parameters:

  • pContext (FfxSpdContext *) – [out] A pointer to a FfxSpdContext structure to populate.
  • pDispatchDescription (const FfxSpdDispatchDescription *) – [in] A pointer to a FfxSpdDispatchDescription structure.

Returns: FFX_API FfxErrorCode

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 198, column 22)

ffxSpdContextDestroy

FFX_API FfxErrorCode ffxSpdContextDestroy(FfxSpdContext *pContext)

Destroy the FidelityFX SPD context.

Parameters:

  • pContext (FfxSpdContext *) – [out] A pointer to a FfxSpdContext structure to destroy.

Returns: FFX_API FfxErrorCode

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 210, column 22)

ffxSpdGetEffectVersion

FFX_API FfxVersionNumber ffxSpdGetEffectVersion()

Queries the effect version number.

Returns: The SDK version the effect was built with.

Returns: FFX_API FfxVersionNumber

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 218, column 26)

Enumerations

FfxSpdPass

enum FfxSpdPass

An enumeration of the pass which constitutes the SPD algorithm.

SPD is implemented as a single pass algorithm. Each call to the FfxSPDScheduleGpuJobFunc callback function will correspond to a single downsample job. For a more comprehensive description of SPD’s inner workings, please refer to the SPD reference documentation.

Values:

FFX_SPD_PASS_DOWNSAMPLE

FFX_SPD_PASS_DOWNSAMPLE = 0

A pass which which downsamples all mips.

FFX_SPD_PASS_COUNT

The number of passes in SPD.

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 81, column 1)

FfxSpdInitializationFlagBits

enum FfxSpdInitializationFlagBits

An enumeration of bit flags used when creating a FfxSpdContext. See FfxSpdContextDescription.

Values:

FFX_SPD_SAMPLER_LOAD

FFX_SPD_SAMPLER_LOAD = (1 <<0)

A bit indicating if we should use resource loads (favor loads over sampler)

FFX_SPD_SAMPLER_LINEAR

FFX_SPD_SAMPLER_LINEAR = (1 <<1)

A bit indicating if we should use sampler to load resources.

FFX_SPD_WAVE_INTEROP_LDS

FFX_SPD_WAVE_INTEROP_LDS = (1 <<2)

A bit indicating if we should use LDS.

FFX_SPD_WAVE_INTEROP_WAVE_OPS

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

FFX_SPD_MATH_NONPACKED = (1 <<4)

A bit indicating if we should use floating point math.

FFX_SPD_MATH_PACKED

FFX_SPD_MATH_PACKED = (1 <<5)

A bit indicating if we should use 16-bit half precision floating point math (favored)

Source: sdk/include/FidelityFX/host/ffx_spd.h (line 101, column 1)

Dependencies: FfxSpdContext, FfxSpdContextDescription, FfxSpdDispatchDescription