|
Monado OpenXR Runtime
|
Main compositor server interface. More...
#include <xrt/xrt_compositor.h>


Public Member Functions | |
| struct xrt_compositor_d3d11 * | xrt_gfx_d3d11_provider_create (struct xrt_compositor_native *xcn, ID3D11Device *device) |
| Create a D3D11 compositor client. | |
| struct xrt_compositor_d3d12 * | xrt_gfx_d3d12_provider_create (struct xrt_compositor_native *xcn, ID3D12Device *device, ID3D12CommandQueue *queue) |
| Create a D3D12 compositor client. | |
| xrt_result_t | xrt_gfx_provider_create_gl_egl (struct xrt_compositor_native *xcn, EGLDisplay display, EGLConfig config, EGLContext context, PFNEGLGETPROCADDRESSPROC get_gl_procaddr, bool renderdoc_enabled, struct xrt_compositor_gl **out_xcgl) |
| Create an OpenGL(ES) compositor client using EGL. | |
| struct xrt_compositor_vk * | xrt_gfx_vk_provider_create (struct xrt_compositor_native *xcn, VkInstance instance, PFN_vkGetInstanceProcAddr get_instance_proc_addr, VkPhysicalDevice physical_device, VkDevice device, bool external_fence_fd_enabled, bool external_semaphore_fd_enabled, bool timeline_semaphore_enabled, bool image_format_list_enabled, bool debug_utils_enabled, bool renderdoc_enabled, uint32_t queue_family_index, uint32_t queue_index) |
| Create a Vulkan compositor client. | |
| struct xrt_compositor_gl * | xrt_gfx_provider_create_gl_win32 (struct xrt_compositor_native *xcn, void *hDC, void *hGLRC) |
| Create an OpenGL compositor client using Win32. | |
| struct xrt_compositor_gl * | xrt_gfx_provider_create_gl_xlib (struct xrt_compositor_native *xcn, Display *xDisplay, uint32_t visualid, GLXFBConfig glxFBConfig, GLXDrawable glxDrawable, GLXContext glxContext) |
| Create an OpenGL compositor client using xlib. | |
Static Public Member Functions | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_native_create_swapchain (struct xrt_compositor_native *xcn, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_native **out_xscn) |
| Create a native swapchain with a set of images. | |
| static XRT_NONNULL_ALL void | xrt_comp_native_destroy (struct xrt_compositor_native **xcn_ptr) |
| Teardown the compositor. | |
Static Public Member Functions inherited from xrt_compositor | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_create_passthrough (struct xrt_compositor *xc, const struct xrt_passthrough_create_info *info) |
| Create a passthrough. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_create_passthrough_layer (struct xrt_compositor *xc, const struct xrt_passthrough_layer_create_info *info) |
| Create a passthrough layer. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_destroy_passthrough (struct xrt_compositor *xc) |
| Destroy a passthrough. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_get_reference_bounds_rect (struct xrt_compositor *xc, enum xrt_reference_space_type reference_space_type, struct xrt_vec2 *bounds) |
| Get the extents of the reference space's bounds rectangle. | |
| static XRT_NONNULL_ALL void | xrt_comp_destroy (struct xrt_compositor **xc_ptr) |
| Teardown the compositor. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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 of the semaphore which is owned by the xrt_compositor_semaphore struct. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_begin_session (struct xrt_compositor *xc, const struct xrt_begin_session_info *info) |
| See xrBeginSession. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_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. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_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. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_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. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_begin_frame (struct xrt_compositor *xc, int64_t frame_id) |
| See xrBeginFrame. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_discard_frame (struct xrt_compositor *xc, int64_t frame_id) |
| Explicitly discard a frame. | |
| static XRT_NONNULL_ALL xrt_result_t | xrt_comp_layer_begin (struct xrt_compositor *xc, const struct xrt_layer_frame_data *data) |
| Begins layer submission. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_ALL 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. | |
| static XRT_NONNULL_FIRST xrt_result_t | xrt_comp_layer_commit (struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle) |
| Commits all of the submitted layers. | |
| static XRT_NONNULL_ALL 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. | |
Data Fields | |
| struct xrt_compositor | base |
| Base. | |
Data Fields inherited from xrt_compositor | |
| struct xrt_compositor_info | info |
| Capabilities and recommended values information. | |
| 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. | |
| xrt_result_t(* | create_passthrough )(struct xrt_compositor *xc, const struct xrt_passthrough_create_info *info) |
| Create a passthrough. | |
| xrt_result_t(* | create_passthrough_layer )(struct xrt_compositor *xc, const struct xrt_passthrough_layer_create_info *info) |
| Create a passthrough layer. | |
| xrt_result_t(* | destroy_passthrough )(struct xrt_compositor *xc) |
| Destroy a passthrough. | |
| 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. | |
| xrt_result_t(* | get_reference_bounds_rect )(struct xrt_compositor *xc, enum xrt_reference_space_type reference_space_type, struct xrt_vec2 *bounds) |
| Get the extents of the reference space's bounds rectangle. | |
| void(* | destroy )(struct xrt_compositor *xc) |
| Teardown the compositor. | |
| 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. | |
| 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. | |
| 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. | |
| 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 of the semaphore which is owned by the xrt_compositor_semaphore struct. | |
| xrt_result_t(* | begin_session )(struct xrt_compositor *xc, const struct xrt_begin_session_info *info) |
| See xrBeginSession. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| xrt_result_t(* | begin_frame )(struct xrt_compositor *xc, int64_t frame_id) |
| See xrBeginFrame. | |
| xrt_result_t(* | discard_frame )(struct xrt_compositor *xc, int64_t frame_id) |
| Explicitly discard a frame. | |
| xrt_result_t(* | layer_begin )(struct xrt_compositor *xc, const struct xrt_layer_frame_data *data) |
| Begins layer submission. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| xrt_result_t(* | layer_commit )(struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle) |
| Commits all of the submitted layers. | |
| 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. | |
| xrt_result_t(* | get_display_refresh_rate )(struct xrt_compositor *xc, float *out_display_refresh_rate_hz) |
| Get the current display refresh rate. | |
| 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. | |
| 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. | |
Main compositor server interface.
| struct xrt_compositor xrt_compositor_native::base |
Base.
Referenced by client_d3d11_compositor::client_d3d11_compositor_create(), client_d3d12_compositor::client_d3d12_compositor_create(), client_gl_compositor::client_gl_compositor_init(), client_vk_compositor::client_vk_compositor_create(), client_vk_swapchain_create(), comp_base::comp_base_init(), xrt_system_compositor::comp_main_create_system_compositor(), xrt::compositor::client::importFromDxgiHandles(), mock_create_native_compositor(), multi_compositor_create(), multi_compositor_layer_commit(), null_compositor_create_system(), sdl_compositor_init(), to_native_compositor(), update_session_state_locked(), xrt_comp_native_create_swapchain(), and xrt_comp_native_destroy().