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
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:
-
XrNegotiateLoaderInfo::
structType
is notXR_LOADER_INTERFACE_STRUCT_LOADER_INFO
-
XrNegotiateLoaderInfo::
structVersion
is not XR_LOADER_INFO_STRUCT_VERSION -
XrNegotiateLoaderInfo::
structSize
is notsizeof(XrNegotiateLoaderInfo)
The API layer must also return XR_ERROR_INITIALIZATION_FAILED
if any
of the following conditions on apiLayerRequest
are true:
-
XrNegotiateApiLayerRequest::
structType
is notXR_LOADER_INTERFACE_STRUCT_API_LAYER_REQUEST
-
XrNegotiateApiLayerRequest::
structVersion
is not XR_API_LAYER_INFO_STRUCT_VERSION -
XrNegotiateApiLayerRequest::
structSize
is notsizeof(XrNegotiateApiLayerRequest)
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 does not support the interface versions supported by the loader as specified by the parameters XrNegotiateLoaderInfo::
minInterfaceVersion
and XrNegotiateLoaderInfo::maxInterfaceVersion
-
the API layer does not support the API versions supported by the loader as specified by the parameters XrNegotiateLoaderInfo::
minApiVersion
and XrNegotiateLoaderInfo::maxApiVersion
.
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.
Document Notes
For more information, see the OpenXR Specification
This page is extracted from the OpenXR Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright 2014-2024, The Khronos Group Inc.
This work is licensed under a Creative Commons Attribution 4.0 International License.