History

cherry picking Tony's fix for shader compilation time not taking soo long and adding better feedback from shader compilation

samcake committed 8 years ago

Commit 2dcedf91 parent b37985516 files · +297 −134Browse files

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

Unified · Split

interface/src/Application.cpp+22−1
@@ -396,6 +396,7 @@ public: · 395 unmodified lines
396396 setObjectName("Deadlock Watchdog");
397397 // Give the heartbeat an initial value
398398 _heartbeat = usecTimestampNow();
399+ _paused = false;
399400 connect(qApp, &QCoreApplication::aboutToQuit, [this] {
400401 _quit = true;
401402 });
@@ -413,11 +414,20 @@ public: · 11 unmodified lines
413414 *crashTrigger = 0xDEAD10CC;
414415 }
415416
417+ static void pause() {
418+ _paused = true;
419+ }
420+
421+ static void resume() {
422+ _paused = false;
423+ updateHeartbeat();
424+ }
425+
416426 void run() override {
417427 while (!_quit) {
418428 QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
419429 // Don't do heartbeat detection under nsight
420− if (nsightActive()) {
430+ if (nsightActive() || _paused) {
421431 continue;
422432 }
423433 uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
@@ -473,6 +483,7 @@ public: · 49 unmodified lines
473483 }
474484 }
475485
486+ static std::atomic<bool> _paused;
476487 static std::atomic<uint64_t> _heartbeat;
477488 static std::atomic<uint64_t> _maxElapsed;
478489 static std::atomic<int> _maxElapsedAverage;
@@ -481,6 +492,7 @@ public: · 2 unmodified lines
481492 bool _quit { false };
482493 };
483494
495+std::atomic<bool> DeadlockWatchdogThread::_paused;
484496 std::atomic<uint64_t> DeadlockWatchdogThread::_heartbeat;
485497 std::atomic<uint64_t> DeadlockWatchdogThread::_maxElapsed;
486498 std::atomic<int> DeadlockWatchdogThread::_maxElapsedAverage;
@@ -2269,6 +2281,11 @@ void Application::initializeGL() { · 1782 unmodified lines
22692281 initDisplay();
22702282 qCDebug(interfaceapp, "Initialized Display.");
22712283
2284+#ifdef Q_OS_OSX
2285+ // FIXME: on mac os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
2286+ +DeadlockWatchdogThread::pause();
2287+#endif
2288+
22722289 // Set up the render engine
22732290 render::CullFunctor cullFunctor = LODManager::shouldRender;
22742291 static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
@@ -2283,6 +2300,10 @@ void Application::initializeGL() { · 8 unmodified lines
22832300 // Now that OpenGL is initialized, we are sure we have a valid context and can create the various pipeline shaders with success.
22842301 DependencyManager::get<GeometryCache>()->initializeShapePipelines();
22852302
2303+#ifdef Q_OS_OSX
2304+ DeadlockWatchdogThread::resume();
2305+#endif
2306+
22862307 _offscreenContext = new OffscreenGLCanvas();
22872308 _offscreenContext->setObjectName("MainThreadContext");
22882309 _offscreenContext->create(_glWidget->qglContext());

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