115 int64_t *out_frame_id,
116 uint64_t *out_wake_time_ns,
117 uint64_t *out_predicted_gpu_time_ns,
118 uint64_t *out_predicted_display_time_ns,
119 uint64_t *out_predicted_display_period_ns);
134 int64_t *out_frame_id,
135 uint64_t *out_predicted_display_time,
136 uint64_t *out_predicted_display_period);
153 uint64_t display_time_ns,
266 uint32_t *out_index);
356static_assert(std::is_standard_layout<struct mock_compositor>::value);
357static_assert(std::is_standard_layout<struct mock_compositor_swapchain>::value);
xrt_blend_mode
Blend mode that the device supports, exact mirror of XrEnvironmentBlendMode.
Definition: xrt_defines.h:109
#define XRT_MAX_SWAPCHAIN_IMAGES
Max swapchain images, artificial limit.
Definition: xrt_limits.h:34
xrt_view_type
View type to be rendered to by the compositor.
Definition: xrt_compositor.h:862
enum xrt_result xrt_result_t
Result type used across Monado.
xrt_compositor_frame_point
Definition: xrt_compositor.h:868
struct xrt_compositor_native * mock_create_native_compositor()
Create a mock implementation of xrt_compositor_native.
Definition: mock_compositor.cpp:178
static struct mock_compositor * mock_compositor(xrt_compositor *xc)
Cast a generic xrt_compositor pointer (that you know externally is a mock_compositor) to a mock_compo...
Definition: mock_compositor.h:290
static struct mock_compositor_swapchain * mock_compositor_swapchain(xrt_swapchain *xsc)
Cast a generic xrt_swapchain pointer (that you know externally is a mock_compositor_swapchain) to a m...
Definition: mock_compositor.h:340
Mock implementation of xrt_swapchain_native.
Definition: mock_compositor.h:299
bool imported
Set if this swapchain was created by import_swapchain.
Definition: mock_compositor.h:306
uint32_t next_to_acquire
The image ID that will next be acquired.
Definition: mock_compositor.h:329
xrt_swapchain_create_info info
Populated by copying the create info passed to create_swapchain/import_swapchain.
Definition: mock_compositor.h:309
struct mock_compositor * mc
non-owning pointer to parent
Definition: mock_compositor.h:332
bool waited[XRT_MAX_SWAPCHAIN_IMAGES]
Modified by the default mock implementations of wait_image and release_image.
Definition: mock_compositor.h:321
xrt_graphics_buffer_handle_t handles[XRT_MAX_SWAPCHAIN_IMAGES]
Native handles for images.
Definition: mock_compositor.h:315
uint32_t id
A swapchain ID, assigned by create_swapchain/import_swapchain.
Definition: mock_compositor.h:303
bool acquired[XRT_MAX_SWAPCHAIN_IMAGES]
Modified by the default mock implementations of acquire_image and release_image.
Definition: mock_compositor.h:318
Mock implementation of a native compositor.
Definition: mock_compositor.h:28
xrt_result_t(* create_swapchain)(struct mock_compositor *mc, struct mock_compositor_swapchain *mcsc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)
Optional function pointer for mock compositor, called during xrt_comp_create_swapchain.
Definition: mock_compositor.h:60
xrt_result_t(* release_image)(struct mock_compositor *mc, struct mock_compositor_swapchain *mcsc, uint32_t index)
Optional function pointer, called during xrt_swapchain::release_image.
Definition: mock_compositor.h:279
xrt_result_t(* get_swapchain_create_properties)(struct mock_compositor *mc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_create_properties *xsccp)
Optional function pointer for mock compositor, called during xrt_comp_get_swapchain_create_properties...
Definition: mock_compositor.h:50
struct mock_compositor::@78 compositor_hooks
Optional function pointers you can populate to hook into the behavior of the mock compositor implemen...
xrt_result_t(* wait_image)(struct mock_compositor *mc, struct mock_compositor_swapchain *mcsc, uint64_t timeout_ns, uint32_t index)
Optional function pointer, called during xrt_swapchain::wait_image.
Definition: mock_compositor.h:271
struct mock_compositor::@79 swapchain_hooks
Optional function pointers you can populate to hook into the behavior of the mock swapchain implement...
void * userdata
Mock users can populate this pointer to use data from hooks.
Definition: mock_compositor.h:35
void(* destroy)(struct mock_compositor *mc)
Optional function pointer for mock compositor, called during xrt_comp_destroy (before actual destruct...
Definition: mock_compositor.h:241
xrt_result_t(* import_swapchain)(struct mock_compositor *mc, struct mock_compositor_swapchain *mcsc, const struct xrt_swapchain_create_info *info, struct xrt_image_native *native_images, uint32_t image_count, struct xrt_swapchain **out_xsc)
Optional function pointer for mock compositor, called during xrt_comp_import_swapchain.
Definition: mock_compositor.h:73
uint32_t next_id
ID for next swapchain.
Definition: mock_compositor.h:32
xrt_result_t(* acquire_image)(struct mock_compositor *mc, struct mock_compositor_swapchain *mcsc, uint32_t *out_index)
Optional function pointer, called during xrt_swapchain::acquire_image.
Definition: mock_compositor.h:264
Compositor fence used for synchronization.
Definition: xrt_compositor.h:731
Main compositor server interface.
Definition: xrt_compositor.h:2224
struct xrt_compositor base
Base.
Definition: xrt_compositor.h:2226
Compositor semaphore used for synchronization, needs to be as capable as a Vulkan pipeline semaphore.
Definition: xrt_compositor.h:788
Common compositor client interface/base.
Definition: xrt_compositor.h:988
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.
Definition: xrt_compositor.h:1237
xrt_result_t(* layer_commit)(struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle)
Commits all of the submitted layers.
Definition: xrt_compositor.h:1338
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.
Definition: xrt_compositor.h:1284
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...
Definition: xrt_compositor.h:1075
xrt_result_t(* discard_frame)(struct xrt_compositor *xc, int64_t frame_id)
Explicitly discard a frame.
Definition: xrt_compositor.h:1181
xrt_result_t(* begin_frame)(struct xrt_compositor *xc, int64_t frame_id)
See xrBeginFrame.
Definition: xrt_compositor.h:1163
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 outward...
Definition: xrt_compositor.h:1254
xrt_result_t(* predict_frame)(struct xrt_compositor *xc, int64_t *out_frame_id, int64_t *out_wake_time_ns, int64_t *out_predicted_gpu_time_ns, int64_t *out_predicted_display_time_ns, int64_t *out_predicted_display_period_ns)
This function and mark_frame function calls are a alternative to wait_frame.
Definition: xrt_compositor.h:1105
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.
Definition: xrt_compositor.h:1215
xrt_result_t(* mark_frame)(struct xrt_compositor *xc, int64_t frame_id, enum xrt_compositor_frame_point point, int64_t when_ns)
This function and predict_frame function calls are a alternative to wait_frame.
Definition: xrt_compositor.h:1124
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.
Definition: xrt_compositor.h:1299
xrt_result_t(* wait_frame)(struct xrt_compositor *xc, int64_t *out_frame_id, int64_t *out_predicted_display_time, int64_t *out_predicted_display_period)
See xrWaitFrame.
Definition: xrt_compositor.h:1148
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.
Definition: xrt_compositor.h:1033
xrt_result_t(* layer_begin)(struct xrt_compositor *xc, const struct xrt_layer_frame_data *data)
Begins layer submission.
Definition: xrt_compositor.h:1199
struct xrt_compositor_info info
Capabilities and recommended values information.
Definition: xrt_compositor.h:992
xrt_result_t(* begin_session)(struct xrt_compositor *xc, const struct xrt_begin_session_info *info)
See xrBeginSession.
Definition: xrt_compositor.h:1068
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.
Definition: xrt_compositor.h:1315
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.
Definition: xrt_compositor.h:1040
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.
Definition: xrt_compositor.h:1269
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.
Definition: xrt_compositor.h:1349
A single HMD or input device.
Definition: xrt_device.h:241
A single image of a swapchain based on native buffer handles.
Definition: xrt_compositor.h:2150
All the pure data values associated with a composition layer.
Definition: xrt_compositor.h:394
Swapchain creation info.
Definition: xrt_compositor.h:876
Struct used to negotiate properties of a swapchain that is created outside of the compositor.
Definition: xrt_compositor.h:918
Base class for a swapchain that exposes a native buffer handle to be imported into a client API.
Definition: xrt_compositor.h:2191
struct xrt_swapchain base
Base.
Definition: xrt_compositor.h:2193
Common swapchain interface/base.
Definition: xrt_compositor.h:536
Header declaring XRT graphics interfaces.
Common defines and enums for XRT.
int xrt_graphics_buffer_handle_t
The type underlying buffers shared between compositor clients and the main compositor.
Definition: xrt_handles.h:246
int xrt_graphics_sync_handle_t
The type underlying synchronization primitives (semaphores, etc) shared between compositor clients an...
Definition: xrt_handles.h:348