XeSS-FG SDK API Reference Guide 1.3.1
Loading...
Searching...
No Matches
XeSS-FG Swap Chain D3D12 API exports

Functions

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12CreateContext (ID3D12Device *pDevice, xefg_swapchain_handle_t *phSwapChain)
 Creates a swap chain handle and checks necessary D3D12 features.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12BuildPipelines (xefg_swapchain_handle_t hSwapChain, ID3D12PipelineLibrary *pPipelineLibrary, uint8_t blocking, uint32_t initFlags)
 Initiates pipeline build process This function can only be called between xefgSwapChainD3D12CreateContext and any initialization function This call initiates build of DX12 pipelines and kernel compilation This call can be blocking (if blocking set to true) or non-blocking. In case of non-blocking call library will wait for pipeline build on call to initialization function If pPipelineLibrary passed to this call - same pipeline library must be passed to initialization function Pipeline build status can be retrieved using xefgSwapChainGetPipelineBuildStatus.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12GetProperties (xefg_swapchain_handle_t context, const xefg_swapchain_d3d12_init_params_t *initParams, uint32_t backBufferWidth, uint32_t backBufferHeight, DXGI_FORMAT backBufferFormat, xefg_swapchain_properties_t *properties)
 Queries properties (including required heap sizes) given desired initialization parameters.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12InitFromSwapChain (xefg_swapchain_handle_t hSwapChain, ID3D12CommandQueue *pCmdQueue, const xefg_swapchain_d3d12_init_params_t *pInitParams)
 Initializes the XeSS-FG Swap Chain library for the generation and presentation of additional frames. The application should call xefgSwapChainD3D12GetSwapChainPtr to retrieve the actual IDXGISwapChain handle.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12InitFromSwapChainDesc (xefg_swapchain_handle_t hSwapChain, HWND hWnd, const DXGI_SWAP_CHAIN_DESC1 *pSwapChainDesc, const DXGI_SWAP_CHAIN_FULLSCREEN_DESC *pFullscreenDesc, ID3D12CommandQueue *pCmdQueue, IDXGIFactory2 *pDxgiFactory, const xefg_swapchain_d3d12_init_params_t *pInitParams)
 Initializes the XeSS-FG Swap Chain library for the generation and presentation of additional frames. The application should call xefgSwapChainD3D12GetSwapChainPtr to retrieve the actual IDXGISwapChain handle.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12GetSwapChainPtr (xefg_swapchain_handle_t hSwapChain, REFIID riid, void **ppSwapChain)
 Gets a pointer to a DXGI swap chain. The application must use it for all presentation in the application.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12TagFrameResource (xefg_swapchain_handle_t hSwapChain, ID3D12CommandList *pCmdList, uint32_t presentId, const xefg_swapchain_d3d12_resource_data_t *pResData)
 Informs the XeSS-FG swap chain library of the frame resources used to generate a frame that will be presented.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12SetDescriptorHeap (xefg_swapchain_handle_t hSwapChain, ID3D12DescriptorHeap *pDescriptorHeap, uint32_t descriptorHeapOffsetInBytes)
 Informs the XeSS-FG swap chain library of the descriptor heap to use during frame generation. This API needs to be called before presenting a frame. The descriptor heap must be a D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12UpdateExternalHeapOnResize (xefg_swapchain_handle_t hSwapChain, ID3D12Heap *tempBufferHeap, uint64_t tempBufferHeapOffset, ID3D12Heap *tempTextureHeap, uint64_t tempTextureHeapOffset)
 Updates external heap pointers during the next call to ResizeBuffers or ResizeBuffers1.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12GetInitializationParameters (xefg_swapchain_handle_t hSwapChain, xefg_swapchain_d3d12_init_params_t *pParams)
 Retrieve initialization parameters if the initialization was successful.

Detailed Description

Function Documentation

◆ xefgSwapChainD3D12BuildPipelines()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12BuildPipelines ( xefg_swapchain_handle_t hSwapChain,
ID3D12PipelineLibrary * pPipelineLibrary,
uint8_t blocking,
uint32_t initFlags )

