Monado OpenXR Runtime

Helper functions for oxr_swapchain functions. More...

#include "oxr_objects.h"
Include dependency graph for oxr_swapchain_common.h:

Go to the source code of this file.

Macros

#define CHECK_OXR_RET(THING)
 

Functions

static XrResult oxr_swapchain_verify_wait_state (struct oxr_logger *log, struct oxr_swapchain *sc)
 
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

Helper functions for oxr_swapchain functions.

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

Macro Definition Documentation

◆ CHECK_OXR_RET

#define CHECK_OXR_RET (   THING)
Value:
do { \
XrResult check_ret = (THING); \
if (check_ret != XR_SUCCESS) { \
return check_ret; \
} \
} while (false)

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.