Commit 9183f53c authored by Simon Ser's avatar Simon Ser

xrt: allow NULL args in various functions

The spec says NULL arguments are valid when the argument just exists for
extensibility. Fix the implementation to accept NULL args.
parent 8ade6b65
Pipeline #76269 passed with stages
in 2 minutes and 6 seconds
......@@ -108,6 +108,8 @@ oxr_xrWaitFrame(XrSession session,
struct oxr_session *sess;
struct oxr_logger log;
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrWaitFrame");
OXR_VERIFY_ARG_TYPE_CAN_BE_NULL(&log, frameWaitInfo,
XR_TYPE_FRAME_WAIT_INFO);
OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, frameState, XR_TYPE_FRAME_STATE);
OXR_VERIFY_ARG_NOT_NULL(&log, frameState);
......@@ -121,10 +123,8 @@ oxr_xrBeginFrame(XrSession session, const XrFrameBeginInfo *frameBeginInfo)
struct oxr_logger log;
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrBeginFrame");
// NULL explicitly allowed here because it's a basically empty struct.
if (frameBeginInfo != NULL) {
OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, frameBeginInfo,
XR_TYPE_FRAME_BEGIN_INFO);
}
OXR_VERIFY_ARG_TYPE_CAN_BE_NULL(&log, frameBeginInfo,
XR_TYPE_FRAME_BEGIN_INFO);
return oxr_session_frame_begin(&log, sess);
}
......
......@@ -120,8 +120,8 @@ oxr_xrAcquireSwapchainImage(XrSwapchain swapchain,
struct oxr_logger log;
OXR_VERIFY_SWAPCHAIN_AND_INIT_LOG(&log, swapchain, sc,
"xrAcquireSwapchainImage");
OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, acquireInfo,
XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO);
OXR_VERIFY_ARG_TYPE_CAN_BE_NULL(&log, acquireInfo,
XR_TYPE_SWAPCHAIN_IMAGE_ACQUIRE_INFO);
OXR_VERIFY_ARG_NOT_NULL(&log, index);
return sc->acquire_image(&log, sc, acquireInfo, index);
......@@ -149,8 +149,8 @@ oxr_xrReleaseSwapchainImage(XrSwapchain swapchain,
struct oxr_logger log;
OXR_VERIFY_SWAPCHAIN_AND_INIT_LOG(&log, swapchain, sc,
"xrReleaseSwapchainImage");
OXR_VERIFY_ARG_TYPE_AND_NOT_NULL(&log, releaseInfo,
XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO);
OXR_VERIFY_ARG_TYPE_CAN_BE_NULL(&log, releaseInfo,
XR_TYPE_SWAPCHAIN_IMAGE_RELEASE_INFO);
return sc->release_image(&log, sc, releaseInfo);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment