C Specification

The xrCreateInstance function is defined as:

XrResult xrCreateInstance(
    const XrInstanceCreateInfo*                 createInfo,
    XrInstance*                                 instance);

Parameters

Parameter Descriptions
  • createInfo points to an instance of XrInstanceCreateInfo controlling creation of the instance.

  • instance points to an XrInstance handle in which the resulting instance is returned.

Description

xrCreateInstance creates the XrInstance, then enables and initializes global API layers and extensions requested by the application. If an extension is provided by an API layer, both the API layer and extension must be specified at xrCreateInstance time. If a specified API layer cannot be found, no XrInstance will be created and the function will return XR_ERROR_API_LAYER_NOT_PRESENT. Likewise, if a specified extension cannot be found the call will return XR_ERROR_EXTENSION_NOT_PRESENT and no XrInstance will be created. Additionally, some runtimes may limit the number of concurrent instances that may be in use. If the application attempts to create more instances than a runtime can simultaneously support, xrCreateInstance will return XR_ERROR_LIMIT_REACHED.

If the XrInstanceCreateInfo struct contains a platform-specific extension for a platform other than the target platform, XR_ERROR_INITIALIZATION_FAILED will be returned. The same is true if a mandatory platform-specific extension is defined for the target platform but no matching extension struct is provided in XrInstanceCreateInfo.

Valid Usage (Implicit)
Return Codes
On success, this command returns
  • XR_SUCCESS

On failure, this command returns
  • XR_ERROR_OUT_OF_MEMORY

  • XR_ERROR_LIMIT_REACHED

  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_INITIALIZATION_FAILED

  • XR_ERROR_RUNTIME_VERSION_INCOMPATIBLE

  • XR_ERROR_API_LAYER_NOT_PRESENT

  • XR_ERROR_EXTENSION_NOT_PRESENT

  • XR_ERROR_DRIVER_INCOMPATIBLE

  • 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.