Initiates pipeline build process This function can only be called between xefgSwapChainD3D12CreateContext and any initialization function This call initiates build of DX12 pipelines and kernel compilation This call can be blocking (if blocking set to true) or non-blocking. In case of non-blocking call library will wait for pipeline build on call to initialization function If pPipelineLibrary passed to this call - same pipeline library must be passed to initialization function Pipeline build status can be retrieved using xefgSwapChainGetPipelineBuildStatus.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
pPipelineLibraryOptional pointer to pipeline library for pipeline caching.
blockingWait for kernel compilation and pipeline creation to finish or not
initFlagsInitialization flags. Must be identical to flags passed to initialization function

◆ xefgSwapChainD3D12CreateContext()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12CreateContext ( ID3D12Device * pDevice,
xefg_swapchain_handle_t * phSwapChain )

Creates a swap chain handle and checks necessary D3D12 features.

Parameters
pDeviceA D3D12 device created by the user.
[out]phSwapChainPointer to a XeSS-FG swap chain context handle.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainD3D12GetInitializationParameters()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12GetInitializationParameters ( xefg_swapchain_handle_t hSwapChain,
xefg_swapchain_d3d12_init_params_t * pParams )

Retrieve initialization parameters if the initialization was successful.

This function is not thread-safe with regards to calls to xefgSwapChainD3D12InitFromSwapChain, xefgSwapChainD3D12InitFromSwapChainDesc, and xefgSwapChainDestroy. Do not call xefgSwapChainD3D12GetInitializationParameters if another thread might be doing initialization of or destroying the same context handle.

Parameters
hSwapChainXeSS-FG swap chain context handle.
[out]pParamswill contain parameters that were used to initialize the provided swap chain.
Note
  • pParams->pApplicationSwapChain will be set to NULL to signify that the swap chain was re-created.
  • pParams->maxInterpolatedFrames will be set to the actual value that was used during initialization: the maximum suppored number if the user requested XEFG_SWAPCHAIN_USE_MAX_SUPPORTED_INTERPOLATED_FRAMES or the user-provided value otherwise.

◆ xefgSwapChainD3D12GetProperties()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12GetProperties ( xefg_swapchain_handle_t context,
const xefg_swapchain_d3d12_init_params_t * initParams,
uint32_t backBufferWidth,
uint32_t backBufferHeight,
DXGI_FORMAT backBufferFormat,
xefg_swapchain_properties_t * properties )

Queries properties (including required heap sizes) given desired initialization parameters.

This function can be called before or after the proxy swap chain initialization.

Once the proxy swap chain is initialized, properties returned by this function will match the properties returned by xefgSwapChainGetProperties.

Use this function to determine heap sizes required for successful initialization of the proxy swap chain. The heap sizes are valid for any number of interpolated between one and the maximum specified via initParams.maxInterpolatedFrames.

If you need to query heap sizes required for a resolution change, set initParams to NULL and pass in the new backBufferWidth and backBufferHeight.

If you don't want to specify the maximum number of interpolated frames, set initParams.maxInterpolatedFrames to XEFG_SWAPCHAIN_USE_MAX_SUPPORTED_INTERPOLATED_FRAMES.

Parameters
context
initParams- pass NULL to use the values provided during the proxy swap chain initialization
backBufferWidth- pass 0 to use the value provided during initialization.
backBufferHeight- pass 0 to use the value provided during initialization.
backBufferFormat- pass DXGI_FORMAT_UNKNOWN to use the value provided during initialization.
properties- output, cannot be NULL
Returns
XEFG_SWAPCHAIN_RESULT_SUCCESS if the operation was successful.

◆ xefgSwapChainD3D12GetSwapChainPtr()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12GetSwapChainPtr ( xefg_swapchain_handle_t hSwapChain,
REFIID riid,
void ** ppSwapChain )

Gets a pointer to a DXGI swap chain. The application must use it for all presentation in the application.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
riidType of the interface to which the caller wants a pointer.
[out]ppSwapChainPointer to a IDXGISwapChain handle.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainD3D12InitFromSwapChain()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12InitFromSwapChain ( xefg_swapchain_handle_t hSwapChain,
ID3D12CommandQueue * pCmdQueue,
const xefg_swapchain_d3d12_init_params_t * pInitParams )

