FidelityFX Parallel Sort

FidelityFX Single Pass Downsampler runtime library.

Enumerations

Name

Description

FfxParallelSortInitializationFlagBits

An enumeration of bit flags used when creating a “FfxParallelSortContextDescription“. See “FfxParallelSortContextDescription“.
FFX_PARALLELSORT_INDIRECT_SORT = (1 << 0) – A bit indicating if we should use indirect version of sort algorithm.
FFX_PARALLELSORT_PAYLOAD_SORT = (1 << 1) – A bit indicating if we should sort a payload buffer

FfxParallelSortPass

An enumeration of the passes which constitute the Parallel Sort algorithm.
FFX_PARALLELSORT_PASS_SETUP_INDIRECT_ARGS = 0 – A pass which sets up indirect params to invoke sorting when “FFX_PARALLEL_SORT_INDIRECT“ flag bit is set.
FFX_PARALLELSORT_PASS_SUM – A pass which counts the number of occurrences of each value in the data set.
FFX_PARALLELSORT_PASS_REDUCE – A pass which further reduces the counts across thread groups for faster offset calculations in large data sets.
FFX_PARALLELSORT_PASS_SCAN – A pass which prefixes the count totals into global offsets.
FFX_PARALLELSORT_PASS_SCAN_ADD – A pass which does a second prefix add the global offsets to each local thread group offset.
FFX_PARALLELSORT_PASS_SCATTER – A pass which performs a local sort of all values in the thread group and outputs to new global offset.
FFX_PARALLELSORT_PASS_COUNT – The number of passes in Parallel Sort.

Structs

Name

Description

FfxParallelSortContext

A structure encapsulating the FidelityFX Parallel Sort context.

FfxParallelSortContextDescription

A structure encapsulating the parameters required to initialize FidelityFX Parallel Sort.

FfxParallelSortDispatchDescription

A structure encapsulating the parameters needed to sort the buffer(s) provided.

Functions

Return type

Description

FFX_API FfxErrorCode

Create a FidelityFX Parallel Sort context from the parameters programmed to the “FfxParallelSortContextDescription“ structure.

FFX_API FfxErrorCode

Execute a FidelityFX Parallel Sort context to sort the provided data according to the passed in dispatch description.

FFX_API FfxErrorCode

Destroy the FidelityFX Parallel Sort context.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_PARALLELSORT_CONTEXT_COUNT 1

FidelityFX SPD context count.

FFX_PARALLELSORT_CONTEXT_SIZE (373794)

The size of the context specified in 32bit values.

FFX_PARALLELSORT_VERSION_MAJOR (1)

FidelityFX Parallel Sort major version.

FFX_PARALLELSORT_VERSION_MINOR (3)

FidelityFX Parallel Sort minor version.

FFX_PARALLELSORT_VERSION_PATCH (0)

FidelityFX Parallel Sort patch version.

Detailed description

FidelityFX Single Pass Downsampler runtime library.

Global functions

ffxParallelSortContextCreate

Copied!

FFX_API  FfxErrorCode  ffxParallelSortContextCreate (
    FfxParallelSortContext * pContext,
    const FfxParallelSortContextDescription * pContextDescription
)

Create a FidelityFX Parallel Sort context from the parameters programmed to the FfxParallelSortContextDescription structure.

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

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

Parameters:

pContext

A pointer to a FfxParallelSortContext structure to populate.

pContextDescription

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

FFX_ERROR_BACKEND_API_ERROR

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


ffxParallelSortContextDispatch

Copied!

FFX_API  FfxErrorCode  ffxParallelSortContextDispatch (
    FfxParallelSortContext * pContext,
    const FfxParallelSortDispatchDescription * pDispatchDescription
)

Execute a FidelityFX Parallel Sort context to sort the provided data according to the passed in dispatch description.

Parameters:

pContext

A pointer to a FfxParallelSortContext structure to populate.

pDispatchDescription

A pointer to a FfxParallelSortDispatchDescription structure.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context or sortDescription was NULL.

FFX_ERROR_BACKEND_API_ERROR

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


ffxParallelSortContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxParallelSortContextDestroy (FfxParallelSortContext * pContext)

Destroy the FidelityFX Parallel Sort context.

Parameters:

pContext

A pointer to a FfxParallelSortContext structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context was NULL.


ffxParallelSortGetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxParallelSortGetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_PARALLELSORT_CONTEXT_COUNT

Copied!

#define FFX_PARALLELSORT_CONTEXT_COUNT 1

FidelityFX SPD context count.

Defines the number of internal effect contexts required by SPD


FFX_PARALLELSORT_CONTEXT_SIZE

Copied!

#define FFX_PARALLELSORT_CONTEXT_SIZE (373794)

The size of the context specified in 32bit values.


FFX_PARALLELSORT_VERSION_MAJOR

Copied!

#define FFX_PARALLELSORT_VERSION_MAJOR (1)

FidelityFX Parallel Sort major version.


FFX_PARALLELSORT_VERSION_MINOR

Copied!

#define FFX_PARALLELSORT_VERSION_MINOR (3)

FidelityFX Parallel Sort minor version.


FFX_PARALLELSORT_VERSION_PATCH

Copied!

#define FFX_PARALLELSORT_VERSION_PATCH (0)

FidelityFX Parallel Sort patch version.