Class EXTFuture
In XR systems there are certain operations that are long running and do not reasonably complete within a normal frame loop. This extension introduces the concept of a future which supports creation of asynchronous (async) functions for such long running operations. This extension does not include any asynchronous operations: it is expected that other extensions will use these futures and their associated conventions in this extension to define their asynchronous operations.
An XrFutureEXT represents the future result of an asynchronous operation, comprising an XrResult and possibly additional outputs. Long running operations immediately return an XrFutureEXT when started, letting the application poll the state of the future, and get the result once ready by calling a "complete"-function.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intExtendsXrResult.static final intExtendsXrResult.static final StringThe extension name.static final intThe extension specification version.static final intXrFutureStateEXT - Information on future to cancelstatic final intXrFutureStateEXT - Information on future to cancelstatic final intXR_NULL_FUTURE_EXTstatic final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType.static final intExtendsXrStructureType. -
Method Summary
Modifier and TypeMethodDescriptionstatic intnxrCancelFutureEXT(org.lwjgl.openxr.XrInstance instance, long cancelInfo) Unsafe version of:CancelFutureEXTstatic intnxrPollFutureEXT(org.lwjgl.openxr.XrInstance instance, long pollInfo, long pollResult) Unsafe version of:PollFutureEXTstatic intxrCancelFutureEXT(org.lwjgl.openxr.XrInstance instance, XrFutureCancelInfoEXT cancelInfo) Cancel future.static intxrPollFutureEXT(org.lwjgl.openxr.XrInstance instance, XrFuturePollInfoEXT pollInfo, XrFuturePollResultEXT pollResult) Polls the lifecycle state of an XrFuture.
-
Field Details
-
XR_EXT_future_SPEC_VERSION
public static final int XR_EXT_future_SPEC_VERSIONThe extension specification version.- See Also:
-
XR_EXT_FUTURE_EXTENSION_NAME
The extension name.- See Also:
-
XR_NULL_FUTURE_EXT
public static final int XR_NULL_FUTURE_EXTXR_NULL_FUTURE_EXT- See Also:
-
XR_ERROR_FUTURE_PENDING_EXT
public static final int XR_ERROR_FUTURE_PENDING_EXT- See Also:
-
XR_ERROR_FUTURE_INVALID_EXT
public static final int XR_ERROR_FUTURE_INVALID_EXT- See Also:
-
XR_TYPE_FUTURE_CANCEL_INFO_EXT
public static final int XR_TYPE_FUTURE_CANCEL_INFO_EXTExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_FUTURE_POLL_INFO_EXT
public static final int XR_TYPE_FUTURE_POLL_INFO_EXTExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_FUTURE_COMPLETION_EXT
public static final int XR_TYPE_FUTURE_COMPLETION_EXTExtendsXrStructureType.Enum values:
- See Also:
-
XR_TYPE_FUTURE_POLL_RESULT_EXT
public static final int XR_TYPE_FUTURE_POLL_RESULT_EXTExtendsXrStructureType.Enum values:
- See Also:
-
XR_FUTURE_STATE_PENDING_EXT
public static final int XR_FUTURE_STATE_PENDING_EXTXrFutureStateEXT - Information on future to cancelEnumerant Descriptions
FUTURE_STATE_PENDING_EXT. The state of a future that is waiting for the async operation to conclude. This is typically the initial state of a future returned from an async function.FUTURE_STATE_READY_EXT. The state of a future when the result of the async operation is ready. The application can retrieve the result by calling the associated completion function.
A future that is not invalidated (or completed) may be in one of two states,
PendingandReady, represented byFUTURE_STATE_PENDING_EXTandFUTURE_STATE_READY_EXTrespectively.- When successfully returned from an async function the future starts out as
Pending. In this state the future may be polled, but must not be passed to a completion function. Applications should wait for the future to become ready and keep polling the state of the future. If a pending future is passed to the associated completion function, it must returnERROR_FUTURE_PENDING_EXT. - Once the asynchronous operation succeeds or fails, the state of the future moves to
Ready. In the ready state the future may be "Completed" with theCompletefunction. See Completing a Future. - After being successfully completed, the future becomes invalidated if the completion function returns a success code, and in the case of two-call idioms, the array was not
NULL. - After a call to
CancelFutureEXT, the future becomes invalidated immediately and any resources associated with it may be freed (including handles) - When the associated handle is destroyed, the futures become invalidated. See Future Scope.
A future returned from an async function must be in either the state
FUTURE_STATE_PENDING_EXTorFUTURE_STATE_READY_EXT. A runtime may skip thePendingstate and go directly toReadyif the result is immediately available.See Also
- See Also:
-
XR_FUTURE_STATE_READY_EXT
public static final int XR_FUTURE_STATE_READY_EXTXrFutureStateEXT - Information on future to cancelEnumerant Descriptions
FUTURE_STATE_PENDING_EXT. The state of a future that is waiting for the async operation to conclude. This is typically the initial state of a future returned from an async function.FUTURE_STATE_READY_EXT. The state of a future when the result of the async operation is ready. The application can retrieve the result by calling the associated completion function.
A future that is not invalidated (or completed) may be in one of two states,
PendingandReady, represented byFUTURE_STATE_PENDING_EXTandFUTURE_STATE_READY_EXTrespectively.- When successfully returned from an async function the future starts out as
Pending. In this state the future may be polled, but must not be passed to a completion function. Applications should wait for the future to become ready and keep polling the state of the future. If a pending future is passed to the associated completion function, it must returnERROR_FUTURE_PENDING_EXT. - Once the asynchronous operation succeeds or fails, the state of the future moves to
Ready. In the ready state the future may be "Completed" with theCompletefunction. See Completing a Future. - After being successfully completed, the future becomes invalidated if the completion function returns a success code, and in the case of two-call idioms, the array was not
NULL. - After a call to
CancelFutureEXT, the future becomes invalidated immediately and any resources associated with it may be freed (including handles) - When the associated handle is destroyed, the futures become invalidated. See Future Scope.
A future returned from an async function must be in either the state
FUTURE_STATE_PENDING_EXTorFUTURE_STATE_READY_EXT. A runtime may skip thePendingstate and go directly toReadyif the result is immediately available.See Also
- See Also:
-
-
Method Details
-
nxrPollFutureEXT
public static int nxrPollFutureEXT(org.lwjgl.openxr.XrInstance instance, long pollInfo, long pollResult) Unsafe version of:PollFutureEXT -
xrPollFutureEXT
public static int xrPollFutureEXT(org.lwjgl.openxr.XrInstance instance, XrFuturePollInfoEXT pollInfo, XrFuturePollResultEXT pollResult) Polls the lifecycle state of an XrFuture.C Specification
The
PollFutureEXTfunction is defined as:XrResult xrPollFutureEXT( XrInstance instance, const XrFuturePollInfoEXT* pollInfo, XrFuturePollResultEXT* pollResult);Description
Applications can use this function to check the current state of a future, typically while waiting for the async operation to complete and the future to become "ready" to complete.
Note
Each
XrFutureEXTvalue must be externally synchronized by the application when calling completion, polling, and cancellation functions, and when destroying the associated handle.Valid Usage (Implicit)
- The
XR_EXT_futureextension must be enabled prior to callingPollFutureEXT instancemust be a validXrInstancehandlepollInfomust be a pointer to a validXrFuturePollInfoEXTstructurepollResultmust be a pointer to anXrFuturePollResultEXTstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
instance- anXrInstancehandlepollInfo- a pointer to anXrFuturePollInfoEXTstructure.pollResult- a pointer to anXrFuturePollResultEXTstructure to be populated on a successful call.
- The
-
nxrCancelFutureEXT
public static int nxrCancelFutureEXT(org.lwjgl.openxr.XrInstance instance, long cancelInfo) Unsafe version of:CancelFutureEXT -
xrCancelFutureEXT
public static int xrCancelFutureEXT(org.lwjgl.openxr.XrInstance instance, XrFutureCancelInfoEXT cancelInfo) Cancel future.C Specification
The
CancelFutureEXTfunction is defined as:XrResult xrCancelFutureEXT( XrInstance instance, const XrFutureCancelInfoEXT* cancelInfo);Description
This function cancels the future and signals that the async operation is not required. After a future has been cancelled any functions using this future must return
ERROR_FUTURE_INVALID_EXT.A runtime may stop the asynchronous operation associated with a future after an app has cancelled it.
Note
Each
XrFutureEXTvalue must be externally synchronized by the application when calling completion, polling, and cancellation functions, or destroying the associated handle.Valid Usage (Implicit)
- The
XR_EXT_futureextension must be enabled prior to callingCancelFutureEXT instancemust be a validXrInstancehandlecancelInfomust be a pointer to a validXrFutureCancelInfoEXTstructure
Thread Safety
- Access to the
futuremember of thecancelInfoparameter must be externally synchronized
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
instance- anXrInstancehandlecancelInfo- a pointer to anXrFutureCancelInfoEXTstructure.
- The
-