st/oxr: Add ENTRY_IF_VERSION_AT_LEAST to negotiate

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2194>
This commit is contained in:
Christoph Haag 2024-03-05 03:09:59 +01:00 committed by Marge Bot
parent cdbf4ef26a
commit ae7facbdc7

View file

@ -144,6 +144,19 @@ oxr_xrEnumerateApiLayerProperties(uint32_t propertyCapacityInput,
*/
#define ENTRY_IF_EXT(funcName, short_ext_name) \
ENTRY_IF(funcName, inst->extensions.short_ext_name, "Required extension XR_" #short_ext_name " not enabled")
/*!
* @brief Helper define for generating that GetInstanceProcAddr function for
* functions that have been promoted to core in some OpenXR version.
*
* Wraps ENTRY_IF for the common case.
*
* Pass the function name and the OpenXR version the function has first been available in core.
*/
#define ENTRY_IF_VERSION_AT_LEAST(funcName, major, minor) \
ENTRY_IF(funcName, (inst->openxr_version.major_minor >= XR_MAKE_VERSION(major, minor, 0)), \
("OpenXR version must be at least %d.%d.x", major, minor))
/*!
* Handle a non-null instance pointer.
*/