C Specification
typedef enum XrResult {
XR_SUCCESS = 0,
XR_TIMEOUT_EXPIRED = 1,
XR_SESSION_LOSS_PENDING = 3,
XR_EVENT_UNAVAILABLE = 4,
XR_SPACE_BOUNDS_UNAVAILABLE = 7,
XR_SESSION_NOT_FOCUSED = 8,
XR_FRAME_DISCARDED = 9,
XR_ERROR_VALIDATION_FAILURE = -1,
XR_ERROR_RUNTIME_FAILURE = -2,
XR_ERROR_OUT_OF_MEMORY = -3,
XR_ERROR_API_VERSION_UNSUPPORTED = -4,
XR_ERROR_INITIALIZATION_FAILED = -6,
XR_ERROR_FUNCTION_UNSUPPORTED = -7,
XR_ERROR_FEATURE_UNSUPPORTED = -8,
XR_ERROR_EXTENSION_NOT_PRESENT = -9,
XR_ERROR_LIMIT_REACHED = -10,
XR_ERROR_SIZE_INSUFFICIENT = -11,
XR_ERROR_HANDLE_INVALID = -12,
XR_ERROR_INSTANCE_LOST = -13,
XR_ERROR_SESSION_RUNNING = -14,
XR_ERROR_SESSION_NOT_RUNNING = -16,
XR_ERROR_SESSION_LOST = -17,
XR_ERROR_SYSTEM_INVALID = -18,
XR_ERROR_PATH_INVALID = -19,
XR_ERROR_PATH_COUNT_EXCEEDED = -20,
XR_ERROR_PATH_FORMAT_INVALID = -21,
XR_ERROR_PATH_UNSUPPORTED = -22,
XR_ERROR_LAYER_INVALID = -23,
XR_ERROR_LAYER_LIMIT_EXCEEDED = -24,
XR_ERROR_SWAPCHAIN_RECT_INVALID = -25,
XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED = -26,
XR_ERROR_ACTION_TYPE_MISMATCH = -27,
XR_ERROR_SESSION_NOT_READY = -28,
XR_ERROR_SESSION_NOT_STOPPING = -29,
XR_ERROR_TIME_INVALID = -30,
XR_ERROR_REFERENCE_SPACE_UNSUPPORTED = -31,
XR_ERROR_FILE_ACCESS_ERROR = -32,
XR_ERROR_FILE_CONTENTS_INVALID = -33,
XR_ERROR_FORM_FACTOR_UNSUPPORTED = -34,
XR_ERROR_FORM_FACTOR_UNAVAILABLE = -35,
XR_ERROR_API_LAYER_NOT_PRESENT = -36,
XR_ERROR_CALL_ORDER_INVALID = -37,
XR_ERROR_GRAPHICS_DEVICE_INVALID = -38,
XR_ERROR_POSE_INVALID = -39,
XR_ERROR_INDEX_OUT_OF_RANGE = -40,
XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED = -41,
XR_ERROR_ENVIRONMENT_BLEND_MODE_UNSUPPORTED = -42,
XR_ERROR_NAME_DUPLICATED = -44,
XR_ERROR_NAME_INVALID = -45,
XR_ERROR_ACTIONSET_NOT_ATTACHED = -46,
XR_ERROR_ACTIONSETS_ALREADY_ATTACHED = -47,
XR_ERROR_LOCALIZED_NAME_DUPLICATED = -48,
XR_ERROR_LOCALIZED_NAME_INVALID = -49,
XR_ERROR_GRAPHICS_REQUIREMENTS_CALL_MISSING = -50,
XR_ERROR_RUNTIME_UNAVAILABLE = -51,
// Provided by XR_KHR_android_thread_settings
XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR = -1000003000,
// Provided by XR_KHR_android_thread_settings
XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR = -1000003001,
// Provided by XR_MSFT_spatial_anchor
XR_ERROR_CREATE_SPATIAL_ANCHOR_FAILED_MSFT = -1000039001,
// Provided by XR_MSFT_secondary_view_configuration
XR_ERROR_SECONDARY_VIEW_CONFIGURATION_TYPE_NOT_ENABLED_MSFT = -1000053000,
// Provided by XR_MSFT_controller_model
XR_ERROR_CONTROLLER_MODEL_KEY_INVALID_MSFT = -1000055000,
// Provided by XR_MSFT_composition_layer_reprojection
XR_ERROR_REPROJECTION_MODE_UNSUPPORTED_MSFT = -1000066000,
// Provided by XR_MSFT_scene_understanding
XR_ERROR_COMPUTE_NEW_SCENE_NOT_COMPLETED_MSFT = -1000097000,
// Provided by XR_MSFT_scene_understanding
XR_ERROR_SCENE_COMPONENT_ID_INVALID_MSFT = -1000097001,
// Provided by XR_MSFT_scene_understanding
XR_ERROR_SCENE_COMPONENT_TYPE_MISMATCH_MSFT = -1000097002,
// Provided by XR_MSFT_scene_understanding
XR_ERROR_SCENE_MESH_BUFFER_ID_INVALID_MSFT = -1000097003,
// Provided by XR_MSFT_scene_understanding
XR_ERROR_SCENE_COMPUTE_FEATURE_INCOMPATIBLE_MSFT = -1000097004,
// Provided by XR_MSFT_scene_understanding
XR_ERROR_SCENE_COMPUTE_CONSISTENCY_MISMATCH_MSFT = -1000097005,
// Provided by XR_FB_display_refresh_rate
XR_ERROR_DISPLAY_REFRESH_RATE_UNSUPPORTED_FB = -1000101000,
// Provided by XR_FB_color_space
XR_ERROR_COLOR_SPACE_UNSUPPORTED_FB = -1000108000,
// Provided by XR_FB_spatial_entity
XR_ERROR_SPACE_COMPONENT_NOT_SUPPORTED_FB = -1000113000,
// Provided by XR_FB_spatial_entity
XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FB = -1000113001,
// Provided by XR_FB_spatial_entity
XR_ERROR_SPACE_COMPONENT_STATUS_PENDING_FB = -1000113002,
// Provided by XR_FB_spatial_entity
XR_ERROR_SPACE_COMPONENT_STATUS_ALREADY_SET_FB = -1000113003,
// Provided by XR_FB_passthrough
XR_ERROR_UNEXPECTED_STATE_PASSTHROUGH_FB = -1000118000,
// Provided by XR_FB_passthrough
XR_ERROR_FEATURE_ALREADY_CREATED_PASSTHROUGH_FB = -1000118001,
// Provided by XR_FB_passthrough
XR_ERROR_FEATURE_REQUIRED_PASSTHROUGH_FB = -1000118002,
// Provided by XR_FB_passthrough
XR_ERROR_NOT_PERMITTED_PASSTHROUGH_FB = -1000118003,
// Provided by XR_FB_passthrough
XR_ERROR_INSUFFICIENT_RESOURCES_PASSTHROUGH_FB = -1000118004,
// Provided by XR_FB_passthrough
XR_ERROR_UNKNOWN_PASSTHROUGH_FB = -1000118050,
// Provided by XR_FB_render_model
XR_ERROR_RENDER_MODEL_KEY_INVALID_FB = -1000119000,
// Provided by XR_FB_render_model
XR_RENDER_MODEL_UNAVAILABLE_FB = 1000119020,
// Provided by XR_VARJO_marker_tracking
XR_ERROR_MARKER_NOT_TRACKED_VARJO = -1000124000,
// Provided by XR_VARJO_marker_tracking
XR_ERROR_MARKER_ID_INVALID_VARJO = -1000124001,
// Provided by XR_ML_marker_understanding
XR_ERROR_MARKER_DETECTOR_PERMISSION_DENIED_ML = -1000138000,
// Provided by XR_ML_marker_understanding
XR_ERROR_MARKER_DETECTOR_LOCATE_FAILED_ML = -1000138001,
// Provided by XR_ML_marker_understanding
XR_ERROR_MARKER_DETECTOR_INVALID_DATA_QUERY_ML = -1000138002,
// Provided by XR_ML_marker_understanding
XR_ERROR_MARKER_DETECTOR_INVALID_CREATE_INFO_ML = -1000138003,
// Provided by XR_ML_marker_understanding
XR_ERROR_MARKER_INVALID_ML = -1000138004,
// Provided by XR_ML_localization_map
XR_ERROR_LOCALIZATION_MAP_INCOMPATIBLE_ML = -1000139000,
// Provided by XR_ML_localization_map
XR_ERROR_LOCALIZATION_MAP_UNAVAILABLE_ML = -1000139001,
// Provided by XR_ML_localization_map
XR_ERROR_LOCALIZATION_MAP_FAIL_ML = -1000139002,
// Provided by XR_ML_localization_map
XR_ERROR_LOCALIZATION_MAP_IMPORT_EXPORT_PERMISSION_DENIED_ML = -1000139003,
// Provided by XR_ML_localization_map
XR_ERROR_LOCALIZATION_MAP_PERMISSION_DENIED_ML = -1000139004,
// Provided by XR_ML_localization_map
XR_ERROR_LOCALIZATION_MAP_ALREADY_EXISTS_ML = -1000139005,
// Provided by XR_ML_localization_map
XR_ERROR_LOCALIZATION_MAP_CANNOT_EXPORT_CLOUD_MAP_ML = -1000139006,
// Provided by XR_MSFT_spatial_anchor_persistence
XR_ERROR_SPATIAL_ANCHOR_NAME_NOT_FOUND_MSFT = -1000142001,
// Provided by XR_MSFT_spatial_anchor_persistence
XR_ERROR_SPATIAL_ANCHOR_NAME_INVALID_MSFT = -1000142002,
// Provided by XR_MSFT_scene_marker
XR_SCENE_MARKER_DATA_NOT_STRING_MSFT = 1000147000,
// Provided by XR_FB_spatial_entity_sharing
XR_ERROR_SPACE_MAPPING_INSUFFICIENT_FB = -1000169000,
// Provided by XR_FB_spatial_entity_sharing
XR_ERROR_SPACE_LOCALIZATION_FAILED_FB = -1000169001,
// Provided by XR_FB_spatial_entity_sharing
XR_ERROR_SPACE_NETWORK_TIMEOUT_FB = -1000169002,
// Provided by XR_FB_spatial_entity_sharing
XR_ERROR_SPACE_NETWORK_REQUEST_FAILED_FB = -1000169003,
// Provided by XR_FB_spatial_entity_sharing
XR_ERROR_SPACE_CLOUD_STORAGE_DISABLED_FB = -1000169004,
// Provided by XR_META_passthrough_color_lut
XR_ERROR_PASSTHROUGH_COLOR_LUT_BUFFER_SIZE_MISMATCH_META = -1000266000,
// Provided by XR_QCOM_tracking_optimization_settings
XR_ERROR_HINT_ALREADY_SET_QCOM = -1000306000,
// Provided by XR_HTC_anchor
XR_ERROR_NOT_AN_ANCHOR_HTC = -1000319000,
// Provided by XR_EXT_plane_detection
XR_ERROR_SPACE_NOT_LOCATABLE_EXT = -1000429000,
// Provided by XR_EXT_plane_detection
XR_ERROR_PLANE_DETECTION_PERMISSION_DENIED_EXT = -1000429001,
XR_RESULT_MAX_ENUM = 0x7FFFFFFF
} XrResult;
Description
All return codes in the API are reported via XrResult return values.
Some common suffixes shared across many of the return codes are defined below:
-
_INVALID
: The specified handle, atom or value is formatted incorrectly, or the specified handle was never created or has been destroyed. -
_UNSUPPORTED
: The specified handle, atom, enumerant or value is formatted correctly but cannot be used for the lifetime of this function’s parent handle. -
_UNAVAILABLE
: The specified handle, atom, enumerant or value is supported by this function’s parent handle but not at this moment.
Success Codes
Enum | Description |
---|---|
|
Function successfully completed. |
|
The specified timeout time occurred before the operation could complete. |
|
The session will be lost soon. |
|
No event was available. |
|
The space’s bounds are not known at the moment. |
|
The session is not in the focused state. |
|
A frame has been discarded from composition. |
|
The model is unavailable. (Added by the |
|
Marker does not encode a string. (Added by the |
Error Codes
Enum | Description |
---|---|
|
The function usage was invalid in some way. |
|
The runtime failed to handle the function in an unexpected way that is not covered by another error result. |
|
A memory allocation has failed. |
|
The runtime does not support the requested API version. |
|
Initialization of object could not be completed. |
|
The requested function was not found or is otherwise unsupported. |
|
The requested feature is not supported. |
|
A requested extension is not supported. |
|
The runtime supports no more of the requested resource. |
|
The supplied size was smaller than required. |
|
A supplied object handle was invalid. |
|
The XrInstance was lost or could not be found. It will need to be destroyed and optionally recreated. |
|
The session is already running. |
|
The session is not yet running. |
|
The XrSession was lost. It will need to be destroyed and optionally recreated. |
|
The provided XrSystemId was invalid. |
|
The provided XrPath was not valid. |
|
The maximum number of supported semantic paths has been reached. |
|
The semantic path character format is invalid. |
|
The semantic path is unsupported. |
|
The layer was NULL or otherwise invalid. |
|
The number of specified layers is greater than the supported number. |
|
The image rect was negatively sized or otherwise invalid. |
|
The image format is not supported by the runtime or platform. |
|
The API used to retrieve an action’s state does not match the action’s type. |
|
The session is not in the ready state. |
|
The session is not in the stopping state. |
|
The provided XrTime was zero, negative, or out of range. |
|
The specified reference space is not supported by the runtime or system. |
|
The file could not be accessed. |
|
The file’s contents were invalid. |
|
The specified form factor is not supported by the current runtime or platform. |
|
The specified form factor is supported, but the device is currently not available, e.g. not plugged in or powered off. |
|
A requested API layer is not present or could not be loaded. |
|
The call was made without having made a previously required call. |
|
The given graphics device is not in a valid state. The graphics device could be lost or initialized without meeting graphics requirements. |
|
The supplied pose was invalid with respect to the requirements. |
|
The supplied index was outside the range of valid indices. |
|
The specified view configuration type is not supported by the runtime or platform. |
|
The specified environment blend mode is not supported by the runtime or platform. |
|
The name provided was a duplicate of an already-existing resource. |
|
The name provided was invalid. |
|
A referenced action set is not attached to the session. |
|
The session already has attached action sets. |
|
The localized name provided was a duplicate of an already-existing resource. |
|
The localized name provided was invalid. |
|
The |
|
The loader was unable to find or load a runtime. |
|
xrSetAndroidApplicationThreadKHR failed as thread id is invalid. (Added by the |
|
xrSetAndroidApplicationThreadKHR failed setting the thread attributes/priority. (Added by the |
|
Spatial anchor could not be created at that location. (Added by the |
|
The secondary view configuration was not enabled when creating the session. (Added by the |
|
The controller model key is invalid. (Added by the |
|
The reprojection mode is not supported. (Added by the |
|
Compute new scene not completed. (Added by the |
|
Scene component id invalid. (Added by the |
|
Scene component type mismatch. (Added by the |
|
Scene mesh buffer id invalid. (Added by the |
|
Scene compute feature incompatible. (Added by the |
|
Scene compute consistency mismatch. (Added by the |
|
The display refresh rate is not supported by the platform. (Added by the |
|
The color space is not supported by the runtime. (Added by the |
|
The component type is not supported for this space. (Added by the |
|
The required component is not enabled for this space. (Added by the |
|
A request to set the component’s status is currently pending. (Added by the |
|
The component is already set to the requested value. (Added by the |
|
The object state is unexpected for the issued command. (Added by the |
|
Trying to create an MR feature when one was already created and only one instance is allowed. (Added by the |
|
Requested functionality requires a feature to be created first. (Added by the |
|
Requested functionality is not permitted - application is not allowed to perform the requested operation. (Added by the |
|
There weren’t sufficient resources available to perform an operation. (Added by the |
|
Unknown Passthrough error (no further details provided). (Added by the |
|
The model key is invalid. (Added by the |
|
Marker tracking is disabled or the specified marker is not currently tracked. (Added by the |
|
The specified marker ID is not valid. (Added by the |
|
The com.magicleap.permission.MARKER_TRACKING permission was denied. (Added by the |
|
The specified marker could not be located spatially. (Added by the |
|
The marker queried does not contain data of the requested type. (Added by the |
|
|
|
The marker id passed to the function was invalid. (Added by the |
|
The localization map being imported is not compatible with current OS or mode. (Added by the |
|
The localization map requested is not available. (Added by the |
|
The map localization service failed to fulfill the request, retry later. (Added by the |
|
The com.magicleap.permission.SPACE_IMPORT_EXPORT permission was denied. (Added by the |
|
The com.magicleap.permission.SPACE_MANAGER permission was denied. (Added by the |
|
The map being imported already exists in the system. (Added by the |
|
The map localization service cannot export cloud based maps. (Added by the |
|
A spatial anchor was not found associated with the spatial anchor name provided (Added by the |
|
The spatial anchor name provided was not valid (Added by the |
|
Anchor import from cloud or export from device failed. (Added by the |
|
Anchors were downloaded from the cloud but failed to be imported/aligned on the device. (Added by the |
|
Timeout occurred while waiting for network request to complete. (Added by the |
|
The network request failed. (Added by the |
|
Cloud storage is required for this operation but is currently disabled. (Added by the |
|
The provided data buffer did not match the required size. (Added by the |
|
Tracking optimization hint is already set for the domain. (Added by the |
|
The provided space is valid but not an anchor. (Added by the |
|
The space passed to the function was not locatable. (Added by the |
|
The permission for this resource was not granted. (Added by the |
See Also
Document Notes
For more information, see the OpenXR Specification
This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright 2014-2023 The Khronos Group Inc.
This work is licensed under a Creative Commons Attribution 4.0 International License.