DX12 FrameInterpolation

FidelityFX SDK native frame interpolation implementation for DirectX 12 backend.

Functions

Return type

Description

FFX_API FfxErrorCode

ffxReplaceSwapchainForFrameinterpolationDX12 ( FfxCommandQueue gameQueue, FfxSwapchain& gameSwapChain )
Replaces the current swapchain with the provided “FfxSwapchain“.

FFX_API FfxErrorCode

ffxCreateFrameinterpolationSwapchainDX12 ( const DXGI_SWAP_CHAIN_DESC* desc, ID3D12CommandQueue* queue, ID.gifactory* d.gifactory, FfxSwapchain& outGameSwapChain )
Creates a “FfxSwapchain“ from passed in parameters.

FFX_API FfxErrorCode

ffxCreateFrameinterpolationSwapchainForHwndDX12 ( HWND hWnd, const DXGI_SWAP_CHAIN_DESC1* desc1, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC* fullscreenDesc, ID3D12CommandQueue* queue, ID.gifactory* d.gifactory, FfxSwapchain& outGameSwapChain )
Creates a “FfxSwapchain“ from passed in parameters.

FFX_API FfxErrorCode

ffxWaitForPresents (FfxSwapchain gameSwapChain)
Waits for the “FfxSwapchain“ to complete presentation.

FFX_API FfxErrorCode

ffxRegisterFrameinterpolationUiResourceDX12 ( FfxSwapchain gameSwapChain, FfxResource uiResource, uint32_t flags )
Registers a “FfxResource“ to use for UI with the provided “FfxSwapchain“.

FFX_API FfxErrorCode

ffxGetFrameinterpolationCommandlistDX12 ( FfxSwapchain gameSwapChain, FfxCommandList & gameCommandlist )
Fetches a “FfxCommandList“ from the “FfxSwapchain“.

FFX_API FfxResource

ffxGetFrameinterpolationTextureDX12 (FfxSwapchain gameSwapChain)
Fetches a “FfxResource“ representing the backbuffer from the “FfxSwapchain“.

FFX_API FfxErrorCode

Sets a “FfxFrameGenerationConfig“ to the internal FrameInterpolationSwapChain (in the backend).

FFX_API FfxErrorCode

ffxConfigureFrameInterpolationSwapchainDX12 ( FfxSwapchain gameSwapChain, FfxFrameInterpolationSwapchainConfigureKey key, void* valuePtr )
Configures “FfxSwapchain“ via KeyValue API post “FfxSwapchain“ context creation.

FFX_API FfxErrorCode

Query how much GPU memory created by “FfxSwapchain“. This excludes GPU memory created by DXGI (ie. size of DXGI swapchaim backbuffers).

Detailed description

FidelityFX SDK native frame interpolation implementation for DirectX 12 backend.

Global functions

ffxReplaceSwapchainForFrameinterpolationDX12

Copied!

FFX_API  FfxErrorCode  ffxReplaceSwapchainForFrameinterpolationDX12 (
    FfxCommandQueue gameQueue,
    FfxSwapchain& gameSwapChain
)

Replaces the current swapchain with the provided FfxSwapchain.

Parameters:

gameQueue

The FfxCommandQueue presentation will occur on.

gameSwapChain

The FfxSwapchain to use for frame interpolation presentation.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

One of the parameters is invalid.


ffxCreateFrameinterpolationSwapchainDX12

Copied!

FFX_API  FfxErrorCode  ffxCreateFrameinterpolationSwapchainDX12 (
    const DXGI_SWAP_CHAIN_DESC* desc,
    ID3D12CommandQueue* queue,
    ID.gifactory* d.gifactory,
    FfxSwapchain& outGameSwapChain
)

Creates a FfxSwapchain from passed in parameters.

Parameters:

desc

The DXGI_SWAP_CHAIN_DESC describing the swapchain creation parameters from the calling application.

queue

The ID3D12CommandQueue to use for frame interpolation presentation.

d.gifactory

The ID.gifactory to use for DX12 swapchain creation.

outGameSwapChain

The created FfxSwapchain.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

One of the parameters is invalid. FFX_ERROR_OUT_OF_MEMORY Insufficient memory available to allocate FfxSwapchain or underlying component.


ffxCreateFrameinterpolationSwapchainForHwndDX12

Copied!

FFX_API  FfxErrorCode  ffxCreateFrameinterpolationSwapchainForHwndDX12 (
    HWND hWnd,
    const DXGI_SWAP_CHAIN_DESC1* desc1,
    const DXGI_SWAP_CHAIN_FULLSCREEN_DESC* fullscreenDesc,
    ID3D12CommandQueue* queue,
    ID.gifactory* d.gifactory,
    FfxSwapchain& outGameSwapChain
)

