mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-31 19:08:30 +00:00
st/oxr: Add verification of XrHandJointVelocitiesEXT
This commit is contained in:
parent
f5ef3985ba
commit
191fe7a59f
|
@ -23,7 +23,7 @@
|
||||||
#include "oxr_api_funcs.h"
|
#include "oxr_api_funcs.h"
|
||||||
#include "oxr_api_verify.h"
|
#include "oxr_api_verify.h"
|
||||||
#include "oxr_handle.h"
|
#include "oxr_handle.h"
|
||||||
|
#include "oxr_chain.h"
|
||||||
|
|
||||||
XrResult
|
XrResult
|
||||||
oxr_xrCreateSession(XrInstance instance,
|
oxr_xrCreateSession(XrInstance instance,
|
||||||
|
@ -380,6 +380,29 @@ oxr_xrLocateHandJointsEXT(XrHandTrackerEXT handTracker,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
XrHandJointVelocitiesEXT *vel = OXR_GET_OUTPUT_FROM_CHAIN(
|
||||||
|
locations, XR_TYPE_HAND_JOINT_VELOCITIES_EXT,
|
||||||
|
XrHandJointVelocitiesEXT);
|
||||||
|
if (vel) {
|
||||||
|
if (vel->jointCount <= 0) {
|
||||||
|
return oxr_error(&log, XR_ERROR_VALIDATION_FAILURE,
|
||||||
|
"XrHandJointVelocitiesEXT joint count "
|
||||||
|
"must be >0, is %d\n",
|
||||||
|
vel->jointCount);
|
||||||
|
}
|
||||||
|
if (hand_tracker->hand_joint_set ==
|
||||||
|
XR_HAND_JOINT_SET_DEFAULT_EXT) {
|
||||||
|
if (vel->jointCount != XR_HAND_JOINT_COUNT_EXT) {
|
||||||
|
return oxr_error(
|
||||||
|
&log, XR_ERROR_VALIDATION_FAILURE,
|
||||||
|
"XrHandJointVelocitiesEXT joint count must "
|
||||||
|
"be %d, not %d\n",
|
||||||
|
XR_HAND_JOINT_COUNT_EXT,
|
||||||
|
locations->jointCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return oxr_session_hand_joints(&log, hand_tracker, locateInfo,
|
return oxr_session_hand_joints(&log, hand_tracker, locateInfo,
|
||||||
locations);
|
locations);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue