monado/src/xrt/state_trackers/oxr/oxr_api_debug.c

120 lines
3.3 KiB
C
Raw Normal View History

2019-03-18 05:52:32 +00:00
// Copyright 2019, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Debug messaging entrypoints for the OpenXR state tracker.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @ingroup oxr_api
*/
#include "oxr_objects.h"
#include "oxr_logger.h"
#include "oxr_api_funcs.h"
#include "oxr_api_verify.h"
#ifdef XR_EXT_debug_utils
XrResult
oxr_xrSetDebugUtilsObjectNameEXT(XrInstance instance,
const XrDebugUtilsObjectNameInfoEXT* nameInfo)
{
struct oxr_instance* inst;
struct oxr_logger log;
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst,
"xrSetDebugUtilsObjectNameEXT");
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}
XrResult
oxr_xrCreateDebugUtilsMessengerEXT(
XrInstance instance,
const XrDebugUtilsMessengerCreateInfoEXT* createInfo,
XrDebugUtilsMessengerEXT* messenger)
{
struct oxr_instance* inst;
struct oxr_debug_messenger* mssngr;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst,
"xrCreateDebugUtilsMessengerEXT");
OXR_VERIFY_ARG_TYPE_AND_NULL(
&log, createInfo, XR_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT);
OXR_VERIFY_ARG_NOT_NULL(&log, messenger);
XrResult ret = oxr_create_messenger(&log, inst, createInfo, &mssngr);
if (ret != XR_SUCCESS) {
return ret;
}
*messenger = oxr_messenger_to_openxr(mssngr);
return XR_SUCCESS;
2019-03-18 05:52:32 +00:00
}
XrResult
oxr_xrDestroyDebugUtilsMessengerEXT(XrDebugUtilsMessengerEXT messenger)
{
struct oxr_debug_messenger* mssngr;
struct oxr_logger log;
OXR_VERIFY_MESSENGER_AND_INIT_LOG(&log, messenger, mssngr,
"xrDestroyDebugUtilsMessengerEXT");
return oxr_handle_destroy(&log, &mssngr->handle);
2019-03-18 05:52:32 +00:00
}
XrResult
oxr_xrSubmitDebugUtilsMessageEXT(
XrInstance instance,
XrDebugUtilsMessageSeverityFlagsEXT messageSeverity,
XrDebugUtilsMessageTypeFlagsEXT messageTypes,
const XrDebugUtilsMessengerCallbackDataEXT* callbackData)
{
struct oxr_instance* inst;
struct oxr_logger log;
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst,
"xrSubmitDebugUtilsMessageEXT");
oxr_warn(&log, " not fully implemented");
return XR_SUCCESS;
2019-03-18 05:52:32 +00:00
}
XrResult
oxr_xrSessionBeginDebugUtilsLabelRegionEXT(
XrSession session, const XrDebugUtilsLabelEXT* labelInfo)
{
struct oxr_session* sess;
struct oxr_logger log;
OXR_VERIFY_SESSION_AND_INIT_LOG(
&log, session, sess, "xrSessionBeginDebugUtilsLabelRegionEXT");
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}
XrResult
oxr_xrSessionEndDebugUtilsLabelRegionEXT(XrSession session)
{
struct oxr_session* sess;
struct oxr_logger log;
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess,
"xrSessionEndDebugUtilsLabelRegionEXT");
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}
XrResult
oxr_xrSessionInsertDebugUtilsLabelEXT(XrSession session,
const XrDebugUtilsLabelEXT* labelInfo)
{
struct oxr_session* sess;
struct oxr_logger log;
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess,
"xrSessionInsertDebugUtilsLabelEXT");
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}
#endif