From 015bb82ec3c949d43264637a4a04005984a65288 Mon Sep 17 00:00:00 2001 From: assiduous Date: Sun, 8 Dec 2024 15:23:25 -0800 Subject: [PATCH] CreateOpenXRDebugUtilsMessenger: added xrMessageSeverities parameter --- .../GraphicsTools/interface/OpenXRUtilities.h | 4 +++- Graphics/GraphicsTools/src/OpenXRUtilities.cpp | 15 +++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Graphics/GraphicsTools/interface/OpenXRUtilities.h b/Graphics/GraphicsTools/interface/OpenXRUtilities.h index d1508c09c..38d7fb866 100644 --- a/Graphics/GraphicsTools/interface/OpenXRUtilities.h +++ b/Graphics/GraphicsTools/interface/OpenXRUtilities.h @@ -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); diff --git a/Graphics/GraphicsTools/src/OpenXRUtilities.cpp b/Graphics/GraphicsTools/src/OpenXRUtilities.cpp index 42e828746..477d42661 100644 --- a/Graphics/GraphicsTools/src/OpenXRUtilities.cpp +++ b/Graphics/GraphicsTools/src/OpenXRUtilities.cpp @@ -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))) @@ -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 | @@ -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)