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 |
---|---|
A structure encapsulating the FidelityFX single pass downsampler context.
|
|
A structure encapsulating the parameters required to initialize FidelityFX Single Pass Downsampler.
|
|
A structure encapsulating the parameters for dispatching of FidelityFX Single Pass Downsampler.
|
Functions
Return type |
Description |
---|---|
ffxSpdContextCreate ( FfxSpdContext * pContext, const FfxSpdContextDescription * pContextDescription )
Create a FidelityFX Single Pass Downsampler context from the parameters programmed to the “FfxSpdContextDescription“ structure.
|
|
ffxSpdContextDispatch ( FfxSpdContext * pContext, const FfxSpdDispatchDescription * pDispatchDescription )
Dispatches work to the FidelityFX SPD context.
|
|
ffxSpdContextDestroy (FfxSpdContext * pContext)
Destroy the FidelityFX SPD context.
|
|
Queries the effect version number.
|
Macros
Name |
Description |
---|---|
FidelityFX SPD context count.
|
|
FFX_SPD_CONTEXT_SIZE (9300) |
The size of the context specified in 32bit values.
|
FidelityFX SPD major version.
|
|
FidelityFX SPD minor version.
|
|
FidelityFX SPD patch version.
|
|
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
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 |
pContextDescription |
A pointer to a |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_CODE_NULL_POINTER |
The operation failed because either |
FFX_ERROR_INCOMPLETE_INTERFACE |
The operation failed because the |
FFX_ERROR_BACKEND_API_ERROR |
The operation failed because of an error returned from the backend. |
ffxSpdContextDispatch
FFX_API FfxErrorCode ffxSpdContextDispatch (
FfxSpdContext * pContext,
const FfxSpdDispatchDescription * pDispatchDescription
)
Dispatches work to the FidelityFX SPD context.
Parameters:
pContext |
A pointer to a |
pDispatchDescription |
A pointer to a |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_CODE_NULL_POINTER |
The operation failed because either |
FFX_ERROR_BACKEND_API_ERROR |
The operation failed because of an error returned from the backend. |
ffxSpdContextDestroy
FFX_API FfxErrorCode ffxSpdContextDestroy (FfxSpdContext * pContext)
Destroy the FidelityFX SPD context.
Parameters:
pContext |
A pointer to a |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_CODE_NULL_POINTER |
The operation failed because either |
ffxSpdGetEffectVersion
FFX_API FfxVersionNumber ffxSpdGetEffectVersion ()
Queries the effect version number.
Returns:
The SDK version the effect was built with.
Macros
FFX_SPD_CONTEXT_COUNT
FidelityFX SPD context count.
Defines the number of internal effect contexts required by SPD
FFX_SPD_CONTEXT_SIZE
The size of the context specified in 32bit values.
FFX_SPD_VERSION_MAJOR
FidelityFX SPD major version.
FFX_SPD_VERSION_MINOR
FidelityFX SPD minor version.
FFX_SPD_VERSION_PATCH
FidelityFX SPD patch version.
SPD_MAX_MIP_LEVELS
If this ever changes, need to also reflect a change in number of resources in ffx_spd_resources.h.