# Conflicts: # scripts/system/libraries/entitySelectionTool.js
Showing the changes to interface/src/Application.cpp (1 of 149 files). Show all
Unified · Split
| @@ -318,7 +318,7 @@ static QTimer pingTimer; · 317 unmodified lines | ||
| 318 | 318 | static bool DISABLE_WATCHDOG = true; |
| 319 | 319 | #else |
| 320 | 320 | static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" }; |
| 321 | −static bool DISABLE_WATCHDOG = QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG); | |
| 321 | +static bool DISABLE_WATCHDOG = nsightActive() || QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG); | |
| 322 | 322 | #endif |
| 323 | 323 | |
| 324 | 324 | #if defined(USE_GLES) |
| @@ -415,20 +415,26 @@ public: · 90 unmodified lines | ||
| 415 | 415 | *crashTrigger = 0xDEAD10CC; |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | + static void withPause(const std::function<void()>& lambda) { | |
| 419 | + pause(); | |
| 420 | + lambda(); | |
| 421 | + resume(); | |
| 422 | + } | |
| 418 | 423 | static void pause() { |
| 419 | 424 | _paused = true; |
| 420 | 425 | } |
| 421 | 426 | |
| 422 | 427 | static void resume() { |
| 423 | − _paused = false; | |
| 428 | + // Update the heartbeat BEFORE resuming the checks | |
| 424 | 429 | updateHeartbeat(); |
| 430 | + _paused = false; | |
| 425 | 431 | } |
| 426 | 432 | |
| 427 | 433 | void run() override { |
| 428 | 434 | while (!_quit) { |
| 429 | 435 | QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS); |
| 430 | 436 | // Don't do heartbeat detection under nsight |
| 431 | − if (nsightActive() || _paused) { | |
| 437 | + if (_paused) { | |
| 432 | 438 | continue; |
| 433 | 439 | } |
| 434 | 440 | uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us |
| @@ -1046,7 +1052,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo · 611 unmodified lines | ||
| 1046 | 1052 | connect(nodeList.data(), &NodeList::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch); |
| 1047 | 1053 | |
| 1048 | 1054 | // you might think we could just do this in NodeList but we only want this connection for Interface |
| 1049 | − connect(nodeList.data(), &NodeList::limitOfSilentDomainCheckInsReached, nodeList.data(), &NodeList::reset); | |
| 1055 | + connect(&nodeList->getDomainHandler(), SIGNAL(limitOfSilentDomainCheckInsReached()), | |
| 1056 | + nodeList.data(), SLOT(reset())); | |
| 1050 | 1057 | |
| 1051 | 1058 | auto dialogsManager = DependencyManager::get<DialogsManager>(); |
| 1052 | 1059 | connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog); |
| @@ -2282,29 +2289,22 @@ void Application::initializeGL() { · 1229 unmodified lines | ||
| 2282 | 2289 | initDisplay(); |
| 2283 | 2290 | qCDebug(interfaceapp, "Initialized Display."); |
| 2284 | 2291 | |
| 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 | − | |
| 2290 | − // Set up the render engine | |
| 2291 | − render::CullFunctor cullFunctor = LODManager::shouldRender; | |
| 2292 | − static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD"; | |
| 2293 | − _renderEngine->addJob<UpdateSceneTask>("UpdateScene"); | |
| 2292 | + // FIXME: on low end systems os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread. | |
| 2293 | + DeadlockWatchdogThread::withPause([&] { | |
| 2294 | + // Set up the render engine | |
| 2295 | + render::CullFunctor cullFunctor = LODManager::shouldRender; | |
| 2296 | + static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD"; | |
| 2297 | + _renderEngine->addJob<UpdateSceneTask>("UpdateScene"); | |
| 2294 | 2298 | #ifndef Q_OS_ANDROID |
| 2295 | − _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED); | |
| 2299 | + _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED); | |
| 2296 | 2300 | #endif |
| 2297 | − _renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED, render::ItemKey::TAG_BITS_0, render::ItemKey::TAG_BITS_0); | |
| 2298 | − | |
| 2299 | − _renderEngine->load(); | |
| 2300 | − _renderEngine->registerScene(_main3DScene); | |
| 2301 | + _renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, !DISABLE_DEFERRED, render::ItemKey::TAG_BITS_0, render::ItemKey::TAG_BITS_0); | |
| 2302 | + _renderEngine->load(); | |
| 2303 | + _renderEngine->registerScene(_main3DScene); | |
| 2301 | 2304 | |
| 2302 | − // Now that OpenGL is initialized, we are sure we have a valid context and can create the various pipeline shaders with success. | |
| 2303 | − DependencyManager::get<GeometryCache>()->initializeShapePipelines(); | |
| 2304 | − | |
| 2305 | −#ifdef Q_OS_OSX | |
| 2306 | − DeadlockWatchdogThread::resume(); | |
| 2307 | −#endif | |
| 2305 | + // Now that OpenGL is initialized, we are sure we have a valid context and can create the various pipeline shaders with success. | |
| 2306 | + DependencyManager::get<GeometryCache>()->initializeShapePipelines(); | |
| 2307 | + }); | |
| 2308 | 2308 | |
| 2309 | 2309 | _offscreenContext = new OffscreenGLCanvas(); |
| 2310 | 2310 | _offscreenContext->setObjectName("MainThreadContext"); |
| @@ -2403,7 +2403,9 @@ void Application::initializeUi() { · 92 unmodified lines | ||
| 2403 | 2403 | tabletScriptingInterface->getTablet(SYSTEM_TABLET); |
| 2404 | 2404 | } |
| 2405 | 2405 | auto offscreenUi = DependencyManager::get<OffscreenUi>(); |
| 2406 | + DeadlockWatchdogThread::pause(); | |
| 2406 | 2407 | offscreenUi->create(); |
| 2408 | + DeadlockWatchdogThread::resume(); | |
| 2407 | 2409 | |
| 2408 | 2410 | auto surfaceContext = offscreenUi->getSurfaceContext(); |
| 2409 | 2411 | |