#include "openxrdebug.hpp" #include "openxrmanagerimpl.hpp" #include "vrenvironment.hpp" // The OpenXR SDK's platform headers assume we've included these windows headers #ifdef _WIN32 #include #include #elif __linux__ #include #include #undef None #else #error Unsupported platform #endif #include #include void MWVR::VrDebug::setName(uint64_t handle, XrObjectType type, const std::string& name) { auto& xrManager = Environment::get().getManager()->impl(); if (xrManager.xrExtensionIsEnabled(XR_EXT_DEBUG_UTILS_EXTENSION_NAME)) { XrDebugUtilsObjectNameInfoEXT nameInfo{ XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, nullptr }; nameInfo.objectHandle = handle; nameInfo.objectType = type; nameInfo.objectName = name.c_str(); static PFN_xrSetDebugUtilsObjectNameEXT setDebugUtilsObjectNameEXT = reinterpret_cast(xrManager.xrGetFunction("xrSetDebugUtilsObjectNameEXT")); CHECK_XRCMD(setDebugUtilsObjectNameEXT(xrManager.xrInstance(), &nameInfo)); } }