Monado OpenXR Runtime
oxr_swapchain.c File Reference

Holds swapchain related functions. More...

#include "util/u_debug.h"
#include "util/u_misc.h"
#include "oxr_chain.h"
#include "oxr_objects.h"
#include "oxr_logger.h"
#include "oxr_handle.h"
#include "oxr_swapchain_common.h"
#include "oxr_xret.h"
Include dependency graph for oxr_swapchain.c:

Functions

static enum xrt_swapchain_create_flags convert_create_flags (XrSwapchainCreateFlags xr_flags)
 
static enum xrt_swapchain_usage_bits convert_usage_bits (XrSwapchainUsageFlags xr_usage)
 
static XrResult acquire_image (struct oxr_logger *log, struct oxr_swapchain *sc, const XrSwapchainImageAcquireInfo *acquireInfo, uint32_t *out_index)
 
static XrResult implicit_wait_image (struct oxr_logger *log, struct oxr_swapchain *sc, const XrSwapchainImageWaitInfo *waitInfo)
 
static XrResult implicit_release_image (struct oxr_logger *log, struct oxr_swapchain *sc, const XrSwapchainImageReleaseInfo *releaseInfo)
 
static XrResult destroy (struct oxr_logger *log, struct oxr_swapchain *sc)
 
static XrResult destroy_handle (struct oxr_logger *log, struct oxr_handle_base *hb)
 
XrResult oxr_swapchain_common_acquire (struct oxr_logger *log, struct oxr_swapchain *sc, uint32_t *out_index)
 The shared code of the acquire call used by all graphics APIs. More...
 
XrResult oxr_swapchain_common_wait (struct oxr_logger *log, struct oxr_swapchain *sc, XrDuration timeout)
 The shared code of the wait call used by all graphics APIs. More...
 
XrResult oxr_swapchain_common_release (struct oxr_logger *log, struct oxr_swapchain *sc)
 The shared code of the release call used by all graphics APIs. More...
 
XrResult oxr_swapchain_common_create (struct oxr_logger *log, struct oxr_session *sess, const XrSwapchainCreateInfo *createInfo, struct oxr_swapchain **out_swapchain)
 Shared create function for swapchains, called by graphics API specific implementations list below. More...
 

Detailed Description

Holds swapchain related functions.

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

Function Documentation

◆ oxr_swapchain_common_acquire()

XrResult oxr_swapchain_common_acquire ( struct oxr_logger log,
struct oxr_swapchain sc,
uint32_t *  out_index 
)

The shared code of the acquire call used by all graphics APIs.

Parameters
logLogger set with the current OpenXR function call context.
scSwapchain.
[out]out_indexReturn of the acquired index.

References xrt_swapchain::image_count, oxr_error(), and oxr_swapchain::swapchain.

◆ oxr_swapchain_common_create()

XrResult oxr_swapchain_common_create ( struct oxr_logger log,
struct oxr_session sess,
const XrSwapchainCreateInfo *  createInfo,
struct oxr_swapchain **  out_swapchain 
)

Shared create function for swapchains, called by graphics API specific implementations list below.

Does most init, but not xrt_swapchain allocation and other API specific things.

Parameters
logLogger set with the current OpenXR function call context.
sessOpenXR session
createInfoCreation info.
[out]out_swapchainReturn of the allocated swapchain.

References XRT_SUCCESS.

◆ oxr_swapchain_common_release()

XrResult oxr_swapchain_common_release ( struct oxr_logger log,
struct oxr_swapchain sc 
)

The shared code of the release call used by all graphics APIs.

Parameters
logLogger set with the current OpenXR function call context.
scSwapchain.

References OXR_CHECK_XRET, oxr_error(), oxr_swapchain::sess, oxr_swapchain::swapchain, and xrt_swapchain::xrt_swapchain_release_image().

◆ oxr_swapchain_common_wait()

XrResult oxr_swapchain_common_wait ( struct oxr_logger log,
struct oxr_swapchain sc,
XrDuration  timeout 
)

The shared code of the wait call used by all graphics APIs.

Parameters
logLogger set with the current OpenXR function call context.
scSwapchain.
timeoutReturn of the acquired index.