FidelityFX VRS
Navigation: SDK → Effect Components
FidelityFX VRS
FidelityFX Variable Rate Shading runtime library.
Defines
FFX_VRS_VERSION_MAJOR
#define FFX_VRS_VERSION_MAJOR (1)
FidelityFX VRS major version.
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 38, column 9)
FFX_VRS_VERSION_MINOR
#define FFX_VRS_VERSION_MINOR (2)
FidelityFX VRS minor version.
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 43, column 9)
FFX_VRS_VERSION_PATCH
#define FFX_VRS_VERSION_PATCH (0)
FidelityFX VRS patch version.
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 48, column 9)
FFX_VRS_CONTEXT_COUNT
#define FFX_VRS_CONTEXT_COUNT 1
FidelityFX VRS context count.
Defines the number of internal effect contexts required by VRS
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 55, column 9)
FFX_VRS_CONTEXT_SIZE
#define FFX_VRS_CONTEXT_SIZE (16536)
The size of the context specified in 32bit values.
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 60, column 9)
Functions
ffxVrsContextCreate
FFX_API FfxErrorCode ffxVrsContextCreate(FfxVrsContext *pContext, const FfxVrsContextDescription *pContextDescription)
Create a FidelityFX Variable Shading context from the parameters programmed to the FfxVrsContextDescription structure.
The context structure is the main object used to interact with the Variable Shading API, and is responsible for the management of the internal resources used by the VRS 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 VRS to function. Depending on the precise configuration used when creating the FfxVrsContext a different set of resources and pipelines might be requested via the callback functions.
The FfxVrsContext should be destroyed when use of it is completed, typically when an application is unloaded or Variable Shading is disabled by a user. To destroy the VRS context you should call ffxVrsContextDestroy.
Parameters:
pContext
(FfxVrsContext *
) – [out] A pointer to a FfxVrsContext structure to populate.pContextDescription
(const FfxVrsContextDescription *
) – [in] A pointer to a FfxVrsContextDescription structure.
Returns: FFX_API FfxErrorCode
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 167, column 22)
ffxVrsContextDispatch
FFX_API FfxErrorCode ffxVrsContextDispatch(FfxVrsContext *pContext, const FfxVrsDispatchDescription *pDispatchDescription)
Dispatches work to the FidelityFX VRS context.
Parameters:
pContext
(FfxVrsContext *
) – [in] A pointer to a FfxVrsContext structure to populate.pDispatchDescription
(const FfxVrsDispatchDescription *
) – [in] A pointer to a FfxVrsDispatchDescription structure.
Returns: FFX_API FfxErrorCode
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 182, column 22)
ffxVrsContextDestroy
FFX_API FfxErrorCode ffxVrsContextDestroy(FfxVrsContext *pContext)
Destroy the FidelityFX VRS context.
Parameters:
pContext
(FfxVrsContext *
) – [in] A pointer to a FfxVrsContext structure to destroy.
Returns: FFX_API FfxErrorCode
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 194, column 22)
ffxVrsGetImageSizeFromeRenderResolution
FFX_API FfxErrorCode ffxVrsGetImageSizeFromeRenderResolution(uint32_t *pImageWidth, uint32_t *pImageHeight, uint32_t renderWidth, uint32_t renderHeight, uint32_t shadingRateImageTileSize)
A helper function to calculate the ShadingRateImage size from a target resolution.
Parameters:
pImageWidth
(uint32_t *
) – [out] A pointer to a uint32_t which will hold the calculated image width.pImageHeight
(uint32_t *
) – [out] A pointer to a uint32_t which will hold the calculated image height.renderWidth
(uint32_t
) – [in] The render resolution width.renderHeight
(uint32_t
) – [in] The render resolution height.shadingRateImageTileSize
(uint32_t
) – [in] The ShadingRateImage tile size.
Returns: FFX_API FfxErrorCode
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 212, column 22)
ffxVrsGetEffectVersion
FFX_API FfxVersionNumber ffxVrsGetEffectVersion()
Queries the effect version number.
Returns: The SDK version the effect was built with.
Returns: FFX_API FfxVersionNumber
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 220, column 26)
Enumerations
FfxVrsPass
enum FfxVrsPass
An enumeration of the pass which constitutes the ShadingRateImage generation algorithm.
VRS is implemented as a single pass algorithm. Each call to the FfxScheduleGpuJobFunc callback function will correspond to a single image generation job. For a more comprehensive description of VRS’s inner workings, please refer to the VRS reference documentation.
Values:
FFX_VRS_PASS_IMAGEGEN
FFX_VRS_PASS_IMAGEGEN = 0
A pass which generates a ShadingRateImage.
FFX_VRS_PASS_COUNT
The number of passes performed by VRS.
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 76, column 1)
FfxVrsInitializationFlagBits
enum FfxVrsInitializationFlagBits
An enumeration of bit flags used when creating a FfxVrsContext. See FfxVrsContextDescription.
Values:
FFX_VRS_ALLOW_ADDITIONAL_SHADING_RATES
FFX_VRS_ALLOW_ADDITIONAL_SHADING_RATES = (1 <<0)
A bit indicating if we should enable additional shading rates.
Source: sdk/include/FidelityFX/host/ffx_vrs.h
(line 86, column 1)
Dependencies: FfxVrsContext, FfxVrsContextDescription, FfxVrsDispatchDescription