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

Enumerations

enum  xefg_swapchain_ui_composition_state_t { XEFG_SWAPCHAIN_UI_COMPOSITION_STATE_DISABLED , XEFG_SWAPCHAIN_UI_COMPOSITION_STATE_ENABLED }
 Controls whether UI composition is enabled or disabled. More...

Functions

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainGetVersion (xefg_swapchain_version_t *pVersion)
 Gets the XeSS-FG Swap Chain version. This is baked into the XeSS-FG Swap Chain SDK release.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainGetProperties (xefg_swapchain_handle_t hSwapChain, xefg_swapchain_properties_t *pProperties)
 Retrieves various XeSS-FG Swap Chain properties.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainTagFrameConstants (xefg_swapchain_handle_t hSwapChain, uint32_t presentId, const xefg_swapchain_frame_constant_data_t *pConstants)
 Informs the XeSS-FG swap chain library of the frame constants used to generate a frame that will be presented.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetEnabled (xefg_swapchain_handle_t hSwapChain, uint32_t enable)
 Enables or disables the generation and presentation of interpolated frames by the XeSS-FG swap chain library.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetPresentId (xefg_swapchain_handle_t hSwapChain, uint32_t presentId)
 Informs the XeSS-FG swap chain library of the unique identifier of the next frame to be presented. This allows the application to provide to the swap chain library frames data out-of-order with regard to the presentation.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainGetLastPresentStatus (xefg_swapchain_handle_t hSwapChain, xefg_swapchain_present_status_t *pPresentStatus)
 This function allows you to retrieve status information from the last present.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetLoggingCallback (xefg_swapchain_handle_t hSwapChain, xefg_swapchain_logging_level_t loggingLevel, xefg_swapchain_app_log_callback_t loggingCallback, void *userData)
 Sets logging callback.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainDestroy (xefg_swapchain_handle_t hSwapChain)
 Destroys a XeSS-FG Swap Chain context data. DXGI swap chain object will be released as soon as reference count reaches 0, so it's recommended to release all outstanding references before calling this function.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetLatencyReduction (xefg_swapchain_handle_t hSwapChain, void *hXeLLContext)
 Sets XeLL context for latency reduction.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetSceneChangeThreshold (xefg_swapchain_handle_t hSwapChain, float threshold)
 Sets scene change detection threshold.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainGetPipelineBuildStatus (xefg_swapchain_handle_t hSwapChain)
 Returns current state of the pipeline build.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetNumInterpolatedFrames (xefg_swapchain_handle_t hSwapChain, uint32_t numInterpolatedFrames)
 Adjust the number of interpolated frames after initialization.
XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetUiCompositionState (xefg_swapchain_handle_t hSwapChain, xefg_swapchain_ui_composition_state_t state)
 Enable or disable UI composition.

Detailed Description

The XeSS-FG Swap Chain API is used by applications to generate frames when the application does not choose to be responsible for the in-order presentation of the generated frames. This utils API wraps the IDXGISwapChain and makes calls on behalf of the application to the underlying XeSS-FG API.

Enumeration Type Documentation

◆ xefg_swapchain_ui_composition_state_t

Controls whether UI composition is enabled or disabled.

Enumerator
XEFG_SWAPCHAIN_UI_COMPOSITION_STATE_DISABLED 
XEFG_SWAPCHAIN_UI_COMPOSITION_STATE_ENABLED 

Definition at line 492 of file xefg_swapchain.h.

Function Documentation

◆ xefgSwapChainDestroy()

Destroys a XeSS-FG Swap Chain context data. DXGI swap chain object will be released as soon as reference count reaches 0, so it's recommended to release all outstanding references before calling this function.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainGetLastPresentStatus()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainGetLastPresentStatus ( xefg_swapchain_handle_t hSwapChain,
xefg_swapchain_present_status_t * pPresentStatus )

This function allows you to retrieve status information from the last present.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
[out]pPresentStatusA pointer to the xefg_swapchain_present_status_t structure where the values should be returned.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainGetPipelineBuildStatus()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainGetPipelineBuildStatus ( xefg_swapchain_handle_t hSwapChain)

Returns current state of the pipeline build.

This function can only be called after xefgSwapChainD3D12BuildPipelines but before XeSS-FG swap chain initialization (xefgSwapChainD3D12InitFromSwapChain or xefgSwapChainD3D12InitFromSwapChainDesc).

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
Returns
XEFG_SWAPCHAIN_RESULT_SUCCESS if pipelines are already built. XEFG_SWAPCHAIN_RESULT_ERROR_OPERATION_IN_PROGRESS if pipeline build are in progress. XEFG_SWAPCHAIN_RESULT_ERROR_WRONG_CALL_ORDER if the function is called out of order.

◆ xefgSwapChainGetProperties()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainGetProperties ( xefg_swapchain_handle_t hSwapChain,
xefg_swapchain_properties_t * pProperties )