Creates a FfxSwapchain from passed in parameters.

Parameters:

hWnd

The HWND handle for the calling application.

desc1

The DXGI_SWAP_CHAIN_DESC1 describing the swapchain creation parameters from the calling application.

fullscreenDesc

The DXGI_SWAP_CHAIN_FULLSCREEN_DESC describing the full screen swapchain creation parameters from the calling application.

queue

The ID3D12CommandQueue to use for frame interpolation presentation.

d.gifactory

The ID.gifactory to use for DX12 swapchain creation.

outGameSwapChain

The created FfxSwapchain.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

One of the parameters is invalid. FFX_ERROR_OUT_OF_MEMORY Insufficient memory available to allocate FfxSwapchain or underlying component.


ffxWaitForPresents

Copied!

FFX_API  FfxErrorCode  ffxWaitForPresents (FfxSwapchain gameSwapChain)

Waits for the FfxSwapchain to complete presentation.

Parameters:

gameSwapChain

The FfxSwapchain to wait on.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

Could not query the interface for the frame interpolation swap chain.


ffxRegisterFrameinterpolationUiResourceDX12

Copied!

FFX_API  FfxErrorCode  ffxRegisterFrameinterpolationUiResourceDX12 (
    FfxSwapchain gameSwapChain,
    FfxResource  uiResource,
    uint32_t flags
)

Registers a FfxResource to use for UI with the provided FfxSwapchain.

Parameters:

gameSwapChain

The FfxSwapchain to to register the UI resource with.

uiResource

The FfxResource representing the UI resource.

flags

A set of FfxUiCompositionFlags.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

Could not query the interface for the frame interpolation swap chain.


ffxGetFrameinterpolationCommandlistDX12

Copied!

FFX_API  FfxErrorCode  ffxGetFrameinterpolationCommandlistDX12 (
    FfxSwapchain gameSwapChain,
    FfxCommandList & gameCommandlist
)

Fetches a FfxCommandList from the FfxSwapchain.

Parameters:

gameSwapChain

The FfxSwapchain to get a FfxCommandList from.

gameCommandlist

The FfxCommandList from the provided FfxSwapchain.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

Could not query the interface for the frame interpolation swap chain.


ffxGetFrameinterpolationTextureDX12

Copied!

FFX_API  FfxResource  ffxGetFrameinterpolationTextureDX12 (FfxSwapchain gameSwapChain)

Fetches a FfxResource representing the backbuffer from the FfxSwapchain.

Parameters:

gameSwapChain

The FfxSwapchain to get a FfxResource backbuffer from.

Returns:

An abstract FidelityFX resources for the swapchain backbuffer.


ffxSetFrameGenerationConfigToSwapchainDX12

Copied!

FFX_API  FfxErrorCode  ffxSetFrameGenerationConfigToSwapchainDX12 (FfxFrameGenerationConfig  const* config)

Sets a FfxFrameGenerationConfig to the internal FrameInterpolationSwapChain (in the backend).

Parameters:

config

The FfxFrameGenerationConfig to set.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

Could not query the interface for the frame interpolation swap chain.


ffxConfigureFrameInterpolationSwapchainDX12

Copied!

FFX_API  FfxErrorCode  ffxConfigureFrameInterpolationSwapchainDX12 (
    FfxSwapchain gameSwapChain,
    FfxFrameInterpolationSwapchainConfigureKey key,
    void* valuePtr
)

Configures FfxSwapchain via KeyValue API post FfxSwapchain context creation.

Parameters:

gameSwapChain

The FfxSwapchain to configure via KeyValue API

key

The FfxFrameInterpolationSwapchainConfigureKey is key

valuePtr

The <void *> pointer to value. What this pointer deference to depends on key.

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

Could not query the interface for the frame interpolation swap chain.


ffxFrameInterpolationSwapchainGetGpuMemoryUsageDX12

Copied!

FFX_API  FfxErrorCode  ffxFrameInterpolationSwapchainGetGpuMemoryUsageDX12 (
    FfxSwapchain gameSwapChain,
    FfxEffectMemoryUsage * vramUsage
)

Query how much GPU memory created by FfxSwapchain. This excludes GPU memory created by DXGI (ie. size of DXGI swapchaim backbuffers).

Parameters:

gameSwapChain

The FfxSwapchain to configure via KeyValue API

vramUsage

The FfxEffectMemoryUsage is the GPU memory created by FrameInterpolationSwapchain

Return values:

FFX_OK

The operation completed successfully.

FFX_ERROR_INVALID_ARGUMENT

Could not query the interface for the frame interpolation swap chain.