Monado OpenXR Runtime
Macros | Functions
oxr_api_negotiate.c File Reference

File for negotiating with the loader. More...

#include <stdio.h>
#include <string.h>
#include "xrt/xrt_compiler.h"
#include "util/u_debug.h"
#include "oxr_objects.h"
#include "oxr_logger.h"
#include "oxr_api_funcs.h"
#include "oxr_api_verify.h"
Include dependency graph for oxr_api_negotiate.c:

Macros

#define PRINT_NEGOTIATE(...)
 
#define ENTRY(funcName)
 Helper define for generating that GetInstanceProcAddr function. More...
 
#define ENTRY_IF(funcName, extraCondition, message)
 Helper define for generating that GetInstanceProcAddr function for conditionally-available functions. More...
 
#define ENTRY_IF_EXT(funcName, short_ext_name)
 Helper define for generating that GetInstanceProcAddr function for extension-provided functions. More...
 

Functions

XrResult xrNegotiateLoaderRuntimeInterface (const XrNegotiateLoaderInfo *loaderInfo, XrNegotiateRuntimeRequest *runtimeRequest)
 
XrResult oxr_xrEnumerateApiLayerProperties (uint32_t propertyCapacityInput, uint32_t *propertyCountOutput, XrApiLayerProperties *properties)
 OpenXR API function xrEnumerateApiLayerProperties. More...
 
XrResult oxr_xrGetInstanceProcAddr (XrInstance instance, const char *name, PFN_xrVoidFunction *function)
 OpenXR API function xrGetInstanceProcAddr. More...
 

Detailed Description

File for negotiating with the loader.

Author
Ryan Pavlik ryan..nosp@m.pavl.nosp@m.ik@co.nosp@m.llab.nosp@m.ora.c.nosp@m.om
Jakob Bornecrantz jakob.nosp@m.@col.nosp@m.labor.nosp@m.a.co.nosp@m.m

Macro Definition Documentation

◆ ENTRY

#define ENTRY (   funcName)
Value:
do { \
if (strcmp(name, #funcName) == 0) { \
PFN_##funcName ret = &oxr_##funcName; \
*out_function = (PFN_xrVoidFunction)(ret); \
return XR_SUCCESS; \
} \
} while (false)

Helper define for generating that GetInstanceProcAddr function.

Use for functions that should be unconditionally available.

◆ ENTRY_IF

#define ENTRY_IF (   funcName,
  extraCondition,
  message 
)
Value:
do { \
if (strcmp(name, #funcName) == 0) { \
if (extraCondition) { \
PFN_##funcName ret = &oxr_##funcName; \
*out_function = (PFN_xrVoidFunction)(ret); \
return XR_SUCCESS; \
} \
return XR_ERROR_FUNCTION_UNSUPPORTED; \
} \
} while (false)

Helper define for generating that GetInstanceProcAddr function for conditionally-available functions.

Checks the extra condition to e.g. find out if the extension is enabled

◆ ENTRY_IF_EXT

#define ENTRY_IF_EXT (   funcName,
  short_ext_name 
)
Value:
ENTRY_IF(funcName, inst->extensions.short_ext_name, \
"Required extension XR_" #short_ext_name " not enabled")
#define ENTRY_IF(funcName, extraCondition, message)
Helper define for generating that GetInstanceProcAddr function for conditionally-available functions...
Definition: oxr_api_negotiate.c:121

Helper define for generating that GetInstanceProcAddr function for extension-provided functions.

Wraps ENTRY_IF for the common case.

Pass the function name and the (mixed-case) extension name without the leading XR_.

◆ PRINT_NEGOTIATE

#define PRINT_NEGOTIATE (   ...)
Value:
do { \
if (debug_get_bool_option_negotiate()) { \
fprintf(stderr, __VA_ARGS__); \
} \
} while (false)