C Specification

The xrEraseSpacesMETA function is defined as:

// Provided by XR_META_spatial_entity_persistence
XrResult xrEraseSpacesMETA(
    XrSession                                   session,
    const XrSpacesEraseInfoMETA*                info,
    XrAsyncRequestIdFB*                         requestId);

Parameters

Parameter Descriptions
  • session is a handle to an XrSession.

  • info contains the input struct XrSpacesEraseInfoMETA for the erase operation.

  • requestId is a pointer to an XrAsyncRequestIdFB value and is an output parameter. The variable it points to is populated with the ID of this asynchronous request.

Description

The xrEraseSpacesMETA function erases space(s) from storage. The scope of the erase operation is same-user, same-device, same-app. After a successful erase operation, the XrSpace remains valid in the current session until the application destroys the space handle or its parent, the session handle. That is, this does not destroy spaces from tracking, but if erase is successful, the spaces must be ephemeral again (undiscoverable across sessions).

This is an asynchronous operation. Completion results are conveyed in the event XrEventDataSpacesEraseResultMETA.

The runtime must return XR_ERROR_HANDLE_INVALID from xrEraseSpacesMETA if any of the XrSpacesEraseInfoMETA::spaces are XR_NULL_HANDLE or otherwise invalid (e.g. not a Meta Spatial Entity XrSpace). Note that it is valid for a Meta Spatial Entity space that has not previously been saved to be included in an erase operation; that portion of the operation is a no-op.

At least one of XrSpacesEraseInfoMETA::uuids or XrSpacesEraseInfoMETA::spaces must be populated. The runtime must return XR_ERROR_VALIDATION_FAILURE from xrEraseSpacesMETA if either of the following are true:

The lengths of the arrays must equal the corresponding counts (e.g. spaceCount must equal the length of the spaces array).

When initiated unsuccessfully (i.e. the immediate return value of the xrEraseSpacesMETA call is an error), the erase operation terminates without erasing any Spatial Entities, and no erase result event is queued.

When initiated successfully (i.e. the immediate return value of the xrEraseSpacesMETA call is not an error), the full erase operation is asynchronous. The runtime must queue an XrEventDataSpacesEraseResultMETA event when the erase operation completes, either successfully, qualified success (warning), or with an error. See the XrEventDataSpacesEraseResultMETA for which XrResult enumerants may be returned in the event.

Note that if the XrEventDataSpacesEraseResultMETA::result is an error, it is possible that any subset of the Spatial Entity Spaces were erased.

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

  • XR_SESSION_LOSS_PENDING

  • XR_SESSION_NOT_FOCUSED

On failure, this command returns
  • XR_ERROR_FUNCTION_UNSUPPORTED

  • XR_ERROR_VALIDATION_FAILURE

  • XR_ERROR_RUNTIME_FAILURE

  • XR_ERROR_HANDLE_INVALID

  • XR_ERROR_INSTANCE_LOST

  • XR_ERROR_SESSION_LOST

  • XR_ERROR_SPACE_RATE_LIMITED_META

  • XR_ERROR_SPACE_COMPONENT_NOT_ENABLED_FB

  • XR_ERROR_SESSION_NOT_RUNNING

  • XR_ERROR_INITIALIZATION_FAILED

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 2014-2025 The Khronos Group Inc.