Monado OpenXR Runtime
comp_swapchain Struct Reference

A swapchain that is almost a one to one mapping to a OpenXR swapchain. More...

#include <util/comp_swapchain.h>

Inheritance diagram for comp_swapchain:
Collaboration diagram for comp_swapchain:

Data Fields

struct xrt_swapchain_native base
 
struct vk_bundlevk
 
struct comp_swapchain_sharedcscs
 
struct vk_image_collection vkic
 
struct comp_swapchain_image images [XRT_MAX_SWAPCHAIN_IMAGES]
 
struct u_index_fifo fifo
 This fifo is used to always give out the oldest image to acquire image, this should probably be made even smarter. More...
 
comp_swapchain_destroy_func_t real_destroy
 Virtual real destroy function. More...
 
- Data Fields inherited from xrt_swapchain_native
struct xrt_swapchain base
 Base. More...
 
xrt_limited_unique_id_t limited_unique_id
 Unique id for the swapchain, only unique for the current process, is not synchronized between service and any apps via the IPC layer. More...
 
struct xrt_image_native images [XRT_MAX_SWAPCHAIN_IMAGES]
 
- Data Fields inherited from xrt_swapchain
struct xrt_reference reference
 Reference helper. More...
 
uint32_t image_count
 Number of images. More...
 
void(* destroy )(struct xrt_swapchain *xsc)
 dec_image_use must have been called as often as inc_image_use. More...
 
xrt_result_t(* acquire_image )(struct xrt_swapchain *xsc, uint32_t *out_index)
 Obtain the index of the next image to use, without blocking on being able to write to it. More...
 
xrt_result_t(* inc_image_use )(struct xrt_swapchain *xsc, uint32_t index)
 Increments the use counter of a swapchain image. More...
 
xrt_result_t(* dec_image_use )(struct xrt_swapchain *xsc, uint32_t index)
 Decrements the use counter of a swapchain image. More...
 
xrt_result_t(* wait_image )(struct xrt_swapchain *xsc, int64_t timeout_ns, uint32_t index)
 Wait until image index is available for exclusive use, or until timeout_ns expires. More...
 
xrt_result_t(* barrier_image )(struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
 Do any barrier transitions to and from the application. More...
 
xrt_result_t(* release_image )(struct xrt_swapchain *xsc, uint32_t index)
 See xrReleaseSwapchainImage, state tracker needs to track index. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from xrt_swapchain
static xrt_result_t xrt_swapchain_acquire_image (struct xrt_swapchain *xsc, uint32_t *out_index)
 Obtain the index of the next image to use, without blocking on being able to write to it. More...
 
static xrt_result_t xrt_swapchain_inc_image_use (struct xrt_swapchain *xsc, uint32_t index)
 Increments the use counter of a swapchain image. More...
 
static xrt_result_t xrt_swapchain_dec_image_use (struct xrt_swapchain *xsc, uint32_t index)
 Decrements the use counter of a swapchain image. More...
 
static xrt_result_t xrt_swapchain_wait_image (struct xrt_swapchain *xsc, int64_t timeout_ns, uint32_t index)
 Wait until image index is available for exclusive use, or until timeout_ns expires. More...
 
static xrt_result_t xrt_swapchain_barrier_image (struct xrt_swapchain *xsc, enum xrt_barrier_direction direction, uint32_t index)
 Do any barrier transitions to and from the application. More...
 
static xrt_result_t xrt_swapchain_release_image (struct xrt_swapchain *xsc, uint32_t index)
 See xrReleaseSwapchainImage, state tracker needs to track index. More...
 

Detailed Description

A swapchain that is almost a one to one mapping to a OpenXR swapchain.

Not used by the window backend that uses the comp_target to render to.

The vk_bundle is owned by the compositor, its the state trackers job to make sure that compositor lives for as long as the swapchain does and that all swapchains are destroyed before the compositor is destroyed.

See also
comp_compositor

Field Documentation

◆ fifo

struct u_index_fifo comp_swapchain::fifo

This fifo is used to always give out the oldest image to acquire image, this should probably be made even smarter.

◆ real_destroy

comp_swapchain_destroy_func_t comp_swapchain::real_destroy

Virtual real destroy function.


The documentation for this struct was generated from the following file: