Commit 57c6078a authored by Jakob Bornecrantz's avatar Jakob Bornecrantz

st/oxr: Update to OpenXR 1.0

parent 08a4b40f
Pipeline #52550 passed with stages
in 1 minute and 39 seconds
This diff is collapsed.
......@@ -161,6 +161,7 @@ XrResult
oxr_xrEnumerateEnvironmentBlendModes(
XrInstance instance,
XrSystemId systemId,
XrViewConfigurationType viewConfigurationType,
uint32_t environmentBlendModeCapacityInput,
uint32_t* environmentBlendModeCountOutput,
XrEnvironmentBlendMode* environmentBlendModes);
......@@ -245,6 +246,10 @@ oxr_xrBeginFrame(XrSession session, const XrFrameBeginInfo* frameBeginInfo);
XrResult
oxr_xrEndFrame(XrSession session, const XrFrameEndInfo* frameEndInfo);
//! OpenXR API function @ep{xrRequestExitSession}
XrResult
oxr_xrRequestExitSession(XrSession session);
//! OpenXR API function @ep{xrLocateViews}
XrResult
oxr_xrLocateViews(XrSession session,
......@@ -314,7 +319,7 @@ XrResult
oxr_xrLocateSpace(XrSpace space,
XrSpace baseSpace,
XrTime time,
XrSpaceRelation* relation);
XrSpaceLocation* relation);
//! OpenXR API function @ep{xrDestroySpace}
XrResult
......@@ -424,13 +429,13 @@ oxr_xrSessionInsertDebugUtilsLabelEXT(XrSession session,
//! OpenXR API function @ep{xrCreateActionSpace}
XrResult
oxr_xrCreateActionSpace(XrAction action,
oxr_xrCreateActionSpace(XrSession session,
const XrActionSpaceCreateInfo* createInfo,
XrSpace* space);
//! OpenXR API function @ep{xrCreateActionSet}
XrResult
oxr_xrCreateActionSet(XrSession session,
oxr_xrCreateActionSet(XrInstance instance,
const XrActionSetCreateInfo* createInfo,
XrActionSet* actionSet);
......@@ -448,81 +453,81 @@ oxr_xrCreateAction(XrActionSet actionSet,
XrResult
oxr_xrDestroyAction(XrAction action);
//! OpenXR API function @ep{xrSetInteractionProfileSuggestedBindings}
//! OpenXR API function @ep{xrSuggestInteractionProfileBindings}
XrResult
oxr_xrSetInteractionProfileSuggestedBindings(
XrSession session,
oxr_xrSuggestInteractionProfileBindings(
XrInstance instance,
const XrInteractionProfileSuggestedBinding* suggestedBindings);
//! OpenXR API function @ep{xrAttachSessionActionSets}
XrResult
oxr_xrAttachSessionActionSets(XrSession session,
const XrSessionActionSetsAttachInfo* bindInfo);
//! OpenXR API function @ep{xrGetCurrentInteractionProfile}
XrResult
oxr_xrGetCurrentInteractionProfile(
XrSession session,
XrPath topLevelUserPath,
XrInteractionProfileInfo* interactionProfile);
XrInteractionProfileState* interactionProfile);
//! OpenXR API function @ep{xrGetActionStateBoolean}
XrResult
oxr_xrGetActionStateBoolean(XrAction action,
uint32_t countSubactionPaths,
const XrPath* subactionPaths,
oxr_xrGetActionStateBoolean(XrSession session,
const XrActionStateGetInfo* getInfo,
XrActionStateBoolean* data);
//! OpenXR API function @ep{xrGetActionStateVector1f}
//! OpenXR API function @ep{xrGetActionStateFloat}
XrResult
oxr_xrGetActionStateVector1f(XrAction action,
uint32_t countSubactionPaths,
const XrPath* subactionPaths,
XrActionStateVector1f* data);
oxr_xrGetActionStateFloat(XrSession session,
const XrActionStateGetInfo* getInfo,
XrActionStateFloat* data);
//! OpenXR API function @ep{xrGetActionStateVector2f}
XrResult
oxr_xrGetActionStateVector2f(XrAction action,
uint32_t countSubactionPaths,
const XrPath* subactionPaths,
oxr_xrGetActionStateVector2f(XrSession session,
const XrActionStateGetInfo* getInfo,
XrActionStateVector2f* data);
//! OpenXR API function @ep{xrGetActionStatePose}
XrResult
oxr_xrGetActionStatePose(XrAction action,
XrPath subactionPath,
oxr_xrGetActionStatePose(XrSession session,
const XrActionStateGetInfo* getInfo,
XrActionStatePose* data);
//! OpenXR API function @ep{xrSyncActionData}
//! OpenXR API function @ep{xrSyncActions}
XrResult
oxr_xrSyncActionData(XrSession session,
uint32_t countActionSets,
const XrActiveActionSet* actionSets);
oxr_xrSyncActions(XrSession session, const XrActionsSyncInfo* syncInfo);
//! OpenXR API function @ep{xrGetBoundSourcesForAction}
//! OpenXR API function @ep{xrEnumerateBoundSourcesForAction}
XrResult
oxr_xrGetBoundSourcesForAction(XrAction action,
uint32_t sourceCapacityInput,
uint32_t* sourceCountOutput,
XrPath* sources);
oxr_xrEnumerateBoundSourcesForAction(
XrSession session,
const XrBoundSourcesForActionEnumerateInfo* enumerateInfo,
uint32_t sourceCapacityInput,
uint32_t* sourceCountOutput,
XrPath* sources);
//! OpenXR API function @ep{xrGetInputSourceLocalizedName}
XrResult
oxr_xrGetInputSourceLocalizedName(
XrSession session,
XrPath source,
XrInputSourceLocalizedNameFlags whichComponents,
const XrInputSourceLocalizedNameGetInfo* getInfo,
uint32_t bufferCapacityInput,
uint32_t* bufferCountOutput,
char* buffer);
//! OpenXR API function @ep{xrApplyHapticFeedback}
XrResult
oxr_xrApplyHapticFeedback(XrAction hapticAction,
uint32_t countSubactionPaths,
const XrPath* subactionPaths,
const XrHapticBaseHeader* hapticEvent);
oxr_xrApplyHapticFeedback(XrSession session,
const XrHapticActionInfo* hapticActionInfo,
const XrHapticBaseHeader* hapticFeedback);
//! OpenXR API function @ep{xrStopHapticFeedback}
XrResult
oxr_xrStopHapticFeedback(XrAction hapticAction,
uint32_t countSubactionPaths,
const XrPath* subactionPaths);
oxr_xrStopHapticFeedback(XrSession session,
const XrHapticActionInfo* hapticActionInfo);
/*!
* @}
......
......@@ -34,8 +34,10 @@ static const XrExtensionProperties extension_properties[] = {
{XR_TYPE_EXTENSION_PROPERTIES, NULL, XR_KHR_VULKAN_ENABLE_EXTENSION_NAME,
XR_KHR_vulkan_enable_SPEC_VERSION},
#endif
{XR_TYPE_EXTENSION_PROPERTIES, NULL, XR_KHR_HEADLESS_EXTENSION_NAME,
XR_KHR_headless_SPEC_VERSION},
#if XR_MND_headless
{XR_TYPE_EXTENSION_PROPERTIES, NULL, XR_MND_HEADLESS_EXTENSION_NAME,
XR_MND_headless_SPEC_VERSION},
#endif
#ifdef XR_USE_TIMESPEC
{XR_TYPE_EXTENSION_PROPERTIES, NULL,
XR_KHR_CONVERT_TIMESPEC_TIME_EXTENSION_NAME,
......
......@@ -162,6 +162,7 @@ handle_none_null(struct oxr_logger* log,
ENTRY_ELSE_IF(xrWaitFrame)
ENTRY_ELSE_IF(xrBeginFrame)
ENTRY_ELSE_IF(xrEndFrame)
ENTRY_ELSE_IF(xrRequestExitSession)
ENTRY_ELSE_IF(xrLocateViews)
ENTRY_ELSE_IF(xrStringToPath)
ENTRY_ELSE_IF(xrPathToString)
......@@ -169,14 +170,15 @@ handle_none_null(struct oxr_logger* log,
ENTRY_ELSE_IF(xrDestroyActionSet)
ENTRY_ELSE_IF(xrCreateAction)
ENTRY_ELSE_IF(xrDestroyAction)
ENTRY_ELSE_IF(xrSetInteractionProfileSuggestedBindings)
ENTRY_ELSE_IF(xrSuggestInteractionProfileBindings)
ENTRY_ELSE_IF(xrAttachSessionActionSets)
ENTRY_ELSE_IF(xrGetCurrentInteractionProfile)
ENTRY_ELSE_IF(xrGetActionStateBoolean)
ENTRY_ELSE_IF(xrGetActionStateVector1f)
ENTRY_ELSE_IF(xrGetActionStateFloat)
ENTRY_ELSE_IF(xrGetActionStateVector2f)
ENTRY_ELSE_IF(xrGetActionStatePose)
ENTRY_ELSE_IF(xrSyncActionData)
ENTRY_ELSE_IF(xrGetBoundSourcesForAction)
ENTRY_ELSE_IF(xrSyncActions)
ENTRY_ELSE_IF(xrEnumerateBoundSourcesForAction)
ENTRY_ELSE_IF(xrGetInputSourceLocalizedName)
ENTRY_ELSE_IF(xrApplyHapticFeedback)
ENTRY_ELSE_IF(xrStopHapticFeedback)
......
......@@ -129,6 +129,17 @@ oxr_xrEndFrame(XrSession session, const XrFrameEndInfo* frameEndInfo)
return oxr_session_frame_end(&log, sess, frameEndInfo);
}
XrResult
oxr_xrRequestExitSession(XrSession session)
{
struct oxr_session* sess;
struct oxr_logger log;
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess,
"xrRequestExitSession");
return oxr_error(&log, XR_ERROR_HANDLE_INVALID, " not implemented");
}
XrResult
oxr_xrLocateViews(XrSession session,
const XrViewLocateInfo* viewLocateInfo,
......
......@@ -25,20 +25,23 @@
XrResult
oxr_xrCreateActionSpace(XrAction action,
oxr_xrCreateActionSpace(XrSession session,
const XrActionSpaceCreateInfo* createInfo,
XrSpace* space)
{
struct oxr_session* sess;
struct oxr_action* act;
struct oxr_logger log;
OXR_VERIFY_ACTION_AND_INIT_LOG(&log, action, act,
"xrCreateActionSpace");
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess,
"xrCreateActionSpace");
OXR_VERIFY_ARG_TYPE_AND_NULL(&log, createInfo,
XR_TYPE_ACTION_SPACE_CREATE_INFO);
OXR_VERIFY_POSE(&log, createInfo->poseInActionSpace);
OXR_VERIFY_ACTION_NOT_NULL(&log, createInfo->action, act);
struct oxr_space* spc;
XrResult ret = oxr_space_action_create(&log, act, createInfo, &spc);
XrResult ret =
oxr_space_action_create(&log, sess, act->key, createInfo, &spc);
if (ret != XR_SUCCESS) {
return ret;
}
......@@ -113,16 +116,16 @@ XrResult
oxr_xrLocateSpace(XrSpace space,
XrSpace baseSpace,
XrTime time,
XrSpaceRelation* relation)
XrSpaceLocation* location)
{
struct oxr_space* spc;
struct oxr_space* baseSpc;
struct oxr_logger log;
OXR_VERIFY_SPACE_AND_INIT_LOG(&log, space, spc, "xrLocateSpace");
OXR_VERIFY_SPACE_NOT_NULL(&log, baseSpace, baseSpc);
OXR_VERIFY_ARG_NOT_NULL(&log, relation);
OXR_VERIFY_ARG_TYPE_AND_NULL(&log, location, XR_TYPE_SPACE_LOCATION);
return oxr_space_locate(&log, spc, baseSpc, time, relation);
return oxr_space_locate(&log, spc, baseSpc, time, location);
}
XrResult
......
......@@ -103,6 +103,7 @@ XrResult
oxr_xrEnumerateEnvironmentBlendModes(
XrInstance instance,
XrSystemId systemId,
XrViewConfigurationType viewConfigurationType,
uint32_t environmentBlendModeCapacityInput,
uint32_t* environmentBlendModeCountOutput,
XrEnvironmentBlendMode* environmentBlendModes)
......@@ -114,7 +115,7 @@ oxr_xrEnumerateEnvironmentBlendModes(
OXR_VERIFY_SYSTEM_AND_GET(&log, inst, systemId, sys);
return oxr_system_enumerate_blend_modes(
&log, sys, environmentBlendModeCapacityInput,
&log, sys, viewConfigurationType, environmentBlendModeCapacityInput,
environmentBlendModeCountOutput, environmentBlendModes);
}
......
......@@ -67,11 +67,11 @@ extern "C" {
#define OXR_VERIFY_SPACE_AND_INIT_LOG(log, thing, new_thing, name) \
_OXR_VERIFY_AND_SET_AND_INIT(log, thing, new_thing, SPACE, name, new_thing->sess->sys->inst)
#define OXR_VERIFY_ACTION_AND_INIT_LOG(log, thing, new_thing, name) \
_OXR_VERIFY_AND_SET_AND_INIT(log, thing, new_thing, ACTION, name, new_thing->act_set->sess->sys->inst)
_OXR_VERIFY_AND_SET_AND_INIT(log, thing, new_thing, ACTION, name, new_thing->act_set->inst)
#define OXR_VERIFY_SWAPCHAIN_AND_INIT_LOG(log, thing, new_thing, name) \
_OXR_VERIFY_AND_SET_AND_INIT(log, thing, new_thing, SWAPCHAIN, name, new_thing->sess->sys->inst)
#define OXR_VERIFY_ACTIONSET_AND_INIT_LOG(log, thing, new_thing, name) \
_OXR_VERIFY_AND_SET_AND_INIT(log, thing, new_thing, ACTIONSET, name, new_thing->sess->sys->inst)
_OXR_VERIFY_AND_SET_AND_INIT(log, thing, new_thing, ACTIONSET, name, new_thing->inst)
#define OXR_VERIFY_INSTANCE_NOT_NULL(log, arg, new_arg) _OXR_VERIFY_SET(log, arg, new_arg, INSTANCE);
#define OXR_VERIFY_MESSENGER_NOT_NULL(log, arg, new_arg) _OXR_VERIFY_SET(log, arg, new_arg, MESSENGER);
......
......@@ -109,7 +109,7 @@ oxr_action_set_destroy_cb(struct oxr_logger* log, struct oxr_handle_base* hb)
XrResult
oxr_action_set_create(struct oxr_logger* log,
struct oxr_session* sess,
struct oxr_instance* inst,
const XrActionSetCreateInfo* createInfo,
struct oxr_action_set** out_act_set)
{
......@@ -119,11 +119,11 @@ oxr_action_set_create(struct oxr_logger* log,
//! @todo Implement more fully.
struct oxr_action_set* act_set = NULL;
OXR_ALLOCATE_HANDLE_OR_RETURN(log, act_set, OXR_XR_DEBUG_ACTIONSET,
oxr_action_set_destroy_cb, &sess->handle);
oxr_action_set_destroy_cb, &inst->handle);
act_set->key = key_gen++;
act_set->generation = 1;
act_set->sess = sess;
act_set->inst = inst;
*out_act_set = act_set;
......@@ -158,7 +158,7 @@ oxr_action_create(struct oxr_logger* log,
const XrActionCreateInfo* createInfo,
struct oxr_action** out_act)
{
struct oxr_instance* inst = act_set->sess->sys->inst;
struct oxr_instance* inst = act_set->inst;
struct oxr_sub_paths sub_paths = {0};
// Mod music for all!
......@@ -307,7 +307,7 @@ MEGA_HACK_get_binding(struct oxr_logger* log,
default: break;
}
if (strcmp(act->name, "grip_object") == 0) {
if (strcmp(act->name, "grab_object") == 0) {
oxr_xdev_find_input(xdev, XRT_INPUT_PSMV_TRIGGER_VALUE,
&input) ||
oxr_xdev_find_input(xdev, XRT_INPUT_HYDRA_TRIGGER_VALUE,
......@@ -316,6 +316,8 @@ MEGA_HACK_get_binding(struct oxr_logger* log,
oxr_xdev_find_input(xdev, XRT_INPUT_PSMV_BODY_CENTER_POSE,
&input) ||
oxr_xdev_find_input(xdev, XRT_INPUT_HYDRA_POSE, &input);
} else if (strcmp(act->name, "quit_session") == 0) {
oxr_xdev_find_input(xdev, XRT_INPUT_PSMV_PS_CLICK, &input);
} else if (strcmp(act->name, "vibrate_hand") == 0) {
oxr_xdev_find_output(
xdev, XRT_OUTPUT_NAME_PSMV_RUMBLE_VIBRATION, &output);
......@@ -354,10 +356,10 @@ oxr_source_set_destroy_cb(struct oxr_logger* log, struct oxr_handle_base* hb)
static XrResult
oxr_source_set_create(struct oxr_logger* log,
struct oxr_session* sess,
struct oxr_action_set* act_set,
struct oxr_source_set** out_src_set)
{
struct oxr_session* sess = act_set->sess;
struct oxr_source_set* src_set = NULL;
OXR_ALLOCATE_HANDLE_OR_RETURN(log, src_set, OXR_XR_DEBUG_SOURCESET,
oxr_source_set_destroy_cb, &sess->handle);
......@@ -636,6 +638,15 @@ oxr_session_destroy_all_sources(struct oxr_logger* log,
}
}
XrResult
oxr_session_attach_action_sets(struct oxr_logger* log,
struct oxr_session* sess,
const XrSessionActionSetsAttachInfo* bindInfo)
{
//! @todo not implementeds
return XR_SUCCESS;
}
XrResult
oxr_action_sync_data(struct oxr_logger* log,
struct oxr_session* sess,
......@@ -663,7 +674,7 @@ oxr_action_sync_data(struct oxr_logger* log,
// current action set generation, that's okay since we will
// be creating the sources for the actions below.
if (src_set == NULL) {
oxr_source_set_create(log, act_set, &src_set);
oxr_source_set_create(log, sess, act_set, &src_set);
continue;
}
......@@ -707,13 +718,12 @@ oxr_action_sync_data(struct oxr_logger* log,
}
XrResult
oxr_action_set_interaction_profile_suggested_bindings(
oxr_action_suggest_interaction_profile_bindings(
struct oxr_logger* log,
struct oxr_session* sess,
struct oxr_instance* inst,
const XrInteractionProfileSuggestedBinding* suggestedBindings)
{
//! @todo Implement
struct oxr_instance* inst = sess->sys->inst;
const char* str;
size_t length;
......@@ -748,7 +758,7 @@ oxr_action_get_current_interaction_profile(
struct oxr_logger* log,
struct oxr_session* sess,
XrPath topLevelUserPath,
XrInteractionProfileInfo* interactionProfile)
XrInteractionProfileState* interactionProfile)
{
//! @todo Implement
return oxr_error(log, XR_ERROR_HANDLE_INVALID, " not implemented");
......@@ -758,8 +768,7 @@ XrResult
oxr_action_get_input_source_localized_name(
struct oxr_logger* log,
struct oxr_session* sess,
XrPath source,
XrInputSourceLocalizedNameFlags whichComponents,
const XrInputSourceLocalizedNameGetInfo* getInfo,
uint32_t bufferCapacityInput,
uint32_t* bufferCountOutput,
char* buffer)
......@@ -796,7 +805,7 @@ get_state_from_state_bool(struct oxr_source_state* state,
static void
get_state_from_state_vec1(struct oxr_source_state* state,
XrActionStateVector1f* data)
XrActionStateFloat* data)
{
data->currentState = state->vec1.x;
data->lastChangeTime = state->timestamp;
......@@ -859,14 +868,14 @@ get_state_from_state_vec2(struct oxr_source_state* state,
XrResult
oxr_action_get_boolean(struct oxr_logger* log,
struct oxr_action* act,
struct oxr_session* sess,
uint64_t key,
struct oxr_sub_paths sub_paths,
XrActionStateBoolean* data)
{
struct oxr_session* sess = act->act_set->sess;
struct oxr_source* src = NULL;
oxr_session_get_source(sess, act->key, &src);
oxr_session_get_source(sess, key, &src);
data->isActive = XR_FALSE;
U_ZERO(&data->currentState);
......@@ -888,14 +897,14 @@ oxr_action_get_boolean(struct oxr_logger* log,
XrResult
oxr_action_get_vector1f(struct oxr_logger* log,
struct oxr_action* act,
struct oxr_session* sess,
uint64_t key,
struct oxr_sub_paths sub_paths,
XrActionStateVector1f* data)
XrActionStateFloat* data)
{
struct oxr_session* sess = act->act_set->sess;
struct oxr_source* src = NULL;
oxr_session_get_source(sess, act->key, &src);
oxr_session_get_source(sess, key, &src);
data->isActive = XR_FALSE;
U_ZERO(&data->currentState);
......@@ -917,14 +926,14 @@ oxr_action_get_vector1f(struct oxr_logger* log,
XrResult
oxr_action_get_vector2f(struct oxr_logger* log,
struct oxr_action* act,
struct oxr_session* sess,
uint64_t key,
struct oxr_sub_paths sub_paths,
XrActionStateVector2f* data)
{
struct oxr_session* sess = act->act_set->sess;
struct oxr_source* src = NULL;
oxr_session_get_source(sess, act->key, &src);
oxr_session_get_source(sess, key, &src);
data->isActive = XR_FALSE;
U_ZERO(&data->currentState);
......@@ -946,14 +955,14 @@ oxr_action_get_vector2f(struct oxr_logger* log,
XrResult
oxr_action_get_pose(struct oxr_logger* log,
struct oxr_action* act,
struct oxr_session* sess,
uint64_t key,
struct oxr_sub_paths sub_paths,
XrActionStatePose* data)
{
struct oxr_session* sess = act->act_set->sess;
struct oxr_source* src = NULL;
oxr_session_get_source(sess, act->key, &src);
oxr_session_get_source(sess, key, &src);
data->isActive = XR_FALSE;
......@@ -982,7 +991,8 @@ oxr_action_get_pose(struct oxr_logger* log,
XrResult
oxr_action_get_bound_sources(struct oxr_logger* log,
struct oxr_action* act,
struct oxr_session* sess,
uint64_t key,
uint32_t sourceCapacityInput,
uint32_t* sourceCountOutput,
XrPath* sources)
......@@ -1019,21 +1029,18 @@ set_source_output_vibration(struct oxr_session* sess,
}
}
XrResult
oxr_action_apply_haptic_feedback(struct oxr_logger* log,
struct oxr_action* act,
uint32_t countSubactionPaths,
const XrPath* subactionPaths,
struct oxr_session* sess,
uint64_t key,
struct oxr_sub_paths sub_paths,
const XrHapticBaseHeader* hapticEvent)
{
struct oxr_session* sess = act->act_set->sess;
struct oxr_source* src = NULL;
struct oxr_sub_paths sub_paths = {0};
oxr_classify_sub_action_paths(log, sess->sys->inst, countSubactionPaths,
subactionPaths, &sub_paths);
oxr_session_get_source(sess, act->key, &src);
oxr_session_get_source(sess, key, &src);
if (src == NULL) {
return XR_SUCCESS;
......@@ -1067,18 +1074,13 @@ oxr_action_apply_haptic_feedback(struct oxr_logger* log,
XrResult
oxr_action_stop_haptic_feedback(struct oxr_logger* log,
struct oxr_action* act,
uint32_t countSubactionPaths,
const XrPath* subactionPaths)
struct oxr_session* sess,
uint64_t key,
struct oxr_sub_paths sub_paths)
{
struct oxr_session* sess = act->act_set->sess;
struct oxr_source* src = NULL;
struct oxr_sub_paths sub_paths = {0};
oxr_classify_sub_action_paths(log, sess->sys->inst, countSubactionPaths,
subactionPaths, &sub_paths);
oxr_session_get_source(sess, act->key, &src);
oxr_session_get_source(sess, key, &src);
if (src == NULL) {
return XR_SUCCESS;
......
......@@ -178,16 +178,24 @@ oxr_instance_create(struct oxr_logger *log,
inst->opengl_enable = false;
inst->vulkan_enable = false;
for (uint32_t i = 0; i < createInfo->enabledExtensionCount; ++i) {
#if XR_MND_headless
if (strcmp(createInfo->enabledExtensionNames[i],
XR_KHR_HEADLESS_EXTENSION_NAME) == 0) {
XR_MND_HEADLESS_EXTENSION_NAME) == 0) {
inst->headless = true;
} else if (strcmp(createInfo->enabledExtensionNames[i],
XR_KHR_OPENGL_ENABLE_EXTENSION_NAME) == 0) {
}
#endif
#if XR_KHR_opengl_enable
if (strcmp(createInfo->enabledExtensionNames[i],
XR_KHR_OPENGL_ENABLE_EXTENSION_NAME) == 0) {
inst->opengl_enable = true;
} else if (strcmp(createInfo->enabledExtensionNames[i],
XR_KHR_VULKAN_ENABLE_EXTENSION_NAME) == 0) {
}
#endif
#if XR_KHR_vulkan_enable
if (strcmp(createInfo->enabledExtensionNames[i],
XR_KHR_VULKAN_ENABLE_EXTENSION_NAME) == 0) {
inst->vulkan_enable = true;
}
#endif
}
//! @todo check if this (and other creates) failed?
......
......@@ -16,6 +16,8 @@
#include "oxr_objects.h"
#include "oxr_logger.h"
#include "openxr_includes/openxr_reflection.h"
DEBUG_GET_ONCE_BOOL_OPTION(entrypoints, "OXR_DEBUG_ENTRYPOINTS", false)
DEBUG_GET_ONCE_BOOL_OPTION(break_on_error, "OXR_BREAK_ON_ERROR", false)
......@@ -107,59 +109,12 @@ oxr_result_to_string(XrResult result)
{
// clang-format off
switch (result) {
case XR_SUCCESS: return "XR_SUCCESS";
case XR_TIMEOUT_EXPIRED: return "XR_TIMEOUT_EXPIRED";
case XR_SESSION_VISIBILITY_UNAVAILABLE: return "XR_SESSION_VISIBILITY_UNAVAILABLE";
case XR_SESSION_LOSS_PENDING: return "XR_SESSION_LOSS_PENDING";
case XR_EVENT_UNAVAILABLE: return "XR_EVENT_UNAVAILABLE";
case XR_STATE_UNAVAILABLE: return "XR_STATE_UNAVAILABLE";
case XR_STATE_TYPE_UNAVAILABLE: return "XR_STATE_TYPE_UNAVAILABLE";
case XR_SPACE_BOUNDS_UNAVAILABLE: return "XR_SPACE_BOUNDS_UNAVAILABLE";
case XR_SESSION_NOT_FOCUSED: return "XR_SESSION_NOT_FOCUSED";
case XR_FRAME_DISCARDED: return "XR_FRAME_DISCARDED";
case XR_ERROR_VALIDATION_FAILURE: return "XR_ERROR_VALIDATION_FAILURE";
case XR_ERROR_RUNTIME_FAILURE: return "XR_ERROR_RUNTIME_FAILURE";
case XR_ERROR_OUT_OF_MEMORY: return "XR_ERROR_OUT_OF_MEMORY";
case XR_ERROR_RUNTIME_VERSION_INCOMPATIBLE: return "XR_ERROR_RUNTIME_VERSION_INCOMPATIBLE";
case XR_ERROR_DRIVER_INCOMPATIBLE: return "XR_ERROR_DRIVER_INCOMPATIBLE";
case XR_ERROR_INITIALIZATION_FAILED: return "XR_ERROR_INITIALIZATION_FAILED";
case XR_ERROR_FUNCTION_UNSUPPORTED: return "XR_ERROR_FUNCTION_UNSUPPORTED";
case XR_ERROR_FEATURE_UNSUPPORTED: return "XR_ERROR_FEATURE_UNSUPPORTED";
case XR_ERROR_EXTENSION_NOT_PRESENT: return "XR_ERROR_EXTENSION_NOT_PRESENT";
case XR_ERROR_LIMIT_REACHED: return "XR_ERROR_LIMIT_REACHED";
case XR_ERROR_SIZE_INSUFFICIENT: return "XR_ERROR_SIZE_INSUFFICIENT";
case XR_ERROR_HANDLE_INVALID: return "XR_ERROR_HANDLE_INVALID";
case XR_ERROR_INSTANCE_LOST: return "XR_ERROR_INSTANCE_LOST";
case XR_ERROR_SESSION_RUNNING: return "XR_ERROR_SESSION_RUNNING";
case XR_ERROR_SESSION_NOT_RUNNING: return "XR_ERROR_SESSION_NOT_RUNNING";
case XR_ERROR_SESSION_LOST: return "XR_ERROR_SESSION_LOST";
case XR_ERROR_SYSTEM_INVALID: return "XR_ERROR_SYSTEM_INVALID";
case XR_ERROR_PATH_INVALID: return "XR_ERROR_PATH_INVALID";
case XR_ERROR_PATH_COUNT_EXCEEDED: return "XR_ERROR_PATH_COUNT_EXCEEDED";
case XR_ERROR_PATH_FORMAT_INVALID: return "XR_ERROR_PATH_FORMAT_INVALID";
case XR_ERROR_LAYER_INVALID: return "XR_ERROR_LAYER_INVALID";
case XR_ERROR_LAYER_LIMIT_EXCEEDED: return "XR_ERROR_LAYER_LIMIT_EXCEEDED";
case XR_ERROR_SWAPCHAIN_RECT_INVALID: return "XR_ERROR_SWAPCHAIN_RECT_INVALID";
case XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED: return "XR_ERROR_SWAPCHAIN_FORMAT_UNSUPPORTED";
case XR_ERROR_ACTION_TYPE_MISMATCH: return "XR_ERROR_ACTION_TYPE_MISMATCH";
case XR_ERROR_REFERENCE_SPACE_UNSUPPORTED: return "XR_ERROR_REFERENCE_SPACE_UNSUPPORTED";
case XR_ERROR_FILE_ACCESS_ERROR: return "XR_ERROR_FILE_ACCESS_ERROR";
case XR_ERROR_FILE_CONTENTS_INVALID: return "XR_ERROR_FILE_CONTENTS_INVALID";
case XR_ERROR_FORM_FACTOR_UNSUPPORTED: return "XR_ERROR_FORM_FACTOR_UNSUPPORTED";
case XR_ERROR_FORM_FACTOR_UNAVAILABLE: return "XR_ERROR_FORM_FACTOR_UNAVAILABLE";
case XR_ERROR_API_LAYER_NOT_PRESENT: return "XR_ERROR_API_LAYER_NOT_PRESENT";
case XR_ERROR_CALL_ORDER_INVALID: return "XR_ERROR_CALL_ORDER_INVALID";
case XR_ERROR_GRAPHICS_DEVICE_INVALID: return "XR_ERROR_GRAPHICS_DEVICE_INVALID";
case XR_ERROR_POSE_INVALID: return "XR_ERROR_POSE_INVALID";
case XR_ERROR_INDEX_OUT_OF_RANGE: return "XR_ERROR_INDEX_OUT_OF_RANGE";
case XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED: return "XR_ERROR_VIEW_CONFIGURATION_TYPE_UNSUPPORTED";
case XR_ERROR_ENVIRONMENT_BLEND_MODE_UNSUPPORTED: return "XR_ERROR_ENVIRONMENT_BLEND_MODE_UNSUPPORTED";
case XR_ERROR_BINDINGS_DUPLICATED: return "XR_ERROR_BINDINGS_DUPLICATED";
case XR_ERROR_NAME_DUPLICATED: return "XR_ERROR_NAME_DUPLICATED";
case XR_ERROR_NAME_INVALID: return "XR_ERROR_NAME_INVALID";
case XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR: return "XR_ERROR_ANDROID_THREAD_SETTINGS_ID_INVALID_KHR";
case XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR: return "XR_ERROR_ANDROID_THREAD_SETTINGS_FAILURE_KHR";
case XR_ERROR_DEBUG_UTILS_MESSENGER_INVALID_EXT: return "XR_ERROR_DEBUG_UTILS_MESSENGER_INVALID_EXT";
#define ENTRY(NAME, VALUE) \
case VALUE: return #NAME;
XR_LIST_ENUM_XrResult(ENTRY)
#undef ENTRY
default: return "<UNKNOWN>";
}
// clang-format on
......
......@@ -252,7 +252,7 @@ oxr_action_set_to_openxr(struct oxr_action_set *act_set)
XrResult
oxr_action_set_create(struct oxr_logger *log,
struct oxr_session *sess,
struct oxr_instance *inst,
const XrActionSetCreateInfo *createInfo,
struct oxr_action_set **out_act_set);
......@@ -271,6 +271,11 @@ oxr_action_create(struct oxr_logger *log,
const XrActionCreateInfo *createInfo,
struct oxr_action **out_act);
XrResult
oxr_session_attach_action_sets(struct oxr_logger *log,
struct oxr_session *sess,
const XrSessionActionSetsAttachInfo *bindInfo);
XrResult
oxr_action_sync_data(struct oxr_logger *log,
struct oxr_session *sess,
......@@ -278,9 +283,9 @@ oxr_action_sync_data(struct oxr_logger *log,
const XrActiveActionSet *actionSets);
XrResult
oxr_action_set_interaction_profile_suggested_bindings(
oxr_action_suggest_interaction_profile_bindings(
struct oxr_logger *log,
struct oxr_session *sess,
struct oxr_instance *inst,
const XrInteractionProfileSuggestedBinding *suggestedBindings);
XrResult
......@@ -288,61 +293,66 @@ oxr_action_get_current_interaction_profile(
struct oxr_logger *log,
struct oxr_session *sess,
XrPath topLevelUserPath,
XrInteractionProfileInfo *interactionProfile);
XrInteractionProfileState *interactionProfile);
XrResult
oxr_action_get_input_source_localized_name(
struct oxr_logger *log,
struct oxr_session *sess,
XrPath source,
XrInputSourceLocalizedNameFlags whichComponents,
const XrInputSourceLocalizedNameGetInfo *getInfo,
uint32_t bufferCapacityInput,
uint32_t *bufferCountOutput,
char *buffer);
XrResult
oxr_action_get_boolean(struct oxr_logger *log,
struct oxr_action *act,