XeSS-FG SDK API Reference Guide 1.3.1
Loading...
Searching...
No Matches
xefg_swapchain.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2024 Intel Corporation
3 *
4 * This software and the related documents are Intel copyrighted materials, and
5 * your use of them is governed by the express license under which they were
6 * provided to you ("License"). Unless the License provides otherwise, you may
7 * not use, modify, copy, publish, distribute, disclose or transmit this
8 * software or the related documents without Intel's prior written permission.
9 *
10 * This software and the related documents are provided as is, with no express
11 * or implied warranties, other than those that are expressly stated in the
12 * License.
13 ******************************************************************************/
14
15#ifndef XEFG_SWAPCHAIN_H
16#define XEFG_SWAPCHAIN_H
17
18#ifdef _WIN32
19 #ifdef XEFG_SWAPCHAIN_EXPORT_API
20 #define XEFG_SWAPCHAIN_API __declspec(dllexport)
21 #else
22 #define XEFG_SWAPCHAIN_API
23 #endif
24#else
25 #define XEFG_SWAPCHAIN_API __attribute__((visibility("default")))
26#endif
27
28#if !defined _MSC_VER || (_MSC_VER >= 1929)
29#define XEFG_SWAPCHAIN_PRAGMA(x) _Pragma(#x)
30#else
31#define XEFG_SWAPCHAIN_PRAGMA(x) __pragma(x)
32#endif
33#define XEFG_SWAPCHAIN_PACK_B_X(x) XEFG_SWAPCHAIN_PRAGMA(pack(push, x))
34#define XEFG_SWAPCHAIN_PACK_E() XEFG_SWAPCHAIN_PRAGMA(pack(pop))
35#define XEFG_SWAPCHAIN_PACK_B() XEFG_SWAPCHAIN_PACK_B_X(8)
36
37#define XEFG_SWAPCHAIN_CAT_IMPL(a,b) a##b
38#define XEFG_SWAPCHAIN_CAT(a,b) XEFG_SWAPCHAIN_CAT_IMPL(a,b)
39#define XEFG_SWAPCHAIN_STATIC_ASSERT(cond)\
40 typedef int XEFG_SWAPCHAIN_CAT(XEFG_SWAPCHAIN_STATIC_ASSERT_IMPL, __COUNTER__)[(cond) ? 1 : -1]
41
42#include <limits.h>
43#include <stdint.h>
44
56#define XEFG_SWAPCHAIN_USE_MAX_SUPPORTED_INTERPOLATED_FRAMES UINT32_MAX
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
62typedef struct _xefg_swapchain_handle_t* xefg_swapchain_handle_t;
63
78
99
112
120{
123 uint16_t major;
126 uint16_t minor;
131 uint16_t patch;
133 uint16_t reserved;
136
142{
143 uint32_t x;
144 uint32_t y;
147
172
191
192
196{
252
256
267
295
310
311
317typedef void (*xefg_swapchain_app_log_callback_t)(const char* message, xefg_swapchain_logging_level_t loggingLevel, void* userData);
318
328
335
352
366 uint32_t presentId, const xefg_swapchain_frame_constant_data_t* pConstants);
367
378
391
402
413 xefg_swapchain_logging_level_t loggingLevel, xefg_swapchain_app_log_callback_t loggingCallback, void* userData);
414
422
432
447
461
487 xefg_swapchain_handle_t hSwapChain, uint32_t numInterpolatedFrames);
488
492typedef enum
493{
494 /* UI mode set during initialization has no effect. This is the default state. */
496 /* UI is composited on top of the interpolated frame according to the UI mode set during initialization. */
499
513
515
516/* Enum size checks. All enums must be 4 bytes. */
523
524#ifdef __cplusplus
525}
526#endif
527
528#endif /* XEFG_SWAPCHAIN_H */
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 ...
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 xefgSwapChainDestroy(xefg_swapchain_handle_t hSwapChain)
Destroys a XeSS-FG Swap Chain context data. DXGI swap chain object will be released as soon as refere...
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_ui_composition_state_t
Controls whether UI composition is enabled or disabled.
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 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 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 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....
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.
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 p...
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 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_UI_COMPOSITION_STATE_ENABLED
@ XEFG_SWAPCHAIN_UI_COMPOSITION_STATE_DISABLED
Contains all constants associated with a frame.
Contains status data for the present.
xefg_swapchain_result_t frameGenResult
Properties for internal XeSS-FG Swap Chain resources.
XeSS-FG Swap Chain version.
enum _xefg_swapchain_ui_mode_t xefg_swapchain_ui_mode_t
XeSS-FG UI composition mode.
struct _xefg_swapchain_handle_t * xefg_swapchain_handle_t
#define XEFG_SWAPCHAIN_PACK_E()
_xefg_swapchain_resource_validity_t
Informs the library about the lifetime of the resource being provided. The library will take appropri...
@ XEFG_SWAPCHAIN_RV_ONLY_NOW
@ XEFG_SWAPCHAIN_RV_COUNT
@ XEFG_SWAPCHAIN_RV_UNTIL_NEXT_PRESENT
#define XEFG_SWAPCHAIN_API
enum _xefg_swapchain_result_t xefg_swapchain_result_t
XeSS-FG Swap Chain return codes.
_xefg_swapchain_ui_mode_t
XeSS-FG UI composition mode.
@ XEFG_SWAPCHAIN_UI_MODE_AUTO
@ XEFG_SWAPCHAIN_UI_MODE_HUDLESS_UITEXTURE
@ XEFG_SWAPCHAIN_UI_MODE_BACKBUFFER_HUDLESS_UITEXTURE
@ XEFG_SWAPCHAIN_UI_MODE_NONE
@ XEFG_SWAPCHAIN_UI_MODE_BACKBUFFER_UITEXTURE
@ XEFG_SWAPCHAIN_UI_MODE_BACKBUFFER_HUDLESS
struct _xefg_swapchain_properties_t xefg_swapchain_properties_t
Properties for internal XeSS-FG Swap Chain resources.
struct _xefg_swapchain_frame_constant_data_t xefg_swapchain_frame_constant_data_t
Contains all constants associated with a frame.
#define XEFG_SWAPCHAIN_PACK_B()
_xefg_swapchain_init_flags_t
XeSS-FG Swap Chain initialization flags.
@ XEFG_SWAPCHAIN_INIT_FLAG_HIGH_RES_MV
@ XEFG_SWAPCHAIN_INIT_FLAG_JITTERED_MV
@ XEFG_SWAPCHAIN_INIT_FLAG_NONE
@ XEFG_SWAPCHAIN_INIT_FLAG_INVERTED_DEPTH
@ XEFG_SWAPCHAIN_INIT_FLAG_USE_NDC_VELOCITY
@ XEFG_SWAPCHAIN_INIT_FLAG_UITEXTURE_NOT_PREMUL_ALPHA
@ XEFG_SWAPCHAIN_INIT_FLAG_EXTERNAL_DESCRIPTOR_HEAP
_xefg_swapchain_resource_type_t
XeSS-FG Swap Chain resources type.
@ XEFG_SWAPCHAIN_RES_COUNT
@ XEFG_SWAPCHAIN_RES_HUDLESS_COLOR
@ XEFG_SWAPCHAIN_RES_DEPTH
@ XEFG_SWAPCHAIN_RES_MOTION_VECTOR
@ XEFG_SWAPCHAIN_RES_BACKBUFFER
@ XEFG_SWAPCHAIN_RES_UI
enum _xefg_swapchain_resource_type_t xefg_swapchain_resource_type_t
XeSS-FG Swap Chain resources type.
enum _xefg_swapchain_init_flags_t xefg_swapchain_init_flags_t
XeSS-FG Swap Chain initialization flags.
_xefg_swapchain_logging_level_t
XeSS-FG Swap Chain logging level.
@ XEFG_SWAPCHAIN_LOGGING_LEVEL_ERROR
@ XEFG_SWAPCHAIN_LOGGING_LEVEL_INFO
@ XEFG_SWAPCHAIN_LOGGING_LEVEL_WARNING
@ XEFG_SWAPCHAIN_LOGGING_LEVEL_DEBUG
struct _xefg_swapchain_version_t xefg_swapchain_version_t
XeSS-FG Swap Chain version.
enum _xefg_swapchain_logging_level_t xefg_swapchain_logging_level_t
XeSS-FG Swap Chain logging level.
#define XEFG_SWAPCHAIN_STATIC_ASSERT(cond)
struct _xefg_swapchain_present_status_t xefg_swapchain_present_status_t
Contains status data for the present.
struct _xefg_swapchain_2d_t xefg_swapchain_2d_t
2D variable.
enum _xefg_swapchain_resource_validity_t xefg_swapchain_resource_validity_t
Informs the library about the lifetime of the resource being provided. The library will take appropri...
void(* xefg_swapchain_app_log_callback_t)(const char *message, xefg_swapchain_logging_level_t loggingLevel, void *userData)
_xefg_swapchain_result_t
XeSS-FG Swap Chain return codes.
@ XEFG_SWAPCHAIN_RESULT_ERROR_INVALID_ARGUMENT
@ XEFG_SWAPCHAIN_RESULT_ERROR_LATENCY_REDUCTION_UNSUPPORTED
@ XEFG_SWAPCHAIN_RESULT_ERROR_POINTER_STILL_IN_USE
@ XEFG_SWAPCHAIN_RESULT_WARNING_FRAMES_ID_MISMATCH
@ XEFG_SWAPCHAIN_RESULT_ERROR_UNSUPPORTED_DRIVER
@ XEFG_SWAPCHAIN_RESULT_ERROR_UNKNOWN
@ XEFG_SWAPCHAIN_RESULT_ERROR_CANT_LOAD_LIBRARY
@ XEFG_SWAPCHAIN_RESULT_ERROR_OPERATION_IN_PROGRESS
@ XEFG_SWAPCHAIN_RESULT_ERROR_UNSUPPORTED_DEVICE
@ XEFG_SWAPCHAIN_RESULT_ERROR_INVALID_DESCRIPTOR_HEAP
@ XEFG_SWAPCHAIN_RESULT_ERROR_WRONG_CALL_ORDER
@ XEFG_SWAPCHAIN_RESULT_SUCCESS
@ XEFG_SWAPCHAIN_RESULT_ERROR_UNINITIALIZED
@ XEFG_SWAPCHAIN_RESULT_ERROR_DEVICE
@ XEFG_SWAPCHAIN_RESULT_ERROR_INCORRECT_INPUT_RESOURCES
@ XEFG_SWAPCHAIN_RESULT_WARNING_OLD_DRIVER
@ XEFG_SWAPCHAIN_RESULT_WARNING_RESOURCE_SIZES_MISMATCH
@ XEFG_SWAPCHAIN_RESULT_ERROR_LATENCY_REDUCTION_FUNCTION_MISSING
@ XEFG_SWAPCHAIN_RESULT_ERROR_INCORRECT_OUTPUT_RESOURCES
@ XEFG_SWAPCHAIN_RESULT_WARNING_MISSING_PRESENT_STATUS
@ XEFG_SWAPCHAIN_RESULT_ERROR_MISMATCH_INPUT_RESOURCES
@ XEFG_SWAPCHAIN_RESULT_ERROR_DEVICE_OUT_OF_MEMORY
@ XEFG_SWAPCHAIN_RESULT_ERROR_NOT_IMPLEMENTED
@ XEFG_SWAPCHAIN_RESULT_WARNING_TOO_FEW_FRAMES
@ XEFG_SWAPCHAIN_RESULT_ERROR_HRESULT_FAILURE
@ XEFG_SWAPCHAIN_RESULT_ERROR_DXGI_INVALID_CALL
@ XEFG_SWAPCHAIN_RESULT_ERROR_INVALID_CONTEXT
@ XEFG_SWAPCHAIN_RESULT_ERROR_UNSUPPORTED