FidelityFX FSR1

FidelityFX Super Resolution 1 runtime library.

Enumerations

Name

Description

FfxFsr1InitializationFlagBits

An enumeration of bit flags used when creating a “FfxFsr1Context“. See “FfxFsr1ContextDescription“.
FFX_FSR1_ENABLE_RCAS = (1 << 0) – A bit indicating if we should use rcas.
FFX_FSR1_RCAS_PASSTHROUGH_ALPHA = (1 << 1) – A bit indicating if we should use passthrough alpha during rcas.
FFX_FSR1_RCAS_DENOISE = (1 << 2) – A bit indicating if denoising is invoked during rcas.
FFX_FSR1_ENABLE_HIGH_DYNAMIC_RANGE = (1 << 3) – A bit indicating if the input color data provided is using a high-dynamic range.
FFX_FSR1_ENABLE_SRGB_CONVERSIONS = (1 << 4) – A bit indicating that input/output resources require gamma conversions.

FfxFsr1Pass

An enumeration of all the passes which constitute the FSR1 algorithm.
FFX_FSR1_PASS_EASU = 0 – A pass which upscales the color buffer using easu.
FFX_FSR1_PASS_EASU_RCAS = 1 – A pass which upscales the color buffer in preparation for rcas.
FFX_FSR1_PASS_RCAS = 2 – A pass which performs rcas sharpening on the upscaled image.
FFX_FSR1_PASS_COUNT – The number of passes performed by FSR2.

FfxFsr1QualityMode

An enumeration of all the quality modes supported by FidelityFX Super Resolution 1 upscaling.
FFX_FSR1_QUALITY_MODE_ULTRA_QUALITY = 0 – Perform upscaling with a per-dimension upscaling ratio of 1.3x.
FFX_FSR1_QUALITY_MODE_QUALITY = 1 – Perform upscaling with a per-dimension upscaling ratio of 1.5x.
FFX_FSR1_QUALITY_MODE_BALANCED = 2 – Perform upscaling with a per-dimension upscaling ratio of 1.7x.
FFX_FSR1_QUALITY_MODE_PERFORMANCE = 3 – Perform upscaling with a per-dimension upscaling ratio of 2.0x.

Structs

Name

Description

FfxFsr1Context

A structure encapsulating the FidelityFX Super Resolution 1.0 context.

FfxFsr1ContextDescription

A structure encapsulating the parameters required to initialize FidelityFX Super Resolution 1.0.

FfxFsr1DispatchDescription

A structure encapsulating the parameters for dispatching the various passes of FidelityFX Super Resolution 1.0.

Functions

Return type

Description

FFX_API FfxErrorCode

ffxFsr1ContextCreate ( FfxFsr1Context * pContext, const FfxFsr1ContextDescription * pContextDescription )
Create a FidelityFX Super Resolution 1.0 context from the parameters programmed to the “FfxFsr1ContextDescription“ structure.

FFX_API FfxErrorCode

Get GPU memory usage of the FidelityFX Super Resolution context.

FFX_API FfxErrorCode

ffxFsr1ContextDispatch ( FfxFsr1Context * pContext, const FfxFsr1DispatchDescription * pDispatchDescription )
..

FFX_API FfxErrorCode

Destroy the FidelityFX FSR 1 context.

FFX_API float

ffxFsr1GetUpscaleRatioFromQualityMode (FfxFsr1QualityMode qualityMode)
Get the upscale ratio from the quality mode.

FFX_API FfxErrorCode

ffxFsr1GetRenderResolutionFromQualityMode ( uint32_t* pRenderWidth, uint32_t* pRenderHeight, uint32_t displayWidth, uint32_t displayHeight, FfxFsr1QualityMode qualityMode )
A helper function to calculate the rendering resolution from a target resolution and desired quality level.

FFX_API FfxVersionNumber

Queries the effect version number.

Macros

Name

Description

FFX_FSR1_CONTEXT_COUNT 2

FidelityFX Super Resolution 1.0 context count.

FFX_FSR1_CONTEXT_SIZE (27448)

The size of the context specified in 32bit values.

FFX_FSR1_VERSION_MAJOR (1)

Include the interface for the backend of the FSR 1.0 API.

FFX_FSR1_VERSION_MINOR (2)

FidelityFX Super Resolution 1.0 minor version.

FFX_FSR1_VERSION_PATCH (0)

FidelityFX Super Resolution 1.0 patch version.

Detailed description

FidelityFX Super Resolution 1 runtime library.

Global functions

ffxFsr1ContextCreate

Copied!

FFX_API  FfxErrorCode  ffxFsr1ContextCreate (
    FfxFsr1Context * pContext,
    const FfxFsr1ContextDescription * pContextDescription
)

Create a FidelityFX Super Resolution 1.0 context from the parameters programmed to the FfxFsr1ContextDescription structure.

The context structure is the main object used to interact with the Super Resoution 1.0 API, and is responsible for the management of the internal resources used by the FSR1 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 FSR1 frame-to-frame function. Depending on the precise configuration used when creating the FfxFsr1Context 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 FSR1 upscaling is disabled by a user. To destroy the FSR1 context you should call ffxFsr1ContextDestroy.

Parameters:

pContext

A pointer to a FfxFsr1Context structure to populate.

pContextDescription

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

FFX_ERROR_BACKEND_API_ERROR

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


ffxFsr1ContextGetGpuMemoryUsage

Copied!

FFX_API  FfxErrorCode  ffxFsr1ContextGetGpuMemoryUsage (
    FfxFsr1Context * pContext,
    FfxEffectMemoryUsage * pVramUsage
)

Get GPU memory usage of the FidelityFX Super Resolution context.

Parameters:

pContext

A pointer to a FfxFsr1Context structure.

pVramUsage

A pointer to a FfxEffectMemoryUsage structure.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context or vramUsage were NULL.


ffxFsr1ContextDispatch

Copied!

FFX_API  FfxErrorCode  ffxFsr1ContextDispatch (
    FfxFsr1Context * pContext,
    const FfxFsr1DispatchDescription * pDispatchDescription
)

Parameters:

pContext

A pointer to a FfxFsr1Context structure to populate.

pDispatchDescription

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


ffxFsr1ContextDestroy

Copied!

FFX_API  FfxErrorCode  ffxFsr1ContextDestroy (FfxFsr1Context * pContext)

Destroy the FidelityFX FSR 1 context.

Parameters:

pContext

A pointer to a FfxFsr1Context structure to destroy.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_CODE_NULL_POINTER

The operation failed because either context was NULL.


ffxFsr1GetUpscaleRatioFromQualityMode

Copied!

FFX_API  float ffxFsr1GetUpscaleRatioFromQualityMode (FfxFsr1QualityMode  qualityMode)

Get the upscale ratio from the quality mode.

The following table enumerates the mapping of the quality modes to per-dimension scaling ratios.

Quality preset

Scale factor

FFX_FSR1_QUALITY_MODE_ULTRA_QUALITY

1.3x

FFX_FSR1_QUALITY_MODE_QUALITY

1.5x

FFX_FSR1_QUALITY_MODE_BALANCED

1.7x

FFX_FSR1_QUALITY_MODE_PERFORMANCE

2.0x

Passing an invalid qualityMode will return 0.0f.

Parameters:

qualityMode

The quality mode preset.

Returns:

The upscaling the per-dimension upscaling ratio for qualityMode according to the table above.


ffxFsr1GetRenderResolutionFromQualityMode

Copied!

FFX_API  FfxErrorCode  ffxFsr1GetRenderResolutionFromQualityMode (
    uint32_t* pRenderWidth,
    uint32_t* pRenderHeight,
    uint32_t displayWidth,
    uint32_t displayHeight,
    FfxFsr1QualityMode  qualityMode
)

A helper function to calculate the rendering resolution from a target resolution and desired quality level.

This function applies the scaling factor returned by ffxFsr1GetUpscaleRatioFromQualityMode to each dimension.

Parameters:

pRenderWidth

A pointer to a uint32_t which will hold the calculated render resolution width.

pRenderHeight

A pointer to a uint32_t which will hold the calculated render resolution height.

displayWidth

The target display resolution width.

displayHeight

The target display resolution height.

qualityMode

The desired quality mode for FSR1 upscaling.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_POINTER

Either renderWidth or renderHeight was NULL.

FFX_ERROR_INVALID_ENUM

An invalid quality mode was specified.


ffxFsr1GetEffectVersion

Copied!

FFX_API  FfxVersionNumber  ffxFsr1GetEffectVersion ()

Queries the effect version number.

Returns:

The SDK version the effect was built with.


Macros

FFX_FSR1_CONTEXT_COUNT

Copied!

#define FFX_FSR1_CONTEXT_COUNT 2

FidelityFX Super Resolution 1.0 context count.

Defines the number of internal effect contexts required by FSR1


FFX_FSR1_CONTEXT_SIZE

Copied!

#define FFX_FSR1_CONTEXT_SIZE (27448)

The size of the context specified in 32bit values.


FFX_FSR1_VERSION_MAJOR

Copied!

#define FFX_FSR1_VERSION_MAJOR (1)

Include the interface for the backend of the FSR 1.0 API.

FidelityFX Super Resolution 1.0 major version.


FFX_FSR1_VERSION_MINOR

Copied!

#define FFX_FSR1_VERSION_MINOR (2)

FidelityFX Super Resolution 1.0 minor version.


FFX_FSR1_VERSION_PATCH

Copied!

#define FFX_FSR1_VERSION_PATCH (0)

FidelityFX Super Resolution 1.0 patch version.