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