Skip to content

Commit

Permalink
CreateOpenXRDebugUtilsMessenger: added xrMessageSeverities parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Dec 8, 2024
1 parent d6caeb2 commit 015bb82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 3 additions & 1 deletion Graphics/GraphicsTools/interface/OpenXRUtilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ void DILIGENT_GLOBAL_FUNCTION(GetOpenXRGraphicsBinding)(IRenderDevice* pDevice,
IDataBlob** ppGraphicsBinding);

/// Creates OpenXR debug utils messenger.
XrDebugUtilsMessengerEXT DILIGENT_GLOBAL_FUNCTION(CreateOpenXRDebugUtilsMessenger)(XrInstance xrInstance);
XrDebugUtilsMessengerEXT DILIGENT_GLOBAL_FUNCTION(CreateOpenXRDebugUtilsMessenger)(
XrInstance xrInstance,
XrDebugUtilsMessageSeverityFlagsEXT xrMessageSeverities);

/// Destroys OpenXR debug utils messenger.
void DILIGENT_GLOBAL_FUNCTION(DestroyOpenXRDebugUtilsMessenger)(XrDebugUtilsMessengerEXT xrDebugUtilsMessenger);
Expand Down
15 changes: 7 additions & 8 deletions Graphics/GraphicsTools/src/OpenXRUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ static XrBool32 OpenXRMessageCallbackFunction(XrDebugUtilsMessageSeverityFlagsEX

PFN_xrDestroyDebugUtilsMessengerEXT xrDestroyDebugUtilsMessengerEXT = nullptr;

XrDebugUtilsMessengerEXT CreateOpenXRDebugUtilsMessenger(XrInstance xrInstance)
XrDebugUtilsMessengerEXT CreateOpenXRDebugUtilsMessenger(XrInstance xrInstance,
XrDebugUtilsMessageSeverityFlagsEXT xrMessageSeverities)
{
PFN_xrCreateDebugUtilsMessengerEXT xrCreateDebugUtilsMessengerEXT;
if (XR_FAILED(xrGetInstanceProcAddr(xrInstance, "xrCreateDebugUtilsMessengerEXT", (PFN_xrVoidFunction*)&xrCreateDebugUtilsMessengerEXT)))
Expand All @@ -312,11 +313,8 @@ XrDebugUtilsMessengerEXT CreateOpenXRDebugUtilsMessenger(XrInstance xrInstance)
// Fill out a XrDebugUtilsMessengerCreateInfoEXT structure specifying all severities and types.
// Set the userCallback to OpenXRMessageCallbackFunction().
XrDebugUtilsMessengerCreateInfoEXT debugUtilsMessengerCI{XR_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT};
debugUtilsMessengerCI.messageSeverities =
XR_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT |
XR_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT |
XR_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT |
XR_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT;
debugUtilsMessengerCI.messageSeverities = xrMessageSeverities;

debugUtilsMessengerCI.messageTypes =
XR_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT |
XR_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT |
Expand Down Expand Up @@ -356,9 +354,10 @@ extern "C"
Diligent::GetOpenXRGraphicsBinding(pDevice, pContext, ppGraphicsBinding);
}

XrDebugUtilsMessengerEXT Diligent_CreateOpenXRDebugUtilsMessenger(XrInstance xrInstance, XrDebugUtilsMessengerEXT* pDebugUtilsMessenger)
XrDebugUtilsMessengerEXT Diligent_CreateOpenXRDebugUtilsMessenger(XrInstance xrInstance,
XrDebugUtilsMessageSeverityFlagsEXT xrMessageSeverities)
{
return Diligent::CreateOpenXRDebugUtilsMessenger(xrInstance);
return Diligent::CreateOpenXRDebugUtilsMessenger(xrInstance, xrMessageSeverities);
}

void Diligent_DestroyOpenXRDebugUtilsMessenger(XrDebugUtilsMessengerEXT debugUtilsMessenger)
Expand Down

0 comments on commit 015bb82

Please sign in to comment.