Initializes the XeSS-FG Swap Chain library for the generation and presentation of additional frames. The application should call xefgSwapChainD3D12GetSwapChainPtr to retrieve the actual IDXGISwapChain handle.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
pCmdQueueCommand queue used by the application to present frames. This queue must conform to all restrictions of any IDXGISwapChain.
pInitParamsXeSS-FG Swap Chain API initialization parameters.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainD3D12InitFromSwapChainDesc()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12InitFromSwapChainDesc ( xefg_swapchain_handle_t hSwapChain,
HWND hWnd,
const DXGI_SWAP_CHAIN_DESC1 * pSwapChainDesc,
const DXGI_SWAP_CHAIN_FULLSCREEN_DESC * pFullscreenDesc,
ID3D12CommandQueue * pCmdQueue,
IDXGIFactory2 * pDxgiFactory,
const xefg_swapchain_d3d12_init_params_t * pInitParams )

Initializes the XeSS-FG Swap Chain library for the generation and presentation of additional frames. The application should call xefgSwapChainD3D12GetSwapChainPtr to retrieve the actual IDXGISwapChain handle.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
hWndWindow handle used to create the swap chain.
pSwapChainDescSwap chain description.
pFullscreenDescFullscreen swap chain description. Can be set to NULL.
pCmdQueueCommand queue used by the application to present frames. This queue must conform to all restrictions of any IDXGISwapChain.
pDxgiFactoryIDXGIFactory2 object to be used for the swap chain creation.
pInitParamsXeSS-FG Swap Chain API initialization parameters. pApplicationSwapChain field will not be used and must be set to NULL, a swap chain will be created according to hWnd, pSwapChainDesc and pFullscreenDesc.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainD3D12SetDescriptorHeap()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12SetDescriptorHeap ( xefg_swapchain_handle_t hSwapChain,
ID3D12DescriptorHeap * pDescriptorHeap,
uint32_t descriptorHeapOffsetInBytes )

Informs the XeSS-FG swap chain library of the descriptor heap to use during frame generation. This API needs to be called before presenting a frame. The descriptor heap must be a D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
pDescriptorHeapa pointer to the ID3D12DescriptorHeap object used during interpolation programming.
descriptorHeapOffsetInBytesThe offset within pDescriptorHeap XeSS-FG will start using during interpolation programming, in bytes. This value is number of descriptors to skip times GetDescriptorHandleIncrementSize().
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainD3D12TagFrameResource()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12TagFrameResource ( xefg_swapchain_handle_t hSwapChain,
ID3D12CommandList * pCmdList,
uint32_t presentId,
const xefg_swapchain_d3d12_resource_data_t * pResData )

Informs the XeSS-FG swap chain library of the frame resources used to generate a frame that will be presented.

Attention
This function can be used to provide information about the interpolation region within the backbuffer by using XEFG_SWAPCHAIN_RES_BACKBUFFER resource type. In that case only information about region (size and offset) is used from the pResData argument.
Parameters
hSwapChainThe swap chain associated with the resource being tagged.
pCmdListOptional command list utilized to manage the resource lifetime. It is only required if the resource is not valid until the next present call.
presentIdThe unique frame identifier this resource is associated with.
pResDataThe resource and the information needed to properly manage and interpret it.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainD3D12UpdateExternalHeapOnResize()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainD3D12UpdateExternalHeapOnResize ( xefg_swapchain_handle_t hSwapChain,
ID3D12Heap * tempBufferHeap,
uint64_t tempBufferHeapOffset,
ID3D12Heap * tempTextureHeap,
uint64_t tempTextureHeapOffset )

Updates external heap pointers during the next call to ResizeBuffers or ResizeBuffers1.

XeSS-FG won't reference the provided heap pointers until the application calls ResizeBuffers or ResizeBuffers1. Once ResizeBuffers or ResizeBuffers1 return control back to the application, XeSS-FG is guaranteed to be using the new heaps.

If ResizeBuffers or ResizeBuffers1 fail, XeSS-FG will release the references to the provided heaps.

Use xefgSwapChainD3D12GetProperties to get the required heap sizes.

Parameters
hSwapChain
tempBufferHeap
tempBufferHeapOffset- must be zero if tempBufferHeap is null
tempTextureHeap
tempTextureHeapOffset- must be zero if tempTextureHeap is null
Returns