Monado OpenXR Runtime
oxr_session_frame_end.c File Reference

Holds session end frame functions. More...

#include "xrt/xrt_device.h"
#include "xrt/xrt_config_build.h"
#include "xrt/xrt_config_have.h"
#include "os/os_time.h"
#include "util/u_debug.h"
#include "util/u_misc.h"
#include "util/u_time.h"
#include "util/u_verify.h"
#include "math/m_api.h"
#include "math/m_mathinclude.h"
#include "math/m_space.h"
#include "oxr_objects.h"
#include "oxr_logger.h"
#include "oxr_two_call.h"
#include "oxr_handle.h"
#include "oxr_chain.h"
#include "oxr_api_verify.h"
#include "oxr_xret.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <inttypes.h>
Include dependency graph for oxr_session_frame_end.c:

Functions

static double ns_to_ms (int64_t ns)
 
static double ts_ms (struct oxr_session *sess)
 
static XrResult is_rect_neg (const XrRect2Di *imageRect)
 
static XrResult is_rect_out_of_bounds (const XrRect2Di *imageRect, struct oxr_swapchain *sc)
 
static enum xrt_blend_mode convert_blend_mode (XrEnvironmentBlendMode blend_mode)
 
static enum xrt_layer_composition_flags convert_layer_flags (XrSwapchainUsageFlags xr_flags)
 
static enum xrt_compare_op_fb convert_compare_op (XrCompareOpFB xr_compare_op)
 
static enum xrt_layer_eye_visibility convert_eye_visibility (XrSwapchainUsageFlags xr_visibility)
 
static XRT_MAYBE_UNUSED void fill_in_xr_color (const struct XrColor4f *src, struct xrt_colour_rgba_f32 *dest)
 
static void fill_in_color_scale_bias (struct oxr_session *sess, const XrCompositionLayerBaseHeader *layer, struct xrt_layer_data *xlayer_data)
 
static void fill_in_y_flip (struct oxr_session *sess, const XrCompositionLayerBaseHeader *layer, struct xrt_layer_data *xlayer_data)
 
static void fill_in_sub_image (const struct oxr_swapchain *sc, const XrSwapchainSubImage *oxr_sub, struct xrt_sub_image *xsub)
 
static void fill_in_blend_factors (struct oxr_session *sess, const XrCompositionLayerBaseHeader *layer, struct xrt_layer_data *data)
 
static void fill_in_layer_settings (struct oxr_session *sess, const XrCompositionLayerBaseHeader *layer, struct xrt_layer_data *xlayer_data)
 
static void fill_in_depth_test (struct oxr_session *sess, const XrCompositionLayerBaseHeader *layer, struct xrt_layer_data *data)
 
static void fill_in_passthrough (struct oxr_session *sess, const XrCompositionLayerBaseHeader *layer, struct xrt_layer_data *data)
 
static XrResult verify_blend_factors (struct oxr_logger *log, struct oxr_session *sess, uint32_t layer_index, const XrCompositionLayerBaseHeader *layer)
 
static XrResult verify_space (struct oxr_logger *log, uint32_t layer_index, XrSpace space)
 
static XrResult verify_quad_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, XrCompositionLayerQuad *quad, struct xrt_device *head, uint64_t timestamp)
 
static XrResult verify_depth_layer (struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, uint32_t i, const XrCompositionLayerDepthInfoKHR *depth)
 
static XrResult verify_projection_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, XrCompositionLayerProjection *proj, struct xrt_device *head, uint64_t timestamp)
 
static XrResult verify_cube_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, const XrCompositionLayerCubeKHR *cube, struct xrt_device *head, uint64_t timestamp)
 
static XrResult verify_cylinder_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, const XrCompositionLayerCylinderKHR *cylinder, struct xrt_device *head, uint64_t timestamp)
 
static XrResult verify_equirect1_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, const XrCompositionLayerEquirectKHR *equirect, struct xrt_device *head, uint64_t timestamp)
 
static XrResult verify_equirect2_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, const XrCompositionLayerEquirect2KHR *equirect, struct xrt_device *head, uint64_t timestamp)
 
static XrResult verify_passthrough_layer (struct xrt_compositor *xc, struct oxr_logger *log, uint32_t layer_index, const XrCompositionLayerPassthroughFB *passthrough, struct xrt_device *head, uint64_t timestamp)
 
static bool handle_space (struct oxr_logger *log, struct oxr_session *sess, struct oxr_space *spc, const struct xrt_pose *pose_ptr, const struct xrt_pose *inv_offset, uint64_t timestamp, struct xrt_pose *out_pose)
 Turn the poses supplied with a composition layer into the poses the compositor wants. More...
 
static XrResult submit_quad_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, XrCompositionLayerQuad *quad, struct xrt_device *head, struct xrt_pose *inv_offset, uint64_t oxr_timestamp, uint64_t xrt_timestamp)
 
static XrResult submit_projection_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, XrCompositionLayerProjection *proj, struct xrt_device *head, struct xrt_pose *inv_offset, uint64_t oxr_timestamp, uint64_t xrt_timestamp)
 
static XrResult submit_cube_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, const XrCompositionLayerCubeKHR *cube, struct xrt_device *head, struct xrt_pose *inv_offset, uint64_t oxr_timestamp, uint64_t xrt_timestamp)
 
static XrResult submit_cylinder_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, const XrCompositionLayerCylinderKHR *cylinder, struct xrt_device *head, struct xrt_pose *inv_offset, uint64_t oxr_timestamp, uint64_t xrt_timestamp)
 
static XrResult submit_equirect1_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, const XrCompositionLayerEquirectKHR *equirect, struct xrt_device *head, struct xrt_pose *inv_offset, uint64_t oxr_timestamp, uint64_t xrt_timestamp)
 
static void do_synchronize_state_change (struct oxr_logger *log, struct oxr_session *sess)
 
static XrResult submit_equirect2_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, const XrCompositionLayerEquirect2KHR *equirect, struct xrt_device *head, struct xrt_pose *inv_offset, uint64_t oxr_timestamp, uint64_t xrt_timestamp)
 
static XrResult submit_passthrough_layer (struct oxr_session *sess, struct xrt_compositor *xc, struct oxr_logger *log, const XrCompositionLayerPassthroughFB *passthrough, struct xrt_device *head, struct xrt_pose *inv_offset, uint64_t oxr_timestamp, uint64_t xrt_timestamp)
 
XrResult oxr_session_frame_end (struct oxr_logger *log, struct oxr_session *sess, const XrFrameEndInfo *frameEndInfo)
 

Detailed Description

Function Documentation

◆ handle_space()

static bool handle_space ( struct oxr_logger log,
struct oxr_session sess,
struct oxr_space spc,
const struct xrt_pose pose_ptr,
const struct xrt_pose inv_offset,
uint64_t  timestamp,
struct xrt_pose out_pose 
)
static

Turn the poses supplied with a composition layer into the poses the compositor wants.

Parameters
loglogger
sesssession
spcspace that pose_ptr is supplied in
pose_ptrpose supplied with layer
inv_offsetinverse of the tracking origin offset
timestamptimestamp for pose
[out]out_poseResulting view-space pose
Returns
true if successfully transformed into a view space pose

◆ verify_projection_layer()

static XrResult verify_projection_layer ( struct oxr_session sess,
struct xrt_compositor xc,
struct oxr_logger log,
uint32_t  layer_index,
XrCompositionLayerProjection *  proj,
struct xrt_device head,
uint64_t  timestamp 
)
static
Todo:
More validation?