![]() |
XeSS-FG SDK API Reference Guide 1.3.1
|
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. | |
| 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.
| hSwapChain | The XeSS-FG Swap Chain context handle. |
| pPipelineLibrary | Optional pointer to pipeline library for pipeline caching. |
| blocking | Wait for kernel compilation and pipeline creation to finish or not |
| initFlags | Initialization flags. Must be identical to flags passed to initialization function |
| 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.
| pDevice | A D3D12 device created by the user. | |
| [out] | phSwapChain | Pointer to a XeSS-FG swap chain context handle. |
| 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.
| hSwapChain | XeSS-FG swap chain context handle. | |
| [out] | pParams | will contain parameters that were used to initialize the provided swap chain. |
| 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.
| 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 |
| 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.
| hSwapChain | The XeSS-FG Swap Chain context handle. | |
| riid | Type of the interface to which the caller wants a pointer. | |
| [out] | ppSwapChain | Pointer to a IDXGISwapChain handle. |
| 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.
| hSwapChain | The XeSS-FG Swap Chain context handle. |
| pCmdQueue | Command queue used by the application to present frames. This queue must conform to all restrictions of any IDXGISwapChain. |
| pInitParams | XeSS-FG Swap Chain API initialization parameters. |
| 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.
| hSwapChain | The XeSS-FG Swap Chain context handle. |
| hWnd | Window handle used to create the swap chain. |
| pSwapChainDesc | Swap chain description. |
| pFullscreenDesc | Fullscreen swap chain description. Can be set to NULL. |
| pCmdQueue | Command queue used by the application to present frames. This queue must conform to all restrictions of any IDXGISwapChain. |
| pDxgiFactory | IDXGIFactory2 object to be used for the swap chain creation. |
| pInitParams | XeSS-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. |
| 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.
| hSwapChain | The XeSS-FG Swap Chain context handle. |
| pDescriptorHeap | a pointer to the ID3D12DescriptorHeap object used during interpolation programming. |
| descriptorHeapOffsetInBytes | The offset within pDescriptorHeap XeSS-FG will start using during interpolation programming, in bytes. This value is number of descriptors to skip times GetDescriptorHandleIncrementSize(). |
| 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_RES_BACKBUFFER resource type. In that case only information about region (size and offset) is used from the pResData argument.| hSwapChain | The swap chain associated with the resource being tagged. |
| pCmdList | Optional command list utilized to manage the resource lifetime. It is only required if the resource is not valid until the next present call. |
| presentId | The unique frame identifier this resource is associated with. |
| pResData | The resource and the information needed to properly manage and interpret it. |
| 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.
| hSwapChain | |
| tempBufferHeap | |
| tempBufferHeapOffset | - must be zero if tempBufferHeap is null |
| tempTextureHeap | |
| tempTextureHeapOffset | - must be zero if tempTextureHeap is null |