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

126 lines
3.8 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
*/
2021-02-22 20:35:16 +00:00
#include "util/u_trace_marker.h"
2019-03-18 05:52:32 +00:00
#include "oxr_objects.h"
#include "oxr_logger.h"
#include "oxr_api_funcs.h"
#include "oxr_api_verify.h"
XRAPI_ATTR XrResult XRAPI_CALL
2021-01-14 14:13:48 +00:00
oxr_xrSetDebugUtilsObjectNameEXT(XrInstance instance, const XrDebugUtilsObjectNameInfoEXT *nameInfo)
2019-03-18 05:52:32 +00:00
{
2021-02-22 20:35:16 +00:00
OXR_TRACE_MARKER();
struct oxr_instance *inst;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
2021-01-14 14:13:48 +00:00
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst, "xrSetDebugUtilsObjectNameEXT");
2019-08-19 17:37:50 +00:00
OXR_VERIFY_EXTENSION(&log, inst, EXT_debug_utils);
2019-03-18 05:52:32 +00:00
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}
XRAPI_ATTR XrResult XRAPI_CALL
2021-01-14 14:13:48 +00:00
oxr_xrCreateDebugUtilsMessengerEXT(XrInstance instance,
const XrDebugUtilsMessengerCreateInfoEXT *createInfo,
XrDebugUtilsMessengerEXT *messenger)
2019-03-18 05:52:32 +00:00
{
2021-02-22 20:35:16 +00:00
OXR_TRACE_MARKER();
struct oxr_instance *inst;
struct oxr_debug_messenger *mssngr;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
2021-01-14 14:13:48 +00:00
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst, "xrCreateDebugUtilsMessengerEXT");
2019-08-19 17:37:50 +00:00
OXR_VERIFY_EXTENSION(&log, inst, EXT_debug_utils);
2019-03-18 05:52:32 +00:00
2021-01-14 14:13:48 +00:00
OXR_VERIFY_ARG_TYPE_AND_NOT_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
}
XRAPI_ATTR XrResult XRAPI_CALL
2019-03-18 05:52:32 +00:00
oxr_xrDestroyDebugUtilsMessengerEXT(XrDebugUtilsMessengerEXT messenger)
{
2021-02-22 20:35:16 +00:00
OXR_TRACE_MARKER();
struct oxr_debug_messenger *mssngr;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
2021-01-14 14:13:48 +00:00
OXR_VERIFY_MESSENGER_AND_INIT_LOG(&log, messenger, mssngr, "xrDestroyDebugUtilsMessengerEXT");
2019-08-19 17:37:50 +00:00
OXR_VERIFY_EXTENSION(&log, mssngr->inst, EXT_debug_utils);
2019-03-18 05:52:32 +00:00
return oxr_handle_destroy(&log, &mssngr->handle);
2019-03-18 05:52:32 +00:00
}
XRAPI_ATTR XrResult XRAPI_CALL
2021-01-14 14:13:48 +00:00
oxr_xrSubmitDebugUtilsMessageEXT(XrInstance instance,
XrDebugUtilsMessageSeverityFlagsEXT messageSeverity,
XrDebugUtilsMessageTypeFlagsEXT messageTypes,
const XrDebugUtilsMessengerCallbackDataEXT *callbackData)
2019-03-18 05:52:32 +00:00
{
2021-02-22 20:35:16 +00:00
OXR_TRACE_MARKER();
struct oxr_instance *inst;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
2021-01-14 14:13:48 +00:00
OXR_VERIFY_INSTANCE_AND_INIT_LOG(&log, instance, inst, "xrSubmitDebugUtilsMessageEXT");
2019-08-19 17:37:50 +00:00
OXR_VERIFY_EXTENSION(&log, inst, EXT_debug_utils);
2019-03-18 05:52:32 +00:00
oxr_warn(&log, " not fully implemented");
return XR_SUCCESS;
2019-03-18 05:52:32 +00:00
}
XRAPI_ATTR XrResult XRAPI_CALL
2021-01-14 14:13:48 +00:00
oxr_xrSessionBeginDebugUtilsLabelRegionEXT(XrSession session, const XrDebugUtilsLabelEXT *labelInfo)
2019-03-18 05:52:32 +00:00
{
2021-02-22 20:35:16 +00:00
OXR_TRACE_MARKER();
struct oxr_session *sess;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
2021-01-14 14:13:48 +00:00
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrSessionBeginDebugUtilsLabelRegionEXT");
2019-08-19 17:37:50 +00:00
OXR_VERIFY_EXTENSION(&log, sess->sys->inst, EXT_debug_utils);
2019-03-18 05:52:32 +00:00
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}
XRAPI_ATTR XrResult XRAPI_CALL
2019-03-18 05:52:32 +00:00
oxr_xrSessionEndDebugUtilsLabelRegionEXT(XrSession session)
{
2021-02-22 20:35:16 +00:00
OXR_TRACE_MARKER();
struct oxr_session *sess;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
2021-01-14 14:13:48 +00:00
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrSessionEndDebugUtilsLabelRegionEXT");
2019-08-19 17:37:50 +00:00
OXR_VERIFY_EXTENSION(&log, sess->sys->inst, EXT_debug_utils);
2019-03-18 05:52:32 +00:00
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}
XRAPI_ATTR XrResult XRAPI_CALL
2021-01-14 14:13:48 +00:00
oxr_xrSessionInsertDebugUtilsLabelEXT(XrSession session, const XrDebugUtilsLabelEXT *labelInfo)
2019-03-18 05:52:32 +00:00
{
2021-02-22 20:35:16 +00:00
OXR_TRACE_MARKER();
struct oxr_session *sess;
2019-03-18 05:52:32 +00:00
struct oxr_logger log;
2021-01-14 14:13:48 +00:00
OXR_VERIFY_SESSION_AND_INIT_LOG(&log, session, sess, "xrSessionInsertDebugUtilsLabelEXT");
2019-08-19 17:37:50 +00:00
OXR_VERIFY_EXTENSION(&log, sess->sys->inst, EXT_debug_utils);
2019-03-18 05:52:32 +00:00
return oxr_error(&log, XR_ERROR_RUNTIME_FAILURE, " not implemented");
}