Monado OpenXR Runtime
xrt_compositor Interface Reference

Common compositor client interface/base. More...

#include <xrt/xrt_compositor.h>

Inheritance diagram for xrt_compositor:
Collaboration diagram for xrt_compositor:

Public Member Functions

static xrt_result_t xrt_comp_get_swapchain_create_properties (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_create_properties *xsccp)
 For a given xrt_swapchain_create_info struct returns a filled out xrt_swapchain_create_properties. More...
 
static xrt_result_t xrt_comp_create_passthrough (struct xrt_compositor *xc, const struct xrt_passthrough_create_info *info)
 Create a passthrough. More...
 
static xrt_result_t xrt_comp_create_passthrough_layer (struct xrt_compositor *xc, const struct xrt_passthrough_layer_create_info *info)
 Create a passthrough layer. More...
 
static xrt_result_t xrt_comp_destroy_passthrough (struct xrt_compositor *xc)
 Destroy a passthrough. More...
 
static xrt_result_t xrt_comp_get_display_refresh_rate (struct xrt_compositor *xc, float *out_display_refresh_rate_hz)
 Get the current display refresh rate. More...
 
static xrt_result_t xrt_comp_request_display_refresh_rate (struct xrt_compositor *xc, float display_refresh_rate_hz)
 Request system to change the display refresh rate to the requested value. More...
 
static xrt_result_t xrt_comp_set_performance_level (struct xrt_compositor *xc, enum xrt_perf_domain domain, enum xrt_perf_set_level level)
 Set CPU/GPU performance level. More...
 
static void xrt_comp_destroy (struct xrt_compositor **xc_ptr)
 Teardown the compositor. More...
 
Swapchain and sync creation and import methods
static xrt_result_t xrt_comp_create_swapchain (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)
 Create a swapchain with a set of images. More...
 
static xrt_result_t xrt_comp_import_swapchain (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_swapchain **out_xsc)
 Create a swapchain from a set of native images. More...
 
static xrt_result_t xrt_comp_import_fence (struct xrt_compositor *xc, xrt_graphics_sync_handle_t handle, struct xrt_compositor_fence **out_xcf)
 Create a compositor fence from a native sync handle. More...
 
static xrt_result_t xrt_comp_create_semaphore (struct xrt_compositor *xc, xrt_graphics_sync_handle_t *out_handle, struct xrt_compositor_semaphore **out_xcsem)
 Create a compositor semaphore, also returns a native handle. More...
 
Session methods
static xrt_result_t xrt_comp_begin_session (struct xrt_compositor *xc, const struct xrt_begin_session_info *info)
 See xrBeginSession. More...
 
static xrt_result_t xrt_comp_end_session (struct xrt_compositor *xc)
 See xrEndSession, unlike the OpenXR one the state tracker is responsible to call discard frame before calling this function. More...
 
Frame-related methods

Related to the OpenXR xr*Frame functions

static xrt_result_t xrt_comp_predict_frame (struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_wake_time_ns, uint64_t *out_predicted_gpu_time_ns, uint64_t *out_predicted_display_time_ns, uint64_t *out_predicted_display_period_ns)
 This function and mark_frame function calls are a alternative to wait_frame. More...
 
static xrt_result_t xrt_comp_mark_frame (struct xrt_compositor *xc, int64_t frame_id, enum xrt_compositor_frame_point point, uint64_t when_ns)
 This function and predict_frame function calls are a alternative to wait_frame. More...
 
static xrt_result_t xrt_comp_wait_frame (struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_predicted_display_time, uint64_t *out_predicted_display_period)
 See xrWaitFrame. More...
 
static xrt_result_t xrt_comp_begin_frame (struct xrt_compositor *xc, int64_t frame_id)
 See xrBeginFrame. More...
 
static xrt_result_t xrt_comp_discard_frame (struct xrt_compositor *xc, int64_t frame_id)
 Explicitly discard a frame. More...
 
Layer submission methods

Equivalent to xrEndFrame, but split across multiple calls.

static xrt_result_t xrt_comp_layer_begin (struct xrt_compositor *xc, const struct xrt_layer_frame_data *data)
 Begins layer submission. More...
 
static xrt_result_t xrt_comp_layer_projection (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc[XRT_MAX_VIEWS], const struct xrt_layer_data *data)
 Adds a projection layer for submissions. More...
 
static xrt_result_t xrt_comp_layer_projection_depth (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc[XRT_MAX_VIEWS], struct xrt_swapchain *d_xsc[XRT_MAX_VIEWS], const struct xrt_layer_data *data)
 Adds a projection layer for submission, has depth information. More...
 
static xrt_result_t xrt_comp_layer_quad (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a quad layer for submission, the center of the quad is specified by the pose and extends outwards from it. More...
 
static xrt_result_t xrt_comp_layer_cube (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a cube layer for submission. More...
 
static xrt_result_t xrt_comp_layer_cylinder (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a cylinder layer for submission. More...
 
static xrt_result_t xrt_comp_layer_equirect1 (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a equirect1 layer for submission. More...
 
static xrt_result_t xrt_comp_layer_equirect2 (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a equirect2 layer for submission. More...
 
static xrt_result_t xrt_comp_layer_passthrough (struct xrt_compositor *xc, struct xrt_device *xdev, const struct xrt_layer_data *data)
 Adds a passthrough layer for submission. More...
 
static xrt_result_t xrt_comp_layer_commit (struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle)
 Commits all of the submitted layers. More...
 
static xrt_result_t xrt_comp_layer_commit_with_semaphore (struct xrt_compositor *xc, struct xrt_compositor_semaphore *xcsem, uint64_t value)
 Commits all of the submitted layers, with a semaphore. More...
 

Data Fields

struct xrt_compositor_info info
 Capabilities and recommended values information. More...
 
xrt_result_t(* get_swapchain_create_properties )(struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_create_properties *xsccp)
 For a given xrt_swapchain_create_info struct returns a filled out xrt_swapchain_create_properties. More...
 
xrt_result_t(* create_passthrough )(struct xrt_compositor *xc, const struct xrt_passthrough_create_info *info)
 Create a passthrough. More...
 
xrt_result_t(* create_passthrough_layer )(struct xrt_compositor *xc, const struct xrt_passthrough_layer_create_info *info)
 Create a passthrough layer. More...
 
xrt_result_t(* destroy_passthrough )(struct xrt_compositor *xc)
 Destroy a passthrough. More...
 
xrt_result_t(* set_performance_level )(struct xrt_compositor *xc, enum xrt_perf_domain domain, enum xrt_perf_set_level level)
 Set CPU/GPU performance level. More...
 
void(* destroy )(struct xrt_compositor *xc)
 Teardown the compositor. More...
 
Function pointers for swapchain and sync creation and import
xrt_result_t(* create_swapchain )(struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)
 Create a swapchain with a set of images. More...
 
xrt_result_t(* import_swapchain )(struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_swapchain **out_xsc)
 Create a swapchain from a set of native images. More...
 
xrt_result_t(* import_fence )(struct xrt_compositor *xc, xrt_graphics_sync_handle_t handle, struct xrt_compositor_fence **out_xcf)
 Create a compositor fence from a native sync handle. More...
 
xrt_result_t(* create_semaphore )(struct xrt_compositor *xc, xrt_graphics_sync_handle_t *out_handle, struct xrt_compositor_semaphore **out_xcsem)
 Create a compositor semaphore, also returns a native handle. More...
 
Function pointers for session functions
xrt_result_t(* begin_session )(struct xrt_compositor *xc, const struct xrt_begin_session_info *info)
 See xrBeginSession. More...
 
xrt_result_t(* end_session )(struct xrt_compositor *xc)
 See xrEndSession, unlike the OpenXR one the state tracker is responsible to call discard frame before calling this function. More...
 
Function pointers for frame functions
xrt_result_t(* predict_frame )(struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_wake_time_ns, uint64_t *out_predicted_gpu_time_ns, uint64_t *out_predicted_display_time_ns, uint64_t *out_predicted_display_period_ns)
 This function and mark_frame function calls are a alternative to wait_frame. More...
 
xrt_result_t(* mark_frame )(struct xrt_compositor *xc, int64_t frame_id, enum xrt_compositor_frame_point point, uint64_t when_ns)
 This function and predict_frame function calls are a alternative to wait_frame. More...
 
xrt_result_t(* wait_frame )(struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_predicted_display_time, uint64_t *out_predicted_display_period)
 See xrWaitFrame. More...
 
xrt_result_t(* begin_frame )(struct xrt_compositor *xc, int64_t frame_id)
 See xrBeginFrame. More...
 
xrt_result_t(* discard_frame )(struct xrt_compositor *xc, int64_t frame_id)
 Explicitly discard a frame. More...
 
Function pointers for layer submission
xrt_result_t(* layer_begin )(struct xrt_compositor *xc, const struct xrt_layer_frame_data *data)
 Begins layer submission. More...
 
xrt_result_t(* layer_projection )(struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc[XRT_MAX_VIEWS], const struct xrt_layer_data *data)
 Adds a projection layer for submissions. More...
 
xrt_result_t(* layer_projection_depth )(struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc[XRT_MAX_VIEWS], struct xrt_swapchain *d_xsc[XRT_MAX_VIEWS], const struct xrt_layer_data *data)
 Adds a projection layer for submission, has depth information. More...
 
xrt_result_t(* layer_quad )(struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a quad layer for submission, the center of the quad is specified by the pose and extends outwards from it. More...
 
xrt_result_t(* layer_cube )(struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a cube layer for submission. More...
 
xrt_result_t(* layer_cylinder )(struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a cylinder layer for submission. More...
 
xrt_result_t(* layer_equirect1 )(struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a equirect1 layer for submission. More...
 
xrt_result_t(* layer_equirect2 )(struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 Adds a equirect2 layer for submission. More...
 
xrt_result_t(* layer_passthrough )(struct xrt_compositor *xc, struct xrt_device *xdev, const struct xrt_layer_data *data)
 Adds a passthrough layer for submission. More...
 
xrt_result_t(* layer_commit )(struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle)
 Commits all of the submitted layers. More...
 
xrt_result_t(* layer_commit_with_semaphore )(struct xrt_compositor *xc, struct xrt_compositor_semaphore *xcsem, uint64_t value)
 Commits all of the submitted layers, with a semaphore. More...
 
Function pointers for XR_FB_display_refresh_rate.
xrt_result_t(* get_display_refresh_rate )(struct xrt_compositor *xc, float *out_display_refresh_rate_hz)
 Get the current display refresh rate. More...
 
xrt_result_t(* request_display_refresh_rate )(struct xrt_compositor *xc, float display_refresh_rate_hz)
 Request system to change the display refresh rate to the requested value. More...
 
Function pointers for extensions
xrt_result_t(* set_thread_hint )(struct xrt_compositor *xc, enum xrt_thread_hint hint, uint32_t thread_id)
 Set thread attributes according to thread type. More...
 

Detailed Description

Common compositor client interface/base.

A compositor is very much analogous to a XrSession but without any of the input functionality, and does have the same life time as a XrSession.

Field Documentation

◆ begin_frame

xrt_result_t(* xrt_compositor::begin_frame) (struct xrt_compositor *xc, int64_t frame_id)

See xrBeginFrame.

Must have made a call to either predict_frame or wait_frame before calling this function. After this function is called you must call layer_commit.

Parameters
[in]xcThe compositor
[in]frame_idFrame id

Referenced by xrt_comp_begin_frame().

◆ begin_session

xrt_result_t(* xrt_compositor::begin_session) (struct xrt_compositor *xc, const struct xrt_begin_session_info *info)

See xrBeginSession.

Referenced by null_compositor_create_system(), and xrt_comp_begin_session().

◆ create_passthrough

xrt_result_t(* xrt_compositor::create_passthrough) (struct xrt_compositor *xc, const struct xrt_passthrough_create_info *info)

Create a passthrough.

Referenced by xrt_comp_create_passthrough().

◆ create_passthrough_layer

xrt_result_t(* xrt_compositor::create_passthrough_layer) (struct xrt_compositor *xc, const struct xrt_passthrough_layer_create_info *info)

Create a passthrough layer.

Referenced by xrt_comp_create_passthrough_layer().

◆ create_semaphore

xrt_result_t(* xrt_compositor::create_semaphore) (struct xrt_compositor *xc, xrt_graphics_sync_handle_t *out_handle, struct xrt_compositor_semaphore **out_xcsem)

Create a compositor semaphore, also returns a native handle.

Referenced by xrt_comp_create_semaphore().

◆ create_swapchain

xrt_result_t(* xrt_compositor::create_swapchain) (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)

Create a swapchain with a set of images.

The pointer pointed to by out_xsc has to either be NULL or a valid xrt_swapchain pointer. If there is a valid xrt_swapchain pointed by the pointed pointer it will have it reference decremented.

Referenced by xrt_comp_create_swapchain().

◆ destroy

void(* xrt_compositor::destroy) (struct xrt_compositor *xc)

Teardown the compositor.

The state tracker must have made sure that no frames or sessions are currently pending.

See also
xrt_compositor::discard_frame or xrt_compositor::end_frame for a pending frame
xrt_compositor::end_session for an open session.

Referenced by xrt_comp_destroy(), and xrt_compositor_native::xrt_comp_native_destroy().

◆ destroy_passthrough

xrt_result_t(* xrt_compositor::destroy_passthrough) (struct xrt_compositor *xc)

Destroy a passthrough.

Referenced by xrt_comp_destroy_passthrough().

◆ discard_frame

xrt_result_t(* xrt_compositor::discard_frame) (struct xrt_compositor *xc, int64_t frame_id)

Explicitly discard a frame.

This isn't in the OpenXR API but is explicit in the XRT interfaces.

Two calls to xrBeginFrame without intervening xrEndFrame will cause the state tracker to call:

// first xrBeginFrame
xrt_comp_begin_frame(xc, frame_id);
// second xrBeginFrame
xrt_comp_discard_frame(xc, frame_id);
xrt_comp_begin_frame(xc, frame_id);
static xrt_result_t xrt_comp_begin_frame(struct xrt_compositor *xc, int64_t frame_id)
See xrBeginFrame.
Definition: xrt_compositor.h:1639
static xrt_result_t xrt_comp_discard_frame(struct xrt_compositor *xc, int64_t frame_id)
Explicitly discard a frame.
Definition: xrt_compositor.h:1652

Referenced by xrt_comp_discard_frame().

◆ end_session

xrt_result_t(* xrt_compositor::end_session) (struct xrt_compositor *xc)

See xrEndSession, unlike the OpenXR one the state tracker is responsible to call discard frame before calling this function.

See discard_frame.

Referenced by xrt_comp_end_session().

◆ get_display_refresh_rate

xrt_result_t(* xrt_compositor::get_display_refresh_rate) (struct xrt_compositor *xc, float *out_display_refresh_rate_hz)

Get the current display refresh rate.

Parameters
xcSelf pointer
out_display_refresh_rate_hzCurrent display refresh rate in Hertz.

Referenced by xrt_comp_get_display_refresh_rate().

◆ get_swapchain_create_properties

◆ import_fence

xrt_result_t(* xrt_compositor::import_fence) (struct xrt_compositor *xc, xrt_graphics_sync_handle_t handle, struct xrt_compositor_fence **out_xcf)

Create a compositor fence from a native sync handle.

Referenced by xrt_comp_import_fence().

◆ import_swapchain

xrt_result_t(* xrt_compositor::import_swapchain) (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_swapchain **out_xsc)

Create a swapchain from a set of native images.

The pointer pointed to by out_xsc has to either be NULL or a valid xrt_swapchain pointer. If there is a valid xrt_swapchain pointed by the pointed pointer it will have it reference decremented.

Referenced by xrt_comp_import_swapchain().

◆ info

◆ layer_begin

xrt_result_t(* xrt_compositor::layer_begin) (struct xrt_compositor *xc, const struct xrt_layer_frame_data *data)

Begins layer submission.

This and the other layer_* calls are equivalent to xrEndFrame, except split over multiple calls. It's only after xrt_compositor::layer_commit that layers will be displayed. From the point of view of the swapchain, the image is used as soon as it's given in a call.

◆ layer_commit

xrt_result_t(* xrt_compositor::layer_commit) (struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle)

Commits all of the submitted layers.

Only after this call will the compositor actually use the layers.

Referenced by xrt_comp_layer_commit().

◆ layer_commit_with_semaphore

xrt_result_t(* xrt_compositor::layer_commit_with_semaphore) (struct xrt_compositor *xc, struct xrt_compositor_semaphore *xcsem, uint64_t value)

Commits all of the submitted layers, with a semaphore.

Only after this call will the compositor actually use the layers.

Parameters
xcSelf pointer
frame_idThe frame id this commit is for.
xcsemSemaphore that will be signalled when the app GPU work has completed.
valueSemaphore value upone completion of GPU work.

Referenced by xrt_comp_layer_commit_with_semaphore().

◆ layer_cube

xrt_result_t(* xrt_compositor::layer_cube) (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)

Adds a cube layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

◆ layer_cylinder

xrt_result_t(* xrt_compositor::layer_cylinder) (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)

Adds a cylinder layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

◆ layer_equirect1

xrt_result_t(* xrt_compositor::layer_equirect1) (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)

Adds a equirect1 layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

◆ layer_equirect2

xrt_result_t(* xrt_compositor::layer_equirect2) (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)

Adds a equirect2 layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

◆ layer_passthrough

xrt_result_t(* xrt_compositor::layer_passthrough) (struct xrt_compositor *xc, struct xrt_device *xdev, const struct xrt_layer_data *data)

Adds a passthrough layer for submission.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

◆ layer_projection

xrt_result_t(* xrt_compositor::layer_projection) (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc[XRT_MAX_VIEWS], const struct xrt_layer_data *data)

Adds a projection layer for submissions.

Note that e.g. the same swapchain object may be passed as both l_xsc and r_xsc - the parameters in data identify the subrect and array texture index to use for each of the views.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain object containing eye RGB data.
dataAll of the pure data bits (not pointers/handles), including what parts of the supplied swapchain objects to use for each view.

◆ layer_projection_depth

xrt_result_t(* xrt_compositor::layer_projection_depth) (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc[XRT_MAX_VIEWS], struct xrt_swapchain *d_xsc[XRT_MAX_VIEWS], const struct xrt_layer_data *data)

Adds a projection layer for submission, has depth information.

Note that e.g. the same swapchain object may be passed as both l_xsc and r_xsc - the parameters in data identify the subrect and array texture index to use for each of the views. This flexibility is required by the OpenXR API and is passed through to the compositor to preserve the maximum information

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
l_xscSwapchain object containing left eye RGB data.
r_xscSwapchain object containing right eye RGB data.
l_d_xscSwapchain object containing left eye depth data.
r_d_xscSwapchain object containing right eye depth data.
dataAll of the pure data bits (not pointers/handles), including what parts of the supplied swapchain objects to use for each view.

◆ layer_quad

xrt_result_t(* xrt_compositor::layer_quad) (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)

Adds a quad layer for submission, the center of the quad is specified by the pose and extends outwards from it.

Parameters
xcSelf pointer
xdevThe device the layer is relative to.
xscSwapchain.
dataAll of the pure data bits (not pointers/handles), including what part of the supplied swapchain object to use.

◆ mark_frame

xrt_result_t(* xrt_compositor::mark_frame) (struct xrt_compositor *xc, int64_t frame_id, enum xrt_compositor_frame_point point, uint64_t when_ns)

This function and predict_frame function calls are a alternative to wait_frame.

If point is XRT_COMPOSITOR_FRAME_POINT_WOKE it is to mark that the client woke up from waiting on a frame.

Parameters
[in]xcThe compositor
[in]frame_idFrame id
[in]pointWhat type of frame point to mark.
[in]when_nsWhen this point happened.

Referenced by xrt_comp_mark_frame().

◆ predict_frame

xrt_result_t(* xrt_compositor::predict_frame) (struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_wake_time_ns, uint64_t *out_predicted_gpu_time_ns, uint64_t *out_predicted_display_time_ns, uint64_t *out_predicted_display_period_ns)

This function and mark_frame function calls are a alternative to wait_frame.

The only requirement on the compositor for the frame_id is that it is a positive number and larger then the last returned frame_id.

After a call to predict_frame, the state tracker is not allowed to call this function until after a call to mark_frame (with point XRT_COMPOSITOR_FRAME_POINT_WOKE), followed by either begin_frame or discard_frame.

Parameters
[in]xcThe compositor
[out]out_frame_idFrame id
[out]out_wake_time_nsWhen we want the client to be awoken to begin rendering.
[out]out_predicted_gpu_time_nsWhen we expect the client to finish the GPU work. If not computed/available, set to 0.
[out]out_predicted_display_time_nsWhen the pixels turns into photons.
[out]out_predicted_display_period_nsThe period for the frames.

Referenced by xrt_comp_predict_frame().

◆ request_display_refresh_rate

xrt_result_t(* xrt_compositor::request_display_refresh_rate) (struct xrt_compositor *xc, float display_refresh_rate_hz)

Request system to change the display refresh rate to the requested value.

Parameters
xcSelf pointer
display_refresh_rate_hzRequested display refresh rate in Hertz.

Referenced by xrt_comp_request_display_refresh_rate().

◆ set_performance_level

xrt_result_t(* xrt_compositor::set_performance_level) (struct xrt_compositor *xc, enum xrt_perf_domain domain, enum xrt_perf_set_level level)

Set CPU/GPU performance level.

Referenced by xrt_comp_set_performance_level().

◆ set_thread_hint

xrt_result_t(* xrt_compositor::set_thread_hint) (struct xrt_compositor *xc, enum xrt_thread_hint hint, uint32_t thread_id)

Set thread attributes according to thread type.

Referenced by xrt_comp_set_thread_hint().

◆ wait_frame

xrt_result_t(* xrt_compositor::wait_frame) (struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *out_predicted_display_time, uint64_t *out_predicted_display_period)

See xrWaitFrame.

This function has the same semantics as calling predict_frame, sleeping, and then calling mark_frame with a point of XRT_COMPOSITOR_FRAME_POINT_WOKE.

The only requirement on the compositor for the frame_id is that it is a positive number and larger then the last returned frame_id.

After a call to wait_frame, the state tracker is not allowed to call this function until after a call to either begin_frame or discard_frame.

If the caller can do its own blocking, use the pair of functions xrt_compositor::predict_frame and xrt_compositor::mark_frame instead of this single blocking function.

Referenced by xrt_comp_wait_frame().


The documentation for this interface was generated from the following file: