C Specification

The xrWaitFrame function is defined as:

XrResult xrWaitFrame(
    XrSession                                   session,
    const XrFrameWaitInfo*                      frameWaitInfo,
    XrFrameState*                               frameState);

Parameters

Parameter Descriptions

Description

If a frame submitted to xrEndFrame is consumed by the compositor before its target display time, a subsequent call to xrWaitFrame must block the caller until the start of the next rendering interval after the frame’s target display time as determined by the runtime.

If a frame submitted to xrEndFrame misses its target display time, a subsequent call to xrWaitFrame must block the caller until that frame is consumed by the compositor, at which point it must return immediately.

If no frame has been submitted to xrEndFrame since any prior call to xrWaitFrame, a subsequent call to xrWaitFrame must block the caller until the start of the next rendering interval time as determined by the runtime.

The runtime may dynamically adjust the start time of the rendering interval relative to the display hardware’s refresh cycle to minimize graphics processor contention between the application and the compositor.

xrWaitFrame must be callable from any thread, including a different thread than xrBeginFrame/xrEndFrame are being called from.

Calling xrWaitFrame must be externally synchronized by the application, concurrent calls may result in undefined behavior.

The runtime must return XR_ERROR_SESSION_NOT_RUNNING if session is not in the XR_SESSION_STATE_RUNNING, XR_SESSION_STATE_VISIBLE or XR_SESSION_STATE_FOCUSED XrSessionState.

Valid Usage (Implicit)
  • session must be a valid XrSession handle

  • If frameWaitInfo is not NULL, frameWaitInfo must be a pointer to a valid XrFrameWaitInfo structure

  • frameState must be a pointer to an XrFrameState structure

Return Codes
On success, this command returns
  • XR_SUCCESS

  • XR_SESSION_LOSS_PENDING

On failure, this command returns
  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_SESSION_LOST

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_HANDLE_INVALID

  • XR_ERROR_SESSION_NOT_RUNNING

  • XR_ERROR_VALIDATION_FAILURE

See Also

Document Notes

For more information, see the OpenXR Specification at URL

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright (c) 2014-2019 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.