History

Merge branch 'master' into remove-deprecated-items

# Conflicts: # scripts/system/libraries/entitySelectionTool.js

David Rowe committed 8 years ago

Commit 033b85a2 parents 615e546 f3918ad149 files · +2946 −3903Browse files

Showing the changes to interface/src/Application.cpp (1 of 149 files). Show all

Unified · Split

interface/src/Application.cpp+26−24
@@ -318,7 +318,7 @@ static QTimer pingTimer; · 317 unmodified lines
318318 static bool DISABLE_WATCHDOG = true;
319319 #else
320320 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);
322322 #endif
323323
324324 #if defined(USE_GLES)
@@ -415,20 +415,26 @@ public: · 90 unmodified lines
415415 *crashTrigger = 0xDEAD10CC;
416416 }
417417
418+ static void withPause(const std::function<void()>& lambda) {
419+ pause();
420+ lambda();
421+ resume();
422+ }
418423 static void pause() {
419424 _paused = true;
420425 }
421426
422427 static void resume() {
423− _paused = false;
428+ // Update the heartbeat BEFORE resuming the checks
424429 updateHeartbeat();
430+ _paused = false;
425431 }
426432
427433 void run() override {
428434 while (!_quit) {
429435 QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
430436 // Don't do heartbeat detection under nsight
431− if (nsightActive() || _paused) {
437+ if (_paused) {
432438 continue;
433439 }
434440 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
10461052 connect(nodeList.data(), &NodeList::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch);
10471053
10481054 // 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()));
10501057
10511058 auto dialogsManager = DependencyManager::get<DialogsManager>();
10521059 connect(accountManager.data(), &AccountManager::authRequired, dialogsManager.data(), &DialogsManager::showLoginDialog);
@@ -2282,29 +2289,22 @@ void Application::initializeGL() { · 1229 unmodified lines
22822289 initDisplay();
22832290 qCDebug(interfaceapp, "Initialized Display.");
22842291
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");
22942298 #ifndef Q_OS_ANDROID
2295− _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
2299+ _renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor, !DISABLE_DEFERRED);
22962300 #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);
23012304
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+ });
23082308
23092309 _offscreenContext = new OffscreenGLCanvas();
23102310 _offscreenContext->setObjectName("MainThreadContext");
@@ -2403,7 +2403,9 @@ void Application::initializeUi() { · 92 unmodified lines
24032403 tabletScriptingInterface->getTablet(SYSTEM_TABLET);
24042404 }
24052405 auto offscreenUi = DependencyManager::get<OffscreenUi>();
2406+ DeadlockWatchdogThread::pause();
24062407 offscreenUi->create();
2408+ DeadlockWatchdogThread::resume();
24072409
24082410 auto surfaceContext = offscreenUi->getSurfaceContext();
24092411

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t