docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class OpenXRNativeApi

    OpenXR native API.

    For more information, refer to OpenXR native API in the user manual.

    Inheritance
    object
    OpenXRNativeApi
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.OpenXR.NativeTypes
    Assembly: Unity.XR.OpenXR.dll
    Syntax
    public static class OpenXRNativeApi

    Methods

    xrCancelFutureEXT(ulong, in XrFutureCancelInfoEXT)

    Cancels the given future and signals that the async operation is not required. Provided by XR_EXT_future.

    Declaration
    public static extern XrResult xrCancelFutureEXT(ulong instance, in XrFutureCancelInfoEXT cancelInfo)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance for which the future in cancelInfo was returned.

    XrFutureCancelInfoEXT cancelInfo

    The cancel info.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • FutureInvalidEXT
    Remarks
    Warning

    You are responsible to synchronize this operation with any other threads you created that use this future. After the future has been cancelled, any functions using this future must return FutureInvalidEXT.

    xrCancelFutureEXT(in XrFutureCancelInfoEXT)

    Cancels the given future for the current instance and signals that the async operation is not required. Provided by XR_EXT_future.

    Declaration
    public static extern OpenXRResultStatus xrCancelFutureEXT(in XrFutureCancelInfoEXT cancelInfo)
    Parameters
    Type Name Description
    XrFutureCancelInfoEXT cancelInfo

    The cancel info.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • FutureInvalidEXT
    Remarks
    Warning

    You are responsible to synchronize this operation with any other threads you created that use this future.

    After the future has been cancelled, any functions using this future must return FutureInvalidEXT.

    xrCreateSpatialAnchorEXT(ulong, Vector3, Quaternion, out ulong, out ulong)

    Creates an anchor in your app space at the next frame's predicted display time, allowing you to track the given position and rotation within the given spatial context. Provided by XR_EXT_spatial_anchor.

    Declaration
    public static OpenXRResultStatus xrCreateSpatialAnchorEXT(ulong spatialContext, Vector3 position, Quaternion rotation, out ulong anchorEntityId, out ulong anchorEntity)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created using OpenXRNativeApi.xrCreateSpatialContextAsyncEXT.

    Vector3 position

    The position, in Unity coordinates relative to your XR Origin, at which to create the anchor.

    Quaternion rotation

    The rotation, in Unity coordinates relative to your XR Origin, to use for the anchor.

    ulong anchorEntityId

    The ID of the created anchor entity.

    ulong anchorEntity

    The spatial entity handle of the created anchor entity.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • PoseInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialAnchorEXT(ulong, in XrPosef, out ulong, out ulong)

    Creates an anchor in your app space at the next frame's predicted display time, allowing you to track the given position and rotation within the given spatial context. Provided by XR_EXT_spatial_anchor.

    Declaration
    public static extern OpenXRResultStatus xrCreateSpatialAnchorEXT(ulong spatialContext, in XrPosef pose, out ulong anchorEntityId, out ulong anchorEntity)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created using OpenXRNativeApi.xrCreateSpatialContextAsyncEXT.

    XrPosef pose

    The pose, in OpenXR coordinates, at which to create the anchor.

    ulong anchorEntityId

    The ID of the created anchor entity.

    ulong anchorEntity

    The spatial entity handle of the created anchor entity.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • PoseInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialAnchorEXT(ulong, in XrSpatialAnchorCreateInfoEXT, out ulong, out ulong)

    Creates an anchor, allowing you to track the given position and rotation within the given spatial context. Provided by XR_EXT_spatial_anchor.

    Declaration
    public static extern XrResult xrCreateSpatialAnchorEXT(ulong spatialContext, in XrSpatialAnchorCreateInfoEXT createInfo, out ulong anchorEntityId, out ulong anchorEntity)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created using OpenXRNativeApi.xrCreateSpatialContextAsyncEXT.

    XrSpatialAnchorCreateInfoEXT createInfo

    The creation info.

    ulong anchorEntityId

    The ID of the created anchor entity.

    ulong anchorEntity

    The spatial entity handle of the created anchor entity.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • PoseInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialContextAsyncEXT(ulong, in XrSpatialContextCreateInfoEXT, out ulong)

    Creates a spatial context scoped to the given session. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrCreateSpatialContextAsyncEXT(ulong session, in XrSpatialContextCreateInfoEXT createInfo, out ulong future)
    Parameters
    Type Name Description
    ulong session

    The session in which the spatial context will be active.

    XrSpatialContextCreateInfoEXT createInfo

    The information used to specify the spatial context parameters.

    ulong future

    The output future.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • SpatialComponentUnsupportedForCapabilityEXT
    • SpatialCapabilityUnsupportedEXT
    • SpatialCapabilityConfigurationInvalidEXT
    • PermissionInsufficient
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialContextAsyncEXT(in XrSpatialContextCreateInfoEXT, out ulong)

    Creates a spatial context scoped to the current session. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern OpenXRResultStatus xrCreateSpatialContextAsyncEXT(in XrSpatialContextCreateInfoEXT createInfo, out ulong future)
    Parameters
    Type Name Description
    XrSpatialContextCreateInfoEXT createInfo

    The information used to specify the spatial context parameters.

    ulong future

    The output future.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • SpatialComponentUnsupportedForCapabilityEXT
    • SpatialCapabilityUnsupportedEXT
    • SpatialCapabilityConfigurationInvalidEXT
    • PermissionInsufficient
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialContextCompleteEXT(ulong, ulong, out XrCreateSpatialContextCompletionEXT)

    Completes the asynchronous operation started by OpenXRNativeAPI.xrCreateSpatialContextAsyncEXT. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrCreateSpatialContextCompleteEXT(ulong session, ulong future, out XrCreateSpatialContextCompletionEXT completion)
    Parameters
    Type Name Description
    ulong session

    The XrSession previously passed to OpenXRNativeAPI.xrCreateSpatialContextAsyncEXT.

    ulong future

    The future received from OpenXRNativeAPI.xrCreateSpatialContextAsyncEXT.

    XrCreateSpatialContextCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    completion.spatialContext is only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    See Also
    xrCreateSpatialContextAsyncEXT(ulong, in XrSpatialContextCreateInfoEXT, out ulong)

    xrCreateSpatialContextCompleteEXT(ulong, out XrCreateSpatialContextCompletionEXT)

    Completes the asynchronous operation started by OpenXRNativeAPI.xrCreateSpatialContextAsyncEXT. Provided by XR_EXT_spatial_entity.

    Declaration
    public static OpenXRResultStatus xrCreateSpatialContextCompleteEXT(ulong future, out XrCreateSpatialContextCompletionEXT completion)
    Parameters
    Type Name Description
    ulong future

    The future received from OpenXRNativeAPI.xrCreateSpatialContextAsyncEXT.

    XrCreateSpatialContextCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    completion.spatialContext is only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    See Also
    xrCreateSpatialContextAsyncEXT(in XrSpatialContextCreateInfoEXT, out ulong)

    xrCreateSpatialDiscoverySnapshotAsyncEXT(ulong, in XrSpatialDiscoverySnapshotCreateInfoEXT, out ulong)

    Creates a discovery snapshot for the given spatial context. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrCreateSpatialDiscoverySnapshotAsyncEXT(ulong spatialContext, in XrSpatialDiscoverySnapshotCreateInfoEXT createInfo, out ulong future)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created by using an overload of xrCreateSpatialContextAsyncEXT.

    XrSpatialDiscoverySnapshotCreateInfoEXT createInfo

    The creation info for the discovery snapshot.

    ulong future

    The output future.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • SpatialComponentNotEnabledEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialDiscoverySnapshotCompleteEXT(ulong, ulong, out XrCreateSpatialDiscoverySnapshotCompletionEXT)

    Completes the asynchronous operation started by xrCreateSpatialDiscoverySnapshotAsyncEXT, using your app space and frame's predicted display time. Provided by XR_EXT_spatial_entity.

    Declaration
    public static OpenXRResultStatus xrCreateSpatialDiscoverySnapshotCompleteEXT(ulong spatialContext, ulong future, out XrCreateSpatialDiscoverySnapshotCompletionEXT completion)
    Parameters
    Type Name Description
    ulong spatialContext

    The spatial context previously passed to xrCreateSpatialDiscoverySnapshotAsyncEXT.

    ulong future

    The future.

    XrCreateSpatialDiscoverySnapshotCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialDiscoverySnapshotCompleteEXT(ulong, in XrCreateSpatialDiscoverySnapshotCompletionInfoEXT, out XrCreateSpatialDiscoverySnapshotCompletionEXT)

    Completes the asynchronous operation started by xrCreateSpatialDiscoverySnapshotAsyncEXT. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrCreateSpatialDiscoverySnapshotCompleteEXT(ulong spatialContext, in XrCreateSpatialDiscoverySnapshotCompletionInfoEXT createSnapshotCompletionInfo, out XrCreateSpatialDiscoverySnapshotCompletionEXT completion)
    Parameters
    Type Name Description
    ulong spatialContext

    The spatial context previously passed to xrCreateSpatialDiscoverySnapshotAsyncEXT.

    XrCreateSpatialDiscoverySnapshotCompletionInfoEXT createSnapshotCompletionInfo

    The completion info.

    XrCreateSpatialDiscoverySnapshotCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialEntityFromIdEXT(ulong, in XrSpatialEntityFromIdCreateInfoEXT, out ulong)

    Creates a spatial entity handle from the given spatial entity ID. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrCreateSpatialEntityFromIdEXT(ulong spatialContext, in XrSpatialEntityFromIdCreateInfoEXT createInfo, out ulong spatialEntity)
    Parameters
    Type Name Description
    ulong spatialContext

    A valid spatial context.

    XrSpatialEntityFromIdCreateInfoEXT createInfo

    The creation info.

    ulong spatialEntity

    The output spatial entity handle.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • SpatialEntityIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialPersistenceContextAsyncEXT(ulong, in XrSpatialPersistenceContextCreateInfoEXT, out ulong)

    Creates persistence context scoped to the given session.

    Declaration
    public static extern XrResult xrCreateSpatialPersistenceContextAsyncEXT(ulong session, in XrSpatialPersistenceContextCreateInfoEXT createInfo, out ulong future)
    Parameters
    Type Name Description
    ulong session

    The session in which the persistence context will be active.

    XrSpatialPersistenceContextCreateInfoEXT createInfo

    The creation info.

    ulong future

    The output future.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • SpatialPersistenceScopeUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialPersistenceContextAsyncEXT(in XrSpatialPersistenceContextCreateInfoEXT, out ulong)

    Creates a persistence context scoped to the current session.

    Declaration
    public static extern OpenXRResultStatus xrCreateSpatialPersistenceContextAsyncEXT(in XrSpatialPersistenceContextCreateInfoEXT createInfo, out ulong future)
    Parameters
    Type Name Description
    XrSpatialPersistenceContextCreateInfoEXT createInfo

    The creation info.

    ulong future

    The output future.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • SpatialPersistenceScopeUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialPersistenceContextCompleteEXT(ulong, ulong, out XrCreateSpatialPersistenceContextCompletionEXT)

    Completes the asynchronous operation started by xrCreateSpatialPersistenceContextAsyncEXT(ulong, in XrSpatialPersistenceContextCreateInfoEXT, out ulong). Provided by XR_EXT_spatial_persistence.

    Declaration
    public static XrResult xrCreateSpatialPersistenceContextCompleteEXT(ulong session, ulong future, out XrCreateSpatialPersistenceContextCompletionEXT completion)
    Parameters
    Type Name Description
    ulong session

    The session previously passed to xrCreateSpatialPersistenceContextAsyncEXT.

    ulong future

    The future previously received from xrCreateSpatialPersistenceContextAsyncEXT.

    XrCreateSpatialPersistenceContextCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    completion is only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialPersistenceContextCompleteEXT(ulong, out XrCreateSpatialPersistenceContextCompletionEXT)

    Completes the asynchronous operation started by xrCreateSpatialPersistenceContextAsyncEXT(in XrSpatialPersistenceContextCreateInfoEXT, out ulong). Provided by XR_EXT_spatial_persistence.

    Declaration
    public static OpenXRResultStatus xrCreateSpatialPersistenceContextCompleteEXT(ulong future, out XrCreateSpatialPersistenceContextCompletionEXT completion)
    Parameters
    Type Name Description
    ulong future

    The future previously received from xrCreateSpatialPersistenceContextAsyncEXT.

    XrCreateSpatialPersistenceContextCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    completion is only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrCreateSpatialUpdateSnapshotEXT(ulong, uint, ulong*, uint, XrSpatialComponentTypeEXT*, out ulong)

    Creates a spatial update snapshot using your app space and the frame's predicted display time. A spatial update snapshot contains the latest component data for given entities. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern OpenXRResultStatus xrCreateSpatialUpdateSnapshotEXT(ulong spatialContext, uint entityCount, ulong* entities, uint componentTypeCount, XrSpatialComponentTypeEXT* componentTypes, out ulong snapshot)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created using an overload of xrCreateSpatialContextAsyncEXT.

    uint entityCount

    The count of elements in entities.

    ulong* entities

    Pointer to an array of entities for which the runtime must include component data in the snapshot.

    uint componentTypeCount

    The count of elements in componentTypes.

    XrSpatialComponentTypeEXT* componentTypes

    Pointer to an array of component types for which the runtime must include data in the snapshot.

    ulong snapshot

    The output snapshot.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • SpatialComponentNotEnabledEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    Warning

    You can create any number of snapshots according to your use case, but be mindful of the memory that is allocated for each new snapshot. Destroy snapshots once you no longer need them using xrDestroySpatialSnapshotEXT(ulong).

    See Also
    xrCreateSpatialContextAsyncEXT(in XrSpatialContextCreateInfoEXT, out ulong)

    xrCreateSpatialUpdateSnapshotEXT(ulong, NativeArray<ulong>, NativeArray<XrSpatialComponentTypeEXT>, out ulong)

    Creates a spatial update snapshot using your app space and the frame's predicted display time. A spatial update snapshot contains the latest component data for given entities. Provided by XR_EXT_spatial_entity.

    Declaration
    public static OpenXRResultStatus xrCreateSpatialUpdateSnapshotEXT(ulong spatialContext, NativeArray<ulong> entities, NativeArray<XrSpatialComponentTypeEXT> componentTypes, out ulong snapshot)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created using an overload of xrCreateSpatialContextAsyncEXT.

    NativeArray<ulong> entities

    Array of entities for which the runtime must include component data in the snapshot.

    NativeArray<XrSpatialComponentTypeEXT> componentTypes

    Array of component types for which the runtime must include data in the snapshot.

    ulong snapshot

    The output snapshot.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    • LossPending
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • SpatialComponentNotEnabledEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    Warning

    You can create any number of snapshots according to your use case, but be mindful of the memory that is allocated for each new snapshot. Destroy snapshots once you no longer need them using xrDestroySpatialSnapshotEXT(ulong).

    See Also
    xrCreateSpatialContextAsyncEXT(in XrSpatialContextCreateInfoEXT, out ulong)

    xrCreateSpatialUpdateSnapshotEXT(ulong, in XrSpatialUpdateSnapshotCreateInfoEXT, out ulong)

    Creates a spatial update snapshot, which contains the latest component data for given entities as specified by the creation info. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrCreateSpatialUpdateSnapshotEXT(ulong spatialContext, in XrSpatialUpdateSnapshotCreateInfoEXT createInfo, out ulong snapshot)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created using an overload of xrCreateSpatialContextAsyncEXT.

    XrSpatialUpdateSnapshotCreateInfoEXT createInfo

    The creation info.

    ulong snapshot

    Pointer to the created spatial update snapshot if this method returns a success code. Otherwise, null.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • TimeInvalid
    • SpatialComponentNotEnabledEXT
    Remarks
    Warning

    You can create any number of snapshots according to your use case, but be mindful of the memory that is allocated for each new snapshot. Destroy snapshots once you no longer need them using xrDestroySpatialSnapshotEXT.

    See Also
    xrCreateSpatialContextAsyncEXT(in XrSpatialContextCreateInfoEXT, out ulong)

    xrDestroySpatialContextEXT(ulong)

    Destroys the given spatial context. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrDestroySpatialContextEXT(ulong spatialContext)
    Parameters
    Type Name Description
    ulong spatialContext

    A spatial context previously created using OpenXRNativeAPI.xrCreateSpatialContextAsyncEXT.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • RuntimeFailure
    • HandleInvalid
    Remarks
    Warning

    You are responsible to synchronize this operation with any other threads you created that use this spatial context.

    xrDestroySpatialEntityEXT(ulong)

    Destroys the given spatial entity handle. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrDestroySpatialEntityEXT(ulong spatialEntity)
    Parameters
    Type Name Description
    ulong spatialEntity

    The spatial entity handle.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • RuntimeFailure
    • HandleInvalid
    Remarks
    Warning

    You are responsible to synchronize this operation with any other threads you created that use this spatial entity handle.

    xrDestroySpatialPersistenceContextEXT(ulong)

    Releases the given persistence context handle. Provided by XR_EXT_spatial_persistence.

    Declaration
    public static extern XrResult xrDestroySpatialPersistenceContextEXT(ulong persistenceContext)
    Parameters
    Type Name Description
    ulong persistenceContext

    The persistence context.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • RuntimeFailure
    • HandleInvalid
    Remarks
    Warning

    You are responsible to synchronize this operation with any other threads you created that use this persistence context.

    xrDestroySpatialSnapshotEXT(ulong)

    Destroys the given spatial snapshot handle and the resources associated with it. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrDestroySpatialSnapshotEXT(ulong snapshot)
    Parameters
    Type Name Description
    ulong snapshot

    A spatial snapshot previously created by methods such as xrCreateSpatialDiscoverySnapshotCompleteEXT or xrCreateSpatialDiscoverySnapshotCompleteEXT.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • RuntimeFailure
    • HandleInvalid
    Remarks
    Warning

    You are responsible to synchronize this operation with any other threads you created that use this spatial snapshot.

    See Also
    xrCreateSpatialDiscoverySnapshotCompleteEXT(ulong, in XrCreateSpatialDiscoverySnapshotCompletionInfoEXT, out XrCreateSpatialDiscoverySnapshotCompletionEXT)
    xrCreateSpatialDiscoverySnapshotCompleteEXT(ulong, ulong, out XrCreateSpatialDiscoverySnapshotCompletionEXT)
    xrCreateSpatialUpdateSnapshotEXT(ulong, in XrSpatialUpdateSnapshotCreateInfoEXT, out ulong)
    xrCreateSpatialUpdateSnapshotEXT(ulong, uint, ulong*, uint, XrSpatialComponentTypeEXT*, out ulong)
    xrCreateSpatialUpdateSnapshotEXT(ulong, NativeArray<ulong>, NativeArray<XrSpatialComponentTypeEXT>, out ulong)

    xrEnumerateSpatialCapabilitiesEXT(uint, out uint, XrSpatialCapabilityEXT*)

    Enumerates the spatial capabilities that are supported by the current system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern OpenXRResultStatus xrEnumerateSpatialCapabilitiesEXT(uint capabilityCountInput, out uint capabilityCountOutput, XrSpatialCapabilityEXT* capabilities)
    Parameters
    Type Name Description
    uint capabilityCountInput

    The capacity of capabilities, or 0 to indicate a request to retrieve the required capacity.

    uint capabilityCountOutput

    The count of elements in capabilities, or the required capacity if capabilityCountInput is insufficient.

    XrSpatialCapabilityEXT* capabilities

    Pointer to an array of capabilities. Can be null if capabilityCountInput is 0.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrEnumerateSpatialCapabilitiesEXT(ulong, ulong, uint, out uint, XrSpatialCapabilityEXT*)

    Enumerates the spatial capabilities that are supported by the given OpenXR instance and system ID. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrEnumerateSpatialCapabilitiesEXT(ulong instance, ulong systemId, uint capabilityCountInput, out uint capabilityCountOutput, XrSpatialCapabilityEXT* capabilities)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The ID of the system whose spatial capabilities will be enumerated.

    uint capabilityCountInput

    The capacity of capabilities, or 0 to indicate a request to retrieve the required capacity.

    uint capabilityCountOutput

    The count of elements in capabilities, or the required capacity if capabilityCountInput is insufficient.

    XrSpatialCapabilityEXT* capabilities

    Pointer to an array of capabilities. Can be null if capabilityCountInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrEnumerateSpatialCapabilitiesEXT(ulong, ulong, Allocator, out NativeArray<XrSpatialCapabilityEXT>)

    Enumerates the spatial capabilities that are supported by the given OpenXR instance and system ID. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrEnumerateSpatialCapabilitiesEXT(ulong instance, ulong systemId, Allocator allocator, out NativeArray<XrSpatialCapabilityEXT> capabilities)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The ID of the system whose spatial capabilities will be enumerated.

    Allocator allocator

    The allocation strategy to use for capabilities.

    NativeArray<XrSpatialCapabilityEXT> capabilities

    The array of capabilities.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if capabilities.Length would exceed MaxValue.

    xrEnumerateSpatialCapabilitiesEXT(Allocator, out NativeArray<XrSpatialCapabilityEXT>)

    Enumerates the spatial capabilities that are supported by the current system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static OpenXRResultStatus xrEnumerateSpatialCapabilitiesEXT(Allocator allocator, out NativeArray<XrSpatialCapabilityEXT> capabilities)
    Parameters
    Type Name Description
    Allocator allocator

    The allocation strategy to use for capabilities.

    NativeArray<XrSpatialCapabilityEXT> capabilities

    The array of capabilities.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if capabilities.Length would exceed MaxValue.

    xrEnumerateSpatialCapabilityComponentTypesEXT(ulong, ulong, XrSpatialCapabilityEXT, Allocator, out NativeArray<XrSpatialComponentTypeEXT>)

    Enumerates the component types that the given capability provides on its entities for the given system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrEnumerateSpatialCapabilityComponentTypesEXT(ulong instance, ulong systemId, XrSpatialCapabilityEXT capability, Allocator allocator, out NativeArray<XrSpatialComponentTypeEXT> componentTypes)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The system whose spatial capability components will be enumerated.

    XrSpatialCapabilityEXT capability

    The capability for which the components will be enumerated.

    Allocator allocator

    The allocation strategy to use for componentTypes

    NativeArray<XrSpatialComponentTypeEXT> componentTypes

    The component types that capability supports.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if componentTypes.Length would exceed MaxValue.

    xrEnumerateSpatialCapabilityComponentTypesEXT(ulong, ulong, XrSpatialCapabilityEXT, ref XrSpatialCapabilityComponentTypesEXT)

    Enumerates the component types that a given capability provides on its entities for the given system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrEnumerateSpatialCapabilityComponentTypesEXT(ulong instance, ulong systemId, XrSpatialCapabilityEXT capability, ref XrSpatialCapabilityComponentTypesEXT capabilityComponents)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The system whose spatial capability components will be enumerated.

    XrSpatialCapabilityEXT capability

    The capability for which the components will be enumerated.

    XrSpatialCapabilityComponentTypesEXT capabilityComponents

    The component types that capability supports.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT

    xrEnumerateSpatialCapabilityComponentTypesEXT(XrSpatialCapabilityEXT, Allocator, out NativeArray<XrSpatialComponentTypeEXT>)

    Enumerates the component types that the given capability provides on its entities for the current system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static OpenXRResultStatus xrEnumerateSpatialCapabilityComponentTypesEXT(XrSpatialCapabilityEXT capability, Allocator allocator, out NativeArray<XrSpatialComponentTypeEXT> componentTypes)
    Parameters
    Type Name Description
    XrSpatialCapabilityEXT capability

    The capability for which the components will be enumerated.

    Allocator allocator

    The allocation strategy to use for componentTypes

    NativeArray<XrSpatialComponentTypeEXT> componentTypes

    The component types that capability supports.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if componentTypes.Length would exceed MaxValue.

    xrEnumerateSpatialCapabilityComponentTypesEXT(XrSpatialCapabilityEXT, ref XrSpatialCapabilityComponentTypesEXT)

    Enumerates the component types that the given capability provides on its entities for the current system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern OpenXRResultStatus xrEnumerateSpatialCapabilityComponentTypesEXT(XrSpatialCapabilityEXT capability, ref XrSpatialCapabilityComponentTypesEXT capabilityComponents)
    Parameters
    Type Name Description
    XrSpatialCapabilityEXT capability

    The capability for which the components will be enumerated.

    XrSpatialCapabilityComponentTypesEXT capabilityComponents

    The component types that capability supports.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT

    xrEnumerateSpatialCapabilityFeaturesEXT(ulong, ulong, XrSpatialCapabilityEXT, uint, out uint, XrSpatialCapabilityFeatureEXT*)

    Enumerates the configurable features that the given capability supports for the given system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrEnumerateSpatialCapabilityFeaturesEXT(ulong instance, ulong systemId, XrSpatialCapabilityEXT capability, uint capabilityFeatureCapacityInput, out uint capabilityFeatureCountOutput, XrSpatialCapabilityFeatureEXT* capabilityFeatures)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The system for which the features will be enumerated.

    XrSpatialCapabilityEXT capability

    The capability for which the features will be enumerated.

    uint capabilityFeatureCapacityInput

    The capacity of capabilityFeatures, or 0 to indicate a request to retrieve the required capacity.

    uint capabilityFeatureCountOutput

    The count of elements in capabilityFeatures.

    XrSpatialCapabilityFeatureEXT* capabilityFeatures

    Pointer to an array of features.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrEnumerateSpatialCapabilityFeaturesEXT(ulong, ulong, XrSpatialCapabilityEXT, Allocator, out NativeArray<XrSpatialCapabilityFeatureEXT>)

    Enumerates the configurable features that the given capability supports for the given system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrEnumerateSpatialCapabilityFeaturesEXT(ulong instance, ulong systemId, XrSpatialCapabilityEXT capability, Allocator allocator, out NativeArray<XrSpatialCapabilityFeatureEXT> capabilityFeatures)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The system for which the features will be enumerated.

    XrSpatialCapabilityEXT capability

    The capability for which the features will be enumerated.

    Allocator allocator

    The allocation strategy to use for capabilityFeatures

    NativeArray<XrSpatialCapabilityFeatureEXT> capabilityFeatures

    The output array of features.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if capabilityFeatures.Length would exceed MaxValue.

    xrEnumerateSpatialCapabilityFeaturesEXT(XrSpatialCapabilityEXT, uint, out uint, XrSpatialCapabilityFeatureEXT*)

    Enumerates the configurable features that the given capability supports for the current system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern OpenXRResultStatus xrEnumerateSpatialCapabilityFeaturesEXT(XrSpatialCapabilityEXT capability, uint capabilityFeatureCapacityInput, out uint capabilityFeatureCountOutput, XrSpatialCapabilityFeatureEXT* capabilityFeatures)
    Parameters
    Type Name Description
    XrSpatialCapabilityEXT capability

    The capability for which the features will be enumerated.

    uint capabilityFeatureCapacityInput

    The capacity of capabilityFeatures, or 0 to indicate a request to retrieve the required capacity.

    uint capabilityFeatureCountOutput

    The count of elements in capabilityFeatures.

    XrSpatialCapabilityFeatureEXT* capabilityFeatures

    Pointer to an array of features.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrEnumerateSpatialCapabilityFeaturesEXT(XrSpatialCapabilityEXT, Allocator, out NativeArray<XrSpatialCapabilityFeatureEXT>)

    Enumerates the configurable features that the given capability supports for the current system. Provided by XR_EXT_spatial_entity.

    Declaration
    public static OpenXRResultStatus xrEnumerateSpatialCapabilityFeaturesEXT(XrSpatialCapabilityEXT capability, Allocator allocator, out NativeArray<XrSpatialCapabilityFeatureEXT> capabilityFeatures)
    Parameters
    Type Name Description
    XrSpatialCapabilityEXT capability

    The capability for which the features will be enumerated.

    Allocator allocator

    The allocation strategy to use for capabilityFeatures

    NativeArray<XrSpatialCapabilityFeatureEXT> capabilityFeatures

    The output array of features.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    • SpatialCapabilityUnsupportedEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if capabilityFeatures.Length would exceed MaxValue.

    xrEnumerateSpatialPersistenceScopesEXT(uint, out uint, XrSpatialPersistenceScopeEXT*)

    Enumerates the types of persistence scopes that are supported by the current OpenXR instance and system ID.

    Declaration
    public static extern XrResult xrEnumerateSpatialPersistenceScopesEXT(uint persistenceScopeCapacityInput, out uint persistenceScopeCountOutput, XrSpatialPersistenceScopeEXT* persistenceScopes)
    Parameters
    Type Name Description
    uint persistenceScopeCapacityInput

    The capacity of persistenceScopes, or 0 to indicate a request to retrieve the required capacity.

    uint persistenceScopeCountOutput

    The number of persistence scopes, or the required capacity if persistenceScopeCapacityInput is insufficient.

    XrSpatialPersistenceScopeEXT* persistenceScopes

    Pointer to an array of persistence scopes. Can be null if persistenceScopeCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrEnumerateSpatialPersistenceScopesEXT(ulong, ulong, uint, out uint, XrSpatialPersistenceScopeEXT*)

    Enumerates the types of persistence scopes that are supported by the given OpenXR instance and system ID.

    Declaration
    public static extern XrResult xrEnumerateSpatialPersistenceScopesEXT(ulong instance, ulong systemId, uint persistenceScopeCapacityInput, out uint persistenceScopeCountOutput, XrSpatialPersistenceScopeEXT* persistenceScopes)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The ID of the system whose persistence scopes will be enumerated.

    uint persistenceScopeCapacityInput

    The capacity of persistenceScopes, or 0 to indicate a request to retrieve the required capacity.

    uint persistenceScopeCountOutput

    The number of persistence scopes, or the required capacity if persistenceScopeCapacityInput is insufficient.

    XrSpatialPersistenceScopeEXT* persistenceScopes

    Pointer to an array of persistence scopes. Can be null if persistenceScopeCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrEnumerateSpatialPersistenceScopesEXT(ulong, ulong, Allocator, out NativeArray<XrSpatialPersistenceScopeEXT>)

    Enumerates the types of persistence scopes that are supported by the given OpenXR instance and system ID.

    Declaration
    public static XrResult xrEnumerateSpatialPersistenceScopesEXT(ulong instance, ulong systemId, Allocator allocator, out NativeArray<XrSpatialPersistenceScopeEXT> persistenceScopes)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance.

    ulong systemId

    The ID of the system whose persistence scopes will be enumerated.

    Allocator allocator

    The allocation strategy to use for persistenceScopes.

    NativeArray<XrSpatialPersistenceScopeEXT> persistenceScopes

    Output native array of persistence scopes.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    xrEnumerateSpatialPersistenceScopesEXT(Allocator, out NativeArray<XrSpatialPersistenceScopeEXT>)

    Enumerates the types of persistence scopes that are supported by the current OpenXR instance and system ID.

    Declaration
    public static XrResult xrEnumerateSpatialPersistenceScopesEXT(Allocator allocator, out NativeArray<XrSpatialPersistenceScopeEXT> persistenceScopes)
    Parameters
    Type Name Description
    Allocator allocator

    The allocation strategy to use for persistenceScopes.

    NativeArray<XrSpatialPersistenceScopeEXT> persistenceScopes

    Output native array of persistence scopes.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SizeInsufficient
    • SystemInvalid
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    xrGetSpatialBufferFloatEXT(ulong, in XrSpatialBufferGetInfoEXT, uint, out uint, float*)

    Gets the contents of a buffer of type Float. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrGetSpatialBufferFloatEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, uint bufferCapacityInput, out uint bufferCountOutput, float* buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    uint bufferCapacityInput

    The capacity of buffer, or 0 to indicate a request to retrieve the required capacity.

    uint bufferCountOutput

    The count of elements in buffer, or the required capacity if bufferCapacityInput is insufficient.

    float* buffer

    Pointer to an array of float elements. Can be null if bufferCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrGetSpatialBufferFloatEXT(ulong, in XrSpatialBufferGetInfoEXT, Allocator, out NativeArray<float>)

    Gets the contents of a buffer of type Float. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrGetSpatialBufferFloatEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, Allocator allocator, out NativeArray<float> buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    Allocator allocator

    The allocation strategy to use for buffer.

    NativeArray<float> buffer

    The output array.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if buffer.Length would exceed MaxValue.

    xrGetSpatialBufferStringEXT(ulong, in XrSpatialBufferGetInfoEXT, uint, out uint, byte*)

    Gets the contents of a buffer of type String. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrGetSpatialBufferStringEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, uint bufferCapacityInput, out uint bufferCountOutput, byte* buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    uint bufferCapacityInput

    The capacity of buffer, or 0 to indicate a request to retrieve the required capacity.

    uint bufferCountOutput

    The number of UTF-8 char elements in buffer, or the required capacity if bufferCapacityInput is insufficient.

    byte* buffer

    Pointer to an array of byte elements. Can be null if bufferCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrGetSpatialBufferStringEXT(ulong, in XrSpatialBufferGetInfoEXT, Allocator, out NativeArray<byte>)

    Gets the contents of a buffer of type String as a native array of bytes, allowing you to read the string and then dispose the array when you no longer need the string in memory. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrGetSpatialBufferStringEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, Allocator allocator, out NativeArray<byte> buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    Allocator allocator

    The allocation strategy to use for buffer

    NativeArray<byte> buffer

    The output array.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    To read the output as a string, use the following example code:

    var result = xrGetSpatialBufferStringEXT(snapshot, info, allocator, out var buffer);
    if (result.IsError()) return;
    var myString = Encoding.UTF8.GetString(buffer.AsReadOnlySpan());
    

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if buffer.Length would exceed MaxValue.

    xrGetSpatialBufferUint16EXT(ulong, in XrSpatialBufferGetInfoEXT, uint, out uint, ushort*)

    Gets the contents of a buffer of type Uint16. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrGetSpatialBufferUint16EXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, uint bufferCapacityInput, out uint bufferCountOutput, ushort* buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    uint bufferCapacityInput

    The capacity of buffer, or 0 to indicate a request to retrieve the required capacity.

    uint bufferCountOutput

    The count of elements in buffer, or the required capacity if bufferCapacityInput is insufficient.

    ushort* buffer

    Pointer to an array of ushort elements. Can be null if bufferCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrGetSpatialBufferUint16EXT(ulong, in XrSpatialBufferGetInfoEXT, Allocator, out NativeArray<ushort>)

    Gets the contents of a buffer of type Uint16. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrGetSpatialBufferUint16EXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, Allocator allocator, out NativeArray<ushort> buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    Allocator allocator

    The allocation strategy to use for buffer

    NativeArray<ushort> buffer

    The output array.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if buffer.Length would exceed MaxValue.

    xrGetSpatialBufferUint32EXT(ulong, in XrSpatialBufferGetInfoEXT, uint, out uint, uint*)

    Gets the contents of a buffer of type Uint32. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrGetSpatialBufferUint32EXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, uint bufferCapacityInput, out uint bufferCountOutput, uint* buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    uint bufferCapacityInput

    The capacity of buffer, or 0 to indicate a request to retrieve the required capacity.

    uint bufferCountOutput

    The count of elements in buffer, or the required capacity if bufferCapacityInput is insufficient.

    uint* buffer

    Pointer to an array of uint elements. Can be null if bufferCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrGetSpatialBufferUint32EXT(ulong, in XrSpatialBufferGetInfoEXT, Allocator, out NativeArray<uint>)

    Gets the contents of a buffer of type Uint32. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrGetSpatialBufferUint32EXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, Allocator allocator, out NativeArray<uint> buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    Allocator allocator

    The allocation strategy to use for buffer.

    NativeArray<uint> buffer

    The output array.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if buffer.Length would exceed MaxValue.

    xrGetSpatialBufferUint8EXT(ulong, in XrSpatialBufferGetInfoEXT, uint, out uint, byte*)

    Gets the contents of a buffer of type Uint8. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrGetSpatialBufferUint8EXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, uint bufferCapacityInput, out uint bufferCountOutput, byte* buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    uint bufferCapacityInput

    The capacity of buffer, or 0 to indicate a request to retrieve the required capacity.

    uint bufferCountOutput

    The count of elements in buffer, or the required capacity if bufferCapacityInput is insufficient.

    byte* buffer

    Pointer to an array of byte elements. Can be null if bufferCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrGetSpatialBufferUint8EXT(ulong, in XrSpatialBufferGetInfoEXT, Allocator, out NativeArray<byte>)

    Gets the contents of a buffer of type Uint8. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrGetSpatialBufferUint8EXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, Allocator allocator, out NativeArray<byte> buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    Allocator allocator

    The allocation strategy to use for buffer

    NativeArray<byte> buffer

    The output array.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if buffer.Length would exceed MaxValue.

    xrGetSpatialBufferVector2fEXT(ulong, in XrSpatialBufferGetInfoEXT, uint, out uint, XrVector2f*)

    Gets the contents of a buffer of type Vector2f. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrGetSpatialBufferVector2fEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, uint bufferCapacityInput, out uint bufferCountOutput, XrVector2f* buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    uint bufferCapacityInput

    The capacity of buffer, or 0 to indicate a request to retrieve the required capacity.

    uint bufferCountOutput

    The count of elements in buffer, or the required capacity if bufferCapacityInput is insufficient.

    XrVector2f* buffer

    Pointer to an array of XrVector2f elements. Can be null if bufferCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrGetSpatialBufferVector2fEXT(ulong, in XrSpatialBufferGetInfoEXT, Allocator, out NativeArray<XrVector2f>)

    Gets the contents of a buffer of type Vector2f. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrGetSpatialBufferVector2fEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, Allocator allocator, out NativeArray<XrVector2f> buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    Allocator allocator

    The allocation strategy to use for buffer.

    NativeArray<XrVector2f> buffer

    The output array.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if buffer.Length would exceed MaxValue.

    xrGetSpatialBufferVector3fEXT(ulong, in XrSpatialBufferGetInfoEXT, uint, out uint, XrVector3f*)

    Gets the contents of a buffer of type Vector3f. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrGetSpatialBufferVector3fEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, uint bufferCapacityInput, out uint bufferCountOutput, XrVector3f* buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    uint bufferCapacityInput

    The capacity of buffer, or 0 to indicate a request to retrieve the required capacity.

    uint bufferCountOutput

    The count of elements in buffer, or the required capacity if bufferCapacityInput is insufficient.

    XrVector3f* buffer

    Pointer to an array of XrVector3f elements. Can be null if bufferCapacityInput is 0.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrGetSpatialBufferVector3fEXT(ulong, in XrSpatialBufferGetInfoEXT, Allocator, out NativeArray<XrVector3f>)

    Gets the contents of a buffer of type Vector3f. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrGetSpatialBufferVector3fEXT(ulong snapshot, in XrSpatialBufferGetInfoEXT info, Allocator allocator, out NativeArray<XrVector3f> buffer)
    Parameters
    Type Name Description
    ulong snapshot

    The handle to a spatial snapshot.

    XrSpatialBufferGetInfoEXT info

    The information regarding the buffer to query.

    Allocator allocator

    The allocation strategy to use for buffer.

    NativeArray<XrVector3f> buffer

    The output array.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    • SpatialBufferIdInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native array if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if buffer.Length would exceed MaxValue.

    xrPersistSpatialEntityAsyncEXT(ulong, in XrSpatialEntityPersistInfoEXT, out ulong)

    Persists the spatial entity defined in persistInfo to the given persistence context. Provided by XR_EXT_spatial_persistence_operations.

    Declaration
    public static extern XrResult xrPersistSpatialEntityAsyncEXT(ulong persistenceContext, in XrSpatialEntityPersistInfoEXT persistInfo, out ulong future)
    Parameters
    Type Name Description
    ulong persistenceContext

    A persistence context previously created using xrCreateSpatialPersistenceContextAsyncEXT.

    XrSpatialEntityPersistInfoEXT persistInfo

    The persist info struct.

    ulong future

    The output future.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • SpatialPersistenceScopeIncompatibleEXT
    • SpatialEntityIdInvalidEXT
    • PermissionInsufficient
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrPersistSpatialEntityCompleteEXT(ulong, ulong, out XrPersistSpatialEntityCompletionEXT)

    Completes the asynchronous operation started by xrPersistSpatialEntityAsyncEXT(ulong, in XrSpatialEntityPersistInfoEXT, out ulong). Provided by XR_EXT_spatial_persistence_operations.

    Declaration
    public static XrResult xrPersistSpatialEntityCompleteEXT(ulong persistenceContext, ulong future, out XrPersistSpatialEntityCompletionEXT completion)
    Parameters
    Type Name Description
    ulong persistenceContext

    The persistence context previously passed to xrPersistSpatialEntityAsyncEXT.

    ulong future

    The future previously received from xrPersistSpatialEntityAsyncEXT.

    XrPersistSpatialEntityCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrPollFutureEXT(ulong, in XrFuturePollInfoEXT, out XrFuturePollResultEXT)

    Poll the state of a future scoped to the given OpenXR instance. Provided by XR_EXT_future.

    Declaration
    public static XrResult xrPollFutureEXT(ulong instance, in XrFuturePollInfoEXT pollInfo, out XrFuturePollResultEXT pollResult)
    Parameters
    Type Name Description
    ulong instance

    The OpenXR instance for which the future in pollInfo was returned.

    XrFuturePollInfoEXT pollInfo

    The poll info.

    XrFuturePollResultEXT pollResult

    The output result struct.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • FutureInvalidEXT
    Remarks
    Important

    pollResult.state is only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrPollFutureEXT(in XrFuturePollInfoEXT, out XrFuturePollResultEXT)

    Poll the state of a future scoped to the current OpenXR instance. Provided by XR_EXT_future.

    Declaration
    public static OpenXRResultStatus xrPollFutureEXT(in XrFuturePollInfoEXT pollInfo, out XrFuturePollResultEXT pollResult)
    Parameters
    Type Name Description
    XrFuturePollInfoEXT pollInfo

    The poll info.

    XrFuturePollResultEXT pollResult

    The output result struct.

    Returns
    Type Description
    OpenXRResultStatus

    The result of the operation.

    nativeStatusCode success codes:

    • Success
    nativeStatusCode failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • FutureInvalidEXT
    Remarks
    Important

    pollResult.state is only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrQuerySpatialComponentDataEXT(ulong, in XrSpatialComponentDataQueryConditionEXT, Allocator, out NativeArray<ulong>, out NativeArray<XrSpatialEntityTrackingStateEXT>)

    Queries the component data of the entities in a given snapshot based on the query condition. Provided by XR_EXT_spatial_entity.

    Declaration
    public static XrResult xrQuerySpatialComponentDataEXT(ulong snapshot, in XrSpatialComponentDataQueryConditionEXT queryCondition, Allocator allocator, out NativeArray<ulong> entityIds, out NativeArray<XrSpatialEntityTrackingStateEXT> entityStates)
    Parameters
    Type Name Description
    ulong snapshot

    A spatial snapshot previously created by xrCreateSpatialDiscoverySnapshotCompleteEXT or xrCreateSpatialUpdateSnapshotEXT.

    XrSpatialComponentDataQueryConditionEXT queryCondition

    The query condition.

    Allocator allocator

    The allocation strategy to use for output arrays.

    NativeArray<ulong> entityIds

    The output entity IDs.

    NativeArray<XrSpatialEntityTrackingStateEXT> entityStates

    The output entity states. Indices are parallel to entityIds

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    You are responsible to Dispose the output native arrays if you pass Allocator.Persistent as the allocator value.

    Exceptions
    Type Condition
    OverflowException

    Thrown if either entityIds.Length or entityStates.Length would exceed MaxValue.

    xrQuerySpatialComponentDataEXT(ulong, in XrSpatialComponentDataQueryConditionEXT, ref XrSpatialComponentDataQueryResultEXT)

    Queries the component data of the entities in a given snapshot based on the query condition. Provided by XR_EXT_spatial_entity.

    Declaration
    public static extern XrResult xrQuerySpatialComponentDataEXT(ulong snapshot, in XrSpatialComponentDataQueryConditionEXT queryCondition, ref XrSpatialComponentDataQueryResultEXT queryResult)
    Parameters
    Type Name Description
    ulong snapshot

    A spatial snapshot previously created by xrCreateSpatialDiscoverySnapshotCompleteEXT or xrCreateSpatialUpdateSnapshotEXT.

    XrSpatialComponentDataQueryConditionEXT queryCondition

    The query condition.

    XrSpatialComponentDataQueryResultEXT queryResult

    The query result.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • SizeInsufficient

    xrUnpersistSpatialEntityAsyncEXT(ulong, in XrSpatialEntityUnpersistInfoEXT, out ulong)

    Unpersists the spatial entity defined in unpersistInfo from the given persistence context. Provided by XR_EXT_spatial_persistence_operations.

    Declaration
    public static extern XrResult xrUnpersistSpatialEntityAsyncEXT(ulong persistenceContext, in XrSpatialEntityUnpersistInfoEXT unpersistInfo, out ulong future)
    Parameters
    Type Name Description
    ulong persistenceContext

    A persistence context previously created using xrCreateSpatialPersistenceContextAsyncEXT.

    XrSpatialEntityUnpersistInfoEXT unpersistInfo

    The unpersist info struct.

    ulong future

    The output future.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • OutOfMemory
    • LimitReached
    • PermissionInsufficient
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    xrUnpersistSpatialEntityCompleteEXT(ulong, ulong, out XrUnpersistSpatialEntityCompletionEXT)

    Completes the asynchronous operation started by xrUnpersistSpatialEntityAsyncEXT(ulong, in XrSpatialEntityUnpersistInfoEXT, out ulong). Provided by XR_EXT_spatial_persistence_operations.

    Declaration
    public static XrResult xrUnpersistSpatialEntityCompleteEXT(ulong persistenceContext, ulong future, out XrUnpersistSpatialEntityCompletionEXT completion)
    Parameters
    Type Name Description
    ulong persistenceContext

    The persistence context previously passed to xrUnpersistSpatialEntityAsyncEXT.

    ulong future

    The future previously received from xrUnpersistSpatialEntityAsyncEXT.

    XrUnpersistSpatialEntityCompletionEXT completion

    The output completion struct.

    Returns
    Type Description
    XrResult

    The result of the operation.

    Success codes:

    • Success
    • LossPending
    Failure codes:
    • FunctionUnsupported
    • ValidationFailure
    • RuntimeFailure
    • HandleInvalid
    • InstanceLost
    • SessionLost
    • FuturePendingEXT
    • FutureInvalidEXT
    Remarks
    Important

    Output parameters are only valid if the returned result .IsSuccess(). Don't read the output if an error is returned.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)