Monado OpenXR Runtime
comp_vk_client.c File Reference

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

#include "util/u_misc.h"
#include "util/u_handles.h"
#include "util/u_trace_marker.h"
#include "util/u_debug.h"
#include "comp_vk_client.h"
Include dependency graph for comp_vk_client.c:

Macros

#define BREAK_OPENXR_SPEC_IN_DESTROY_SWAPCHAIN   (true)
 We are not allowed to touch the queue in xrDestroySwapchain. More...
 

Functions

static struct xrt_swapchainto_native_swapchain (struct xrt_swapchain *xsc)
 Helper to get the native swapchain. More...
 
static struct xrt_compositorto_native_compositor (struct xrt_compositor *xc)
 Helper to get the native swapchain. More...
 
static xrt_result_t submit_image_barrier (struct client_vk_swapchain *sc, VkCommandBuffer cmd_buffer)
 
static bool submit_handle (struct client_vk_compositor *c, xrt_graphics_sync_handle_t sync_handle, xrt_result_t *out_xret)
 
static bool submit_semaphore (struct client_vk_compositor *c, xrt_result_t *out_xret)
 
static bool submit_fence (struct client_vk_compositor *c, xrt_result_t *out_xret)
 
static bool submit_fallback (struct client_vk_compositor *c, xrt_result_t *out_xret)
 
static void client_vk_swapchain_destroy (struct xrt_swapchain *xsc)
 
static xrt_result_t client_vk_swapchain_acquire_image (struct xrt_swapchain *xsc, uint32_t *out_index)
 
static xrt_result_t client_vk_swapchain_wait_image (struct xrt_swapchain *xsc, uint64_t timeout_ns, uint32_t index)
 
static xrt_result_t client_vk_swapchain_barrier_image (struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
 
static xrt_result_t client_vk_swapchain_release_image (struct xrt_swapchain *xsc, uint32_t index)
 
static xrt_result_t client_vk_compositor_passthrough_create (struct xrt_compositor *xc, const struct xrt_passthrough_create_info *info)
 
static xrt_result_t client_vk_compositor_passthrough_layer_create (struct xrt_compositor *xc, const struct xrt_passthrough_layer_create_info *info)
 
static xrt_result_t client_vk_compositor_passthrough_destroy (struct xrt_compositor *xc)
 
static void client_vk_compositor_destroy (struct xrt_compositor *xc)
 
static xrt_result_t client_vk_compositor_begin_session (struct xrt_compositor *xc, const struct xrt_begin_session_info *info)
 
static xrt_result_t client_vk_compositor_end_session (struct xrt_compositor *xc)
 
static xrt_result_t client_vk_compositor_wait_frame (struct xrt_compositor *xc, int64_t *out_frame_id, uint64_t *predicted_display_time, uint64_t *predicted_display_period)
 
static xrt_result_t client_vk_compositor_begin_frame (struct xrt_compositor *xc, int64_t frame_id)
 
static xrt_result_t client_vk_compositor_discard_frame (struct xrt_compositor *xc, int64_t frame_id)
 
static xrt_result_t client_vk_compositor_layer_begin (struct xrt_compositor *xc, const struct xrt_layer_frame_data *data)
 
static xrt_result_t client_vk_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_vk_compositor_layer_stereo_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_vk_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_vk_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_vk_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_vk_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_vk_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_vk_compositor_layer_passthrough (struct xrt_compositor *xc, struct xrt_device *xdev, const struct xrt_layer_data *data)
 
static xrt_result_t client_vk_compositor_layer_commit (struct xrt_compositor *xc, xrt_graphics_sync_handle_t sync_handle)
 
static xrt_result_t client_vk_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_vk_swapchain_create (struct xrt_compositor *xc, const struct xrt_swapchain_create_info *info, struct xrt_swapchain **out_xsc)
 
struct client_vk_compositorclient_vk_compositor_create (struct xrt_compositor_native *xcn, VkInstance instance, PFN_vkGetInstanceProcAddr getProc, VkPhysicalDevice physicalDevice, VkDevice device, bool external_fence_fd_enabled, bool external_semaphore_fd_enabled, bool timeline_semaphore_enabled, bool debug_utils_enabled, bool renderdoc_enabled, uint32_t queueFamilyIndex, uint32_t queueIndex)
 

Detailed Description

Vulkan client side glue to compositor implementation.

Author
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m
Lubosz Sarnecki lubos.nosp@m.z.sa.nosp@m.rneck.nosp@m.i@co.nosp@m.llabo.nosp@m.ra.c.nosp@m.om

Macro Definition Documentation

◆ BREAK_OPENXR_SPEC_IN_DESTROY_SWAPCHAIN

#define BREAK_OPENXR_SPEC_IN_DESTROY_SWAPCHAIN   (true)

We are not allowed to touch the queue in xrDestroySwapchain.

Function Documentation

◆ client_vk_swapchain_create()

static xrt_result_t client_vk_swapchain_create ( struct xrt_compositor xc,
const struct xrt_swapchain_create_info info,
struct xrt_swapchain **  out_xsc 
)
static
Todo:
less conservative pipeline stage masks based on usage

◆ to_native_compositor()

static struct xrt_compositor* to_native_compositor ( struct xrt_compositor xc)
inlinestatic

Helper to get the native swapchain.

References xrt_compositor_native::base, and client_vk_compositor::xcn.

◆ to_native_swapchain()

static struct xrt_swapchain* to_native_swapchain ( struct xrt_swapchain xsc)
inlinestatic

Helper to get the native swapchain.

References xrt_swapchain_native::base, and client_vk_swapchain::xscn.