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 |
---|---|
A structure encapsulating the FidelityFX Parallel Sort context.
|
|
A structure encapsulating the parameters required to initialize FidelityFX Parallel Sort.
|
|
A structure encapsulating the parameters needed to sort the buffer(s) provided.
|
Functions
Return type |
Description |
---|---|
ffxParallelSortContextCreate ( FfxParallelSortContext * pContext, const FfxParallelSortContextDescription * pContextDescription )
Create a FidelityFX Parallel Sort context from the parameters programmed to the “FfxParallelSortContextDescription“ structure.
|
|
ffxParallelSortContextDispatch ( FfxParallelSortContext * pContext, const FfxParallelSortDispatchDescription * pDispatchDescription )
Execute a FidelityFX Parallel Sort context to sort the provided data according to the passed in dispatch description.
|
|
ffxParallelSortContextDestroy (FfxParallelSortContext * pContext)
Destroy the FidelityFX Parallel Sort context.
|
|
Queries the effect version number.
|
Macros
Name |
Description |
---|---|
FidelityFX SPD context count.
|
|
FFX_PARALLELSORT_CONTEXT_SIZE (373794) |
The size of the context specified in 32bit values.
|
FidelityFX Parallel Sort major version.
|
|
FidelityFX Parallel Sort minor version.
|
|
FidelityFX Parallel Sort patch version.
|
Detailed description
FidelityFX Single Pass Downsampler runtime library.
Global functions
ffxParallelSortContextCreate
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 |
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. |
ffxParallelSortContextDispatch
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 |
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. |
ffxParallelSortContextDestroy
FFX_API FfxErrorCode ffxParallelSortContextDestroy (FfxParallelSortContext * pContext)
Destroy the FidelityFX Parallel Sort 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 |
ffxParallelSortGetEffectVersion
FFX_API FfxVersionNumber ffxParallelSortGetEffectVersion ()
Queries the effect version number.
Returns:
The SDK version the effect was built with.
Macros
FFX_PARALLELSORT_CONTEXT_COUNT
FidelityFX SPD context count.
Defines the number of internal effect contexts required by SPD
FFX_PARALLELSORT_CONTEXT_SIZE
The size of the context specified in 32bit values.
FFX_PARALLELSORT_VERSION_MAJOR
FidelityFX Parallel Sort major version.
FFX_PARALLELSORT_VERSION_MINOR
FidelityFX Parallel Sort minor version.
FFX_PARALLELSORT_VERSION_PATCH
FidelityFX Parallel Sort patch version.