Retrieves various XeSS-FG Swap Chain properties.

Note
When called before the proxy swap chain initialization, this function will only report pProperties->maxSupportedInterpolations, all other fields of pProperties will be set to zero.

If you need to query the required heap sizes and the descriptor count before the proxy swap chain initialization, use xefgSwapChainD3D12GetProperties.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
[out]pPropertiesA pointer to the xefg_swapchain_properties_t structure where the values should be returned.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainGetVersion()

Gets the XeSS-FG Swap Chain version. This is baked into the XeSS-FG Swap Chain SDK release.

Parameters
[out]pVersionReturned XeSS-FG Swap Chain version.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainSetEnabled()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetEnabled ( xefg_swapchain_handle_t hSwapChain,
uint32_t enable )

Enables or disables the generation and presentation of interpolated frames by the XeSS-FG swap chain library.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
enableNon-zero to enable interpolation, zero to disable it.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainSetLatencyReduction()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetLatencyReduction ( xefg_swapchain_handle_t hSwapChain,
void * hXeLLContext )

Sets XeLL context for latency reduction.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
hXeLLContextThe Xe Low Latency context.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainSetLoggingCallback()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetLoggingCallback ( xefg_swapchain_handle_t hSwapChain,
xefg_swapchain_logging_level_t loggingLevel,
xefg_swapchain_app_log_callback_t loggingCallback,
void * userData )

Sets logging callback.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
loggingLevelMinimum logging level for logging callback.
loggingCallbackLogging callback.
userDataUser data that will be passed unchanged to the callback when invoked. Can be set to NULL.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainSetNumInterpolatedFrames()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetNumInterpolatedFrames ( xefg_swapchain_handle_t hSwapChain,
uint32_t numInterpolatedFrames )

Adjust the number of interpolated frames after initialization.

By default, XeSS-FG swap chain will produce the maximum number of interpolated frames specified during initialization. Use this function to change the number of interpolated frames without reinitializing the swap chain.

The number of interpolated frames must be between 1 and the maximum provided during swap chain initialization, otherwise the function returns XEFG_SWAPCHAIN_RESULT_ERROR_INVALID_ARGUMENT.

Performance Note: Avoid frequent calls to this function, as changing the number of interpolated frames may trigger shader compilation and reallocation of internal resources.

Error Handling: If this function fails for any reason other than XEFG_SWAPCHAIN_RESULT_ERROR_INVALID_ARGUMENT, reinitialize the swap chain (this is rare). Ignoring such errors may lead to unexpected behavior. On non-argument errors, XeSS-FG automatically disables frame generation to keep the swap chain operational (e.g., it can still display error messages).

Thread-Safety: This function is not thread-safe with regard to calls to xefgSwapChainD3D12InitFromSwapChain, xefgSwapChainD3D12InitFromSwapChainDesc, and xefgSwapChainDestroy. Do not call xefgSwapChainSetNumInterpolatedFrames if another thread might be initializing or destroying the swap chain.

◆ xefgSwapChainSetPresentId()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetPresentId ( xefg_swapchain_handle_t hSwapChain,
uint32_t presentId )

Informs the XeSS-FG swap chain library of the unique identifier of the next frame to be presented. This allows the application to provide to the swap chain library frames data out-of-order with regard to the presentation.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
presentIdThe unique identifier of the frame to be presented by the next IDXGISwapChain::Present call.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainSetSceneChangeThreshold()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainSetSceneChangeThreshold ( xefg_swapchain_handle_t hSwapChain,
float threshold )

Sets scene change detection threshold.

A higher threshold value increases the algorithm's sensitivity, causing it to more readily identify scene changes and disable interpolation. A lower threshold value decreases sensitivity, making the algorithm less likely to respond to minor changes. The threshold value range is from 0 to 1, where 0 represents the least sensitivity to scene changes, and 1 represents the highest sensitivity.

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
thresholdScene change detection threshold value. Default value is 0.7.
Returns
XeSS-FG Swap Chain return status code.

◆ xefgSwapChainSetUiCompositionState()

Enable or disable UI composition.

If UI composition is disabled, UI mode will have no effect.

Setting UI mode to XEFG_SWAPCHAIN_UI_MODE_NONE and enabling UI composition is the same as disabling UI composition.

Note
Try no UI composition first (default), then switch to UI composition if you are not happy with the no-composition output.

◆ xefgSwapChainTagFrameConstants()

XEFG_SWAPCHAIN_API xefg_swapchain_result_t xefgSwapChainTagFrameConstants ( xefg_swapchain_handle_t hSwapChain,
uint32_t presentId,
const xefg_swapchain_frame_constant_data_t * pConstants )

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

Parameters
hSwapChainThe XeSS-FG Swap Chain context handle.
presentIdThe unique frame identifier.
pConstantsA pointer to the memory location where the values for the constants are located.
Returns
XeSS-FG Swap Chain return status code.