Monado OpenXR Runtime
comp_gl_client.c File Reference

OpenGL client side glue to compositor implementation. More...

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include "xrt/xrt_config_os.h"
#include "util/u_misc.h"
#include <xrt/xrt_config_have.h>
#include "ogl/ogl_helpers.h"
#include "client/comp_gl_client.h"
#include "util/u_logging.h"
#include "util/u_trace_marker.h"
Include dependency graph for comp_gl_client.c:

Functions

static struct xrt_swapchainto_native_swapchain (struct xrt_swapchain *xsc)
 
static struct xrt_compositorto_native_compositor (struct xrt_compositor *xc)
 
static int64_t gl_format_to_vk (int64_t format)
 
static int64_t vk_format_to_gl (int64_t format)
 
static xrt_graphics_sync_handle_t handle_fencing_or_finish (struct client_gl_compositor *c)
 Called with the right context made current. More...
 
static xrt_result_t client_gl_swapchain_acquire_image (struct xrt_swapchain *xsc, uint32_t *out_index)
 
static xrt_result_t client_gl_swapchain_wait_image (struct xrt_swapchain *xsc, int64_t timeout_ns, uint32_t index)
 
static xrt_result_t client_gl_swapchain_barrier_image (struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
 
static xrt_result_t client_gl_swapchain_release_image (struct xrt_swapchain *xsc, uint32_t index)
 
static xrt_result_t client_gl_compositor_begin_session (struct xrt_compositor *xc, const struct xrt_begin_session_info *info)
 
static xrt_result_t client_gl_compositor_end_session (struct xrt_compositor *xc)
 
static xrt_result_t client_gl_compositor_wait_frame (struct xrt_compositor *xc, int64_t *out_frame_id, int64_t *predicted_display_time, int64_t *predicted_display_period)
 
static xrt_result_t client_gl_compositor_begin_frame (struct xrt_compositor *xc, int64_t frame_id)
 
static xrt_result_t client_gl_compositor_discard_frame (struct xrt_compositor *xc, int64_t frame_id)
 
static xrt_result_t client_gl_compositor_layer_begin (struct xrt_compositor *xc, const struct xrt_layer_frame_data *data)
 
static xrt_result_t client_gl_compositor_layer_projection (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc[XRT_MAX_VIEWS], const struct xrt_layer_data *data)
 
static xrt_result_t client_gl_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)
 
static xrt_result_t client_gl_compositor_layer_quad (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 
static xrt_result_t client_gl_compositor_layer_cube (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 
static xrt_result_t client_gl_compositor_layer_cylinder (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 
static xrt_result_t client_gl_compositor_layer_equirect1 (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 
static xrt_result_t client_gl_compositor_layer_equirect2 (struct xrt_compositor *xc, struct xrt_device *xdev, struct xrt_swapchain *xsc, const struct xrt_layer_data *data)
 
static xrt_result_t client_gl_compositor_layer_passthrough (struct xrt_compositor *xc, struct xrt_device *xdev, const struct xrt_layer_data *data)
 
static xrt_result_t client_gl_compositor_layer_commit (struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle)
 
static xrt_result_t client_gl_compositor_get_swapchain_create_properties (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain_create_properties *xsccp)
 
static xrt_result_t client_gl_swapchain_create (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)
 
static xrt_result_t client_gl_compositor_passthrough_create (struct xrt_compositor *xc, const struct xrt_passthrough_create_info *info)
 
static xrt_result_t client_gl_compositor_passthrough_layer_create (struct xrt_compositor *xc, const struct xrt_passthrough_layer_create_info *info)
 
static xrt_result_t client_gl_compositor_passthrough_destroy (struct xrt_compositor *xc)
 
static void client_gl_compositor_destroy (struct xrt_compositor *xc)
 
void client_gl_compositor_close (struct client_gl_compositor *c)
 
bool client_gl_compositor_init (struct client_gl_compositor *c, struct xrt_compositor_native *xcn, client_gl_context_begin_locked_func_t context_begin_locked, client_gl_context_end_locked_func_t context_end_locked, client_gl_swapchain_create_func_t create_swapchain, client_gl_insert_fence_func_t insert_fence)
 

Detailed Description

OpenGL client side glue to compositor implementation.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Function Documentation

◆ handle_fencing_or_finish()

static xrt_graphics_sync_handle_t handle_fencing_or_finish ( struct client_gl_compositor c)
static

Called with the right context made current.

References client_gl_compositor::insert_fence, XRT_GRAPHICS_SYNC_HANDLE_INVALID, and XRT_SUCCESS.