Showing the changes to interface/src/Application.cpp (1 of 107 files). Show all
Unified · Split
| @@ -68,6 +68,7 @@ · 67 unmodified lines | ||
| 68 | 68 | #include <Midi.h> |
| 69 | 69 | #include <AudioInjectorManager.h> |
| 70 | 70 | #include <AvatarBookmarks.h> |
| 71 | +#include <AvatarEntitiesBookmarks.h> | |
| 71 | 72 | #include <CursorManager.h> |
| 72 | 73 | #include <DebugDraw.h> |
| 73 | 74 | #include <DeferredLightingEffect.h> |
| @@ -148,6 +149,7 @@ · 74 unmodified lines | ||
| 148 | 149 | #include "avatar/AvatarManager.h" |
| 149 | 150 | #include "avatar/MyHead.h" |
| 150 | 151 | #include "CrashHandler.h" |
| 152 | +#include "Crashpad.h" | |
| 151 | 153 | #include "devices/DdeFaceTracker.h" |
| 152 | 154 | #include "DiscoverabilityManager.h" |
| 153 | 155 | #include "GLCanvas.h" |
| @@ -395,6 +397,7 @@ public: · 241 unmodified lines | ||
| 395 | 397 | setObjectName("Deadlock Watchdog"); |
| 396 | 398 | // Give the heartbeat an initial value |
| 397 | 399 | _heartbeat = usecTimestampNow(); |
| 400 | + _paused = false; | |
| 398 | 401 | connect(qApp, &QCoreApplication::aboutToQuit, [this] { |
| 399 | 402 | _quit = true; |
| 400 | 403 | }); |
| @@ -412,11 +415,20 @@ public: · 11 unmodified lines | ||
| 412 | 415 | *crashTrigger = 0xDEAD10CC; |
| 413 | 416 | } |
| 414 | 417 | |
| 418 | + static void pause() { | |
| 419 | + _paused = true; | |
| 420 | + } | |
| 421 | + | |
| 422 | + static void resume() { | |
| 423 | + _paused = false; | |
| 424 | + updateHeartbeat(); | |
| 425 | + } | |
| 426 | + | |
| 415 | 427 | void run() override { |
| 416 | 428 | while (!_quit) { |
| 417 | 429 | QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS); |
| 418 | 430 | // Don't do heartbeat detection under nsight |
| 419 | − if (nsightActive()) { | |
| 431 | + if (nsightActive() || _paused) { | |
| 420 | 432 | continue; |
| 421 | 433 | } |
| 422 | 434 | uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us |
| @@ -472,6 +484,7 @@ public: · 49 unmodified lines | ||
| 472 | 484 | } |
| 473 | 485 | } |
| 474 | 486 | |
| 487 | + static std::atomic<bool> _paused; | |
| 475 | 488 | static std::atomic<uint64_t> _heartbeat; |
| 476 | 489 | static std::atomic<uint64_t> _maxElapsed; |
| 477 | 490 | static std::atomic<int> _maxElapsedAverage; |
| @@ -480,6 +493,7 @@ public: · 2 unmodified lines | ||
| 480 | 493 | bool _quit { false }; |
| 481 | 494 | }; |
| 482 | 495 | |
| 496 | +std::atomic<bool> DeadlockWatchdogThread::_paused; | |
| 483 | 497 | std::atomic<uint64_t> DeadlockWatchdogThread::_heartbeat; |
| 484 | 498 | std::atomic<uint64_t> DeadlockWatchdogThread::_maxElapsed; |
| 485 | 499 | std::atomic<int> DeadlockWatchdogThread::_maxElapsedAverage; |
| @@ -655,8 +669,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 169 unmodified lines | ||
| 655 | 669 | } |
| 656 | 670 | #endif |
| 657 | 671 | |
| 658 | − Setting::init(); | |
| 659 | − | |
| 660 | 672 | // Tell the plugin manager about our statically linked plugins |
| 661 | 673 | auto pluginManager = PluginManager::getInstance(); |
| 662 | 674 | pluginManager->setInputPluginProvider([] { return getInputPlugins(); }); |
| @@ -763,6 +775,7 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 100 unmodified lines | ||
| 763 | 775 | DependencyManager::set<GooglePolyScriptingInterface>(); |
| 764 | 776 | DependencyManager::set<OctreeStatsProvider>(nullptr, qApp->getOcteeSceneStats()); |
| 765 | 777 | DependencyManager::set<AvatarBookmarks>(); |
| 778 | + DependencyManager::set<AvatarEntitiesBookmarks>(); | |
| 766 | 779 | DependencyManager::set<LocationBookmarks>(); |
| 767 | 780 | DependencyManager::set<Snapshot>(); |
| 768 | 781 | DependencyManager::set<CloseEventSender>(); |
| @@ -907,6 +920,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 138 unmodified lines | ||
| 907 | 920 | |
| 908 | 921 | _logger->setSessionID(accountManager->getSessionID()); |
| 909 | 922 | |
| 923 | + setCrashAnnotation("metaverse_session_id", accountManager->getSessionID().toString().toStdString()); | |
| 924 | + | |
| 910 | 925 | if (steamClient) { |
| 911 | 926 | qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID(); |
| 912 | 927 | } |
| @@ -1906,7 +1921,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 993 unmodified lines | ||
| 1906 | 1921 | entityResult.distance = pickResult->distance; |
| 1907 | 1922 | entityResult.surfaceNormal = pickResult->surfaceNormal; |
| 1908 | 1923 | entityResult.entityID = pickResult->objectID; |
| 1909 | − entityResult.entity = DependencyManager::get<EntityTreeRenderer>()->getTree()->findEntityByID(entityResult.entityID); | |
| 1924 | + entityResult.extraInfo = pickResult->extraInfo; | |
| 1910 | 1925 | } |
| 1911 | 1926 | } |
| 1912 | 1927 | return entityResult; |
| @@ -2267,6 +2282,11 @@ void Application::initializeGL() { · 354 unmodified lines | ||
| 2267 | 2282 | initDisplay(); |
| 2268 | 2283 | qCDebug(interfaceapp, "Initialized Display."); |
| 2269 | 2284 | |
| 2285 | +#ifdef Q_OS_OSX | |
| 2286 | + // FIXME: on mac os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread. | |
| 2287 | + DeadlockWatchdogThread::pause(); | |
| 2288 | +#endif | |
| 2289 | + | |
| 2270 | 2290 | // Set up the render engine |
| 2271 | 2291 | render::CullFunctor cullFunctor = LODManager::shouldRender; |
| 2272 | 2292 | static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD"; |
| @@ -2275,6 +2295,11 @@ void Application::initializeGL() { · 2 unmodified lines | ||
| 2275 | 2295 | _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED); |
| 2276 | 2296 | #endif |
| 2277 | 2297 | _renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED, render::ItemKey::TAG_BITS_0, render::ItemKey::TAG_BITS_0); |
| 2298 | + | |
| 2299 | +#ifdef Q_OS_OSX | |
| 2300 | + DeadlockWatchdogThread::resume(); | |
| 2301 | +#endif | |
| 2302 | + | |
| 2278 | 2303 | _renderEngine->load(); |
| 2279 | 2304 | _renderEngine->registerScene(_main3DScene); |
| 2280 | 2305 | |
| @@ -2443,6 +2468,7 @@ void Application::initializeUi() { · 162 unmodified lines | ||
| 2443 | 2468 | surfaceContext->setContextProperty("Settings", SettingsScriptingInterface::getInstance()); |
| 2444 | 2469 | surfaceContext->setContextProperty("ScriptDiscoveryService", DependencyManager::get<ScriptEngines>().data()); |
| 2445 | 2470 | surfaceContext->setContextProperty("AvatarBookmarks", DependencyManager::get<AvatarBookmarks>().data()); |
| 2471 | + surfaceContext->setContextProperty("AvatarEntitiesBookmarks", DependencyManager::get<AvatarEntitiesBookmarks>().data()); | |
| 2446 | 2472 | surfaceContext->setContextProperty("LocationBookmarks", DependencyManager::get<LocationBookmarks>().data()); |
| 2447 | 2473 | |
| 2448 | 2474 | // Caches |
| @@ -5851,6 +5877,7 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEnginePointe · 3402 unmodified lines | ||
| 5851 | 5877 | scriptEngine->registerGlobalObject("AudioStats", DependencyManager::get<AudioClient>()->getStats().data()); |
| 5852 | 5878 | scriptEngine->registerGlobalObject("AudioScope", DependencyManager::get<AudioScope>().data()); |
| 5853 | 5879 | scriptEngine->registerGlobalObject("AvatarBookmarks", DependencyManager::get<AvatarBookmarks>().data()); |
| 5880 | + scriptEngine->registerGlobalObject("AvatarEntitiesBookmarks", DependencyManager::get<AvatarEntitiesBookmarks>().data()); | |
| 5854 | 5881 | scriptEngine->registerGlobalObject("LocationBookmarks", DependencyManager::get<LocationBookmarks>().data()); |
| 5855 | 5882 | |
| 5856 | 5883 | scriptEngine->registerGlobalObject("RayPick", DependencyManager::get<RayPickScriptingInterface>().data()); |
| @@ -6268,7 +6295,7 @@ void Application::showAssetServerWidget(QString filePath) { · 411 unmodified lines | ||
| 6268 | 6295 | if (!hmd->getShouldShowTablet() && !isHMDMode()) { |
| 6269 | 6296 | DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload); |
| 6270 | 6297 | } else { |
| 6271 | − static const QUrl url("../dialogs/TabletAssetServer.qml"); | |
| 6298 | + static const QUrl url("hifi/dialogs/TabletAssetServer.qml"); | |
| 6272 | 6299 | tablet->pushOntoStack(url); |
| 6273 | 6300 | } |
| 6274 | 6301 | } |