C Specification

The xrNegotiateLoaderApiLayerInterface function is defined as:

// Provided by XR_LOADER_VERSION_1_0
XrResult xrNegotiateLoaderApiLayerInterface(
    const XrNegotiateLoaderInfo*                loaderInfo,
    const char*                                 layerName,
    XrNegotiateApiLayerRequest*                 apiLayerRequest);

Parameters

Parameter Descriptions
  • loaderInfo must be a pointer to a valid XrNegotiateLoaderInfo structure.

  • layerName must be NULL or a valid C-style NULL-terminated string listing the name of an API layer which the loader is attempting to negotiate with.

  • apiLayerRequest must be a valid pointer to an XrNegotiateApiLayerRequest structure, with minimal initialization, as subsequently described, to be fully populated by the called API layer.

Description

xrNegotiateLoaderApiLayerInterface should be directly exported by an API layer so that using e.g. GetProcAddress on Windows or dlsym on POSIX platforms returns a valid function pointer to it.

The API layer must return XR_ERROR_INITIALIZATION_FAILED if any of the following conditions on loaderInfo are true:

The API layer must also return XR_ERROR_INITIALIZATION_FAILED if any of the following conditions on apiLayerRequest are true:

The API layer must determine if it supports the loader’s request. The API layer does not support the loader’s request if either of the following is true:

The API layer must return XR_ERROR_INITIALIZATION_FAILED if it does not support the loader’s request.

The API layer must set the XrNegotiateApiLayerRequest::layerInterfaceVersion with the API layer interface version it desires to support. The XrNegotiateApiLayerRequest::layerInterfaceVersion set must be between XrNegotiateLoaderInfo::minInterfaceVersion and XrNegotiateLoaderInfo::maxInterfaceVersion.

The API layer must set the XrNegotiateApiLayerRequest::layerApiVersion with the API version of OpenXR it will execute under. The XrNegotiateApiLayerRequest::layerApiVersion set must be between XrNegotiateLoaderInfo::minApiVersion and XrNegotiateLoaderInfo::maxApiVersion.

The API layer must set the XrNegotiateApiLayerRequest::getInstanceProcAddr with a valid function pointer for the loader to use to query function pointers to the remaining OpenXR functions supported by the API layer.

The API layer must set the XrNegotiateApiLayerRequest::createApiLayerInstance with a valid function pointer to an implementation of xrCreateApiLayerInstance for the loader to use to create the instance through the API layer call chain.

If the function succeeds, the API layer must return XR_SUCCESS.

The API layer must not call into another API layer from its implementation of the xrNegotiateLoaderApiLayerInterface function. The loader must handle all API layer negotiations with each API layer individually.

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

On failure, this command returns
  • XR_ERROR_INITIALIZATION_FAILED

See Also

Document Notes

For more information, see the OpenXR Specification

This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2024, The Khronos Group Inc.