Showing the changes to interface/src/Application.cpp (1 of 38 files). Show all
Unified · Split
| @@ -149,6 +149,7 @@ · 148 unmodified lines | |||
| 149 | #include "avatar/AvatarManager.h" | 149 | #include "avatar/AvatarManager.h" |
| 150 | #include "avatar/MyHead.h" | 150 | #include "avatar/MyHead.h" |
| 151 | #include "CrashHandler.h" | 151 | #include "CrashHandler.h" |
| 152 | #include "Crashpad.h" | ||
| 152 | #include "devices/DdeFaceTracker.h" | 153 | #include "devices/DdeFaceTracker.h" |
| 153 | #include "DiscoverabilityManager.h" | 154 | #include "DiscoverabilityManager.h" |
| 154 | #include "GLCanvas.h" | 155 | #include "GLCanvas.h" |
| @@ -396,6 +397,7 @@ public: · 241 unmodified lines | |||
| 396 | setObjectName("Deadlock Watchdog"); | 397 | setObjectName("Deadlock Watchdog"); |
| 397 | // Give the heartbeat an initial value | 398 | // Give the heartbeat an initial value |
| 398 | _heartbeat = usecTimestampNow(); | 399 | _heartbeat = usecTimestampNow(); |
| 400 | _paused = false; | ||
| 399 | connect(qApp, &QCoreApplication::aboutToQuit, [this] { | 401 | connect(qApp, &QCoreApplication::aboutToQuit, [this] { |
| 400 | _quit = true; | 402 | _quit = true; |
| 401 | }); | 403 | }); |
| @@ -413,11 +415,20 @@ public: · 11 unmodified lines | |||
| 413 | *crashTrigger = 0xDEAD10CC; | 415 | *crashTrigger = 0xDEAD10CC; |
| 414 | } | 416 | } |
| 415 | 417 | ||
| 418 | static void pause() { | ||
| 419 | _paused = true; | ||
| 420 | } | ||
| 421 | |||
| 422 | static void resume() { | ||
| 423 | _paused = false; | ||
| 424 | updateHeartbeat(); | ||
| 425 | } | ||
| 426 | |||
| 416 | void run() override { | 427 | void run() override { |
| 417 | while (!_quit) { | 428 | while (!_quit) { |
| 418 | QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS); | 429 | QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS); |
| 419 | // Don't do heartbeat detection under nsight | 430 | // Don't do heartbeat detection under nsight |
| 420 | if (nsightActive()) { | 431 | if (nsightActive() || _paused) { |
| 421 | continue; | 432 | continue; |
| 422 | } | 433 | } |
| 423 | uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us | 434 | uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us |
| @@ -473,6 +484,7 @@ public: · 49 unmodified lines | |||
| 473 | } | 484 | } |
| 474 | } | 485 | } |
| 475 | 486 | ||
| 487 | static std::atomic<bool> _paused; | ||
| 476 | static std::atomic<uint64_t> _heartbeat; | 488 | static std::atomic<uint64_t> _heartbeat; |
| 477 | static std::atomic<uint64_t> _maxElapsed; | 489 | static std::atomic<uint64_t> _maxElapsed; |
| 478 | static std::atomic<int> _maxElapsedAverage; | 490 | static std::atomic<int> _maxElapsedAverage; |
| @@ -481,6 +493,7 @@ public: · 2 unmodified lines | |||
| 481 | bool _quit { false }; | 493 | bool _quit { false }; |
| 482 | }; | 494 | }; |
| 483 | 495 | ||
| 496 | std::atomic<bool> DeadlockWatchdogThread::_paused; | ||
| 484 | std::atomic<uint64_t> DeadlockWatchdogThread::_heartbeat; | 497 | std::atomic<uint64_t> DeadlockWatchdogThread::_heartbeat; |
| 485 | std::atomic<uint64_t> DeadlockWatchdogThread::_maxElapsed; | 498 | std::atomic<uint64_t> DeadlockWatchdogThread::_maxElapsed; |
| 486 | std::atomic<int> DeadlockWatchdogThread::_maxElapsedAverage; | 499 | std::atomic<int> DeadlockWatchdogThread::_maxElapsedAverage; |
| @@ -656,8 +669,6 @@ bool setupEssentials(int& argc, char** argv, bool runningMarkerExisted) { · 169 unmodified lines | |||
| 656 | } | 669 | } |
| 657 | #endif | 670 | #endif |
| 658 | 671 | ||
| 659 | Setting::init(); | ||
| 660 | |||
| 661 | // Tell the plugin manager about our statically linked plugins | 672 | // Tell the plugin manager about our statically linked plugins |
| 662 | auto pluginManager = PluginManager::getInstance(); | 673 | auto pluginManager = PluginManager::getInstance(); |
| 663 | pluginManager->setInputPluginProvider([] { return getInputPlugins(); }); | 674 | pluginManager->setInputPluginProvider([] { return getInputPlugins(); }); |
| @@ -909,6 +920,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 245 unmodified lines | |||
| 909 | 920 | ||
| 910 | _logger->setSessionID(accountManager->getSessionID()); | 921 | _logger->setSessionID(accountManager->getSessionID()); |
| 911 | 922 | ||
| 923 | setCrashAnnotation("metaverse_session_id", accountManager->getSessionID().toString().toStdString()); | ||
| 924 | |||
| 912 | if (steamClient) { | 925 | if (steamClient) { |
| 913 | qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID(); | 926 | qCDebug(interfaceapp) << "[VERSION] SteamVR buildID:" << steamClient->getSteamVRBuildID(); |
| 914 | } | 927 | } |
| @@ -2269,6 +2282,11 @@ void Application::initializeGL() { · 1354 unmodified lines | |||
| 2269 | initDisplay(); | 2282 | initDisplay(); |
| 2270 | qCDebug(interfaceapp, "Initialized Display."); | 2283 | qCDebug(interfaceapp, "Initialized Display."); |
| 2271 | 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 | |||
| 2272 | // Set up the render engine | 2290 | // Set up the render engine |
| 2273 | render::CullFunctor cullFunctor = LODManager::shouldRender; | 2291 | render::CullFunctor cullFunctor = LODManager::shouldRender; |
| 2274 | static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD"; | 2292 | static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD"; |
| @@ -2277,6 +2295,11 @@ void Application::initializeGL() { · 2 unmodified lines | |||
| 2277 | _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED); | 2295 | _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED); |
| 2278 | #endif | 2296 | #endif |
| 2279 | _renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED); | 2297 | _renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED); |
| 2298 | |||
| 2299 | #ifdef Q_OS_OSX | ||
| 2300 | DeadlockWatchdogThread::resume(); | ||
| 2301 | #endif | ||
| 2302 | |||
| 2280 | _renderEngine->load(); | 2303 | _renderEngine->load(); |
| 2281 | _renderEngine->registerScene(_main3DScene); | 2304 | _renderEngine->registerScene(_main3DScene); |
| 2282 | 2305 | ||
| @@ -6272,7 +6295,7 @@ void Application::showAssetServerWidget(QString filePath) { · 3989 unmodified lines | |||
| 6272 | if (!hmd->getShouldShowTablet() && !isHMDMode()) { | 6295 | if (!hmd->getShouldShowTablet() && !isHMDMode()) { |
| 6273 | DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload); | 6296 | DependencyManager::get<OffscreenUi>()->show(url, "AssetServer", startUpload); |
| 6274 | } else { | 6297 | } else { |
| 6275 | static const QUrl url("../dialogs/TabletAssetServer.qml"); | 6298 | static const QUrl url("hifi/dialogs/TabletAssetServer.qml"); |
| 6276 | tablet->pushOntoStack(url); | 6299 | tablet->pushOntoStack(url); |
| 6277 | } | 6300 | } |
| 6278 | } | 6301 | } |