FidelityFX VRS
FidelityFX Variable Rate Shading runtime library.
Enumerations
Name |
Description |
---|---|
FfxVrsInitializationFlagBits |
An enumeration of bit flags used when creating a “FfxVrsContext“. See “FfxVrsContextDescription“.
FFX_VRS_ALLOW_ADDITIONAL_SHADING_RATES = (1 << 0) – A bit indicating if we should enable additional shading rates.
|
FfxVrsPass |
An enumeration of the pass which constitutes the ShadingRateImage generation algorithm.
FFX_VRS_PASS_IMAGEGEN = 0 – A pass which generates a ShadingRateImage.
FFX_VRS_PASS_COUNT – The number of passes performed by VRS.
|
Structs
Name |
Description |
---|---|
A structure encapsulating the FidelityFX Variable Shading context.
|
|
A structure encapsulating the parameters required to initialize FidelityFX Variable Shading.
|
|
A structure encapsulating the parameters for dispatching the various passes of FidelityFX Variable Shading.
|
Functions
Return type |
Description |
---|---|
ffxVrsContextCreate ( FfxVrsContext * pContext, const FfxVrsContextDescription * pContextDescription )
Create a FidelityFX Variable Shading context from the parameters programmed to the “FfxVrsContextDescription“ structure.
|
|
ffxVrsContextDispatch ( FfxVrsContext * pContext, const FfxVrsDispatchDescription * pDispatchDescription )
Dispatches work to the FidelityFX VRS context.
|
|
ffxVrsContextDestroy (FfxVrsContext * pContext)
Destroy the FidelityFX VRS context.
|
|
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.
|
|
Queries the effect version number.
|
Macros
Name |
Description |
---|---|
FidelityFX VRS context count.
|
|
FFX_VRS_CONTEXT_SIZE (16536) |
The size of the context specified in 32bit values.
|
FidelityFX VRS major version.
|
|
FidelityFX VRS minor version.
|
|
FidelityFX VRS patch version.
|
Detailed description
FidelityFX Variable Rate Shading runtime library.
Global 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 |
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. |
ffxVrsContextDispatch
FFX_API FfxErrorCode ffxVrsContextDispatch (
FfxVrsContext * pContext,
const FfxVrsDispatchDescription * pDispatchDescription
)
Dispatches work to the FidelityFX VRS context.
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. |
ffxVrsContextDestroy
FFX_API FfxErrorCode ffxVrsContextDestroy (FfxVrsContext * pContext)
Destroy the FidelityFX VRS 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 |
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 |
A pointer to a |
pImageHeight |
A pointer to a |
renderWidth |
The render resolution width. |
renderHeight |
The render resolution height. |
shadingRateImageTileSize |
The ShadingRateImage tile size. |
Return values:
FFX_OK |
The operation completed successfully. |
FFX_ERROR_INVALID_POINTER |
Either |
ffxVrsGetEffectVersion
FFX_API FfxVersionNumber ffxVrsGetEffectVersion ()
Queries the effect version number.
Returns:
The SDK version the effect was built with.
Macros
FFX_VRS_CONTEXT_COUNT
FidelityFX VRS context count.
Defines the number of internal effect contexts required by VRS
FFX_VRS_CONTEXT_SIZE
The size of the context specified in 32bit values.
FFX_VRS_VERSION_MAJOR
FidelityFX VRS major version.
FFX_VRS_VERSION_MINOR
FidelityFX VRS minor version.
FFX_VRS_VERSION_PATCH
FidelityFX VRS patch version.