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 |
---|---|
A structure encapsulating the FidelityFX Super Resolution 1.0 context.
|
|
A structure encapsulating the parameters required to initialize FidelityFX Super Resolution 1.0.
|
|
A structure encapsulating the parameters for dispatching the various passes of FidelityFX Super Resolution 1.0.
|
Functions
Return type |
Description |
---|---|
ffxFsr1ContextCreate ( FfxFsr1Context * pContext, const FfxFsr1ContextDescription * pContextDescription )
Create a FidelityFX Super Resolution 1.0 context from the parameters programmed to the “FfxFsr1ContextDescription“ structure.
|
|
Get GPU memory usage of the FidelityFX Super Resolution context.
|
|
ffxFsr1ContextDispatch ( FfxFsr1Context * pContext, const FfxFsr1DispatchDescription * pDispatchDescription )
..
|
|
ffxFsr1ContextDestroy (FfxFsr1Context * pContext)
Destroy the FidelityFX FSR 1 context.
|
|
FFX_API float |
ffxFsr1GetUpscaleRatioFromQualityMode (FfxFsr1QualityMode qualityMode)
Get the upscale ratio from the quality mode.
|
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.
|
|
Queries the effect version number.
|
Macros
Name |
Description |
---|---|
FidelityFX Super Resolution 1.0 context count.
|
|
FFX_FSR1_CONTEXT_SIZE (27448) |
The size of the context specified in 32bit values.
|
Include the interface for the backend of the FSR 1.0 API.
|
|
FidelityFX Super Resolution 1.0 minor version.
|
|
FidelityFX Super Resolution 1.0 patch version.
|
Detailed description
FidelityFX Super Resolution 1 runtime library.
Global functions
ffxFsr1ContextCreate
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 |
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. |
ffxFsr1ContextGetGpuMemoryUsage
FFX_API FfxErrorCode ffxFsr1ContextGetGpuMemoryUsage (
FfxFsr1Context * pContext,
FfxEffectMemoryUsage * pVramUsage
)
Get GPU memory usage of the FidelityFX Super Resolution context.
Parameters:
pContext |
A pointer to a |
pVramUsage |
A pointer to a |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_CODE_NULL_POINTER |
The operation failed because either |
ffxFsr1ContextDispatch
FFX_API FfxErrorCode ffxFsr1ContextDispatch (
FfxFsr1Context * pContext,
const FfxFsr1DispatchDescription * pDispatchDescription
)
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. |
ffxFsr1ContextDestroy
FFX_API FfxErrorCode ffxFsr1ContextDestroy (FfxFsr1Context * pContext)
Destroy the FidelityFX FSR 1 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 |
ffxFsr1GetUpscaleRatioFromQualityMode
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 |
---|---|
|
1.3x |
|
1.5x |
|
1.7x |
|
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
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 |
pRenderHeight |
A pointer to a |
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 |
FFX_ERROR_INVALID_ENUM |
An invalid quality mode was specified. |
ffxFsr1GetEffectVersion
FFX_API FfxVersionNumber ffxFsr1GetEffectVersion ()
Queries the effect version number.
Returns:
The SDK version the effect was built with.
Macros
FFX_FSR1_CONTEXT_COUNT
FidelityFX Super Resolution 1.0 context count.
Defines the number of internal effect contexts required by FSR1
FFX_FSR1_CONTEXT_SIZE
The size of the context specified in 32bit values.
FFX_FSR1_VERSION_MAJOR
Include the interface for the backend of the FSR 1.0 API.
FidelityFX Super Resolution 1.0 major version.
FFX_FSR1_VERSION_MINOR
FidelityFX Super Resolution 1.0 minor version.
FFX_FSR1_VERSION_PATCH
FidelityFX Super Resolution 1.0 patch version.