XR: Print OpenXR SDK version in --debug-xr mode

Helps with version validation when updating the OpenXR dependency.
This commit is contained in:
Peter Kim 2022-01-31 16:09:17 +09:00
parent ed80c887b7
commit a727692af7
2 changed files with 12 additions and 0 deletions

View File

@ -86,6 +86,7 @@ void GHOST_XrContext::initialize(const GHOST_XrContextCreateInfo *create_info)
initApiLayers();
initExtensions();
if (isDebugMode()) {
printSDKVersion();
printAvailableAPILayersAndExtensionsInfo();
}
@ -156,6 +157,16 @@ void GHOST_XrContext::storeInstanceProperties()
/** \name Debug Printing
* \{ */
void GHOST_XrContext::printSDKVersion()
{
const XrVersion sdk_version = XR_CURRENT_API_VERSION;
printf("OpenXR SDK Version: %u.%u.%u\n",
XR_VERSION_MAJOR(sdk_version),
XR_VERSION_MINOR(sdk_version),
XR_VERSION_PATCH(sdk_version));
}
void GHOST_XrContext::printInstanceInfo()
{
assert(m_oxr->instance != XR_NULL_HANDLE);

View File

@ -126,6 +126,7 @@ class GHOST_XrContext : public GHOST_IXrContext {
void storeInstanceProperties();
void initDebugMessenger();
void printSDKVersion();
void printInstanceInfo();
void printAvailableAPILayersAndExtensionsInfo();
void printExtensionsAndAPILayersToEnable();