mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 14:02:57 +02:00
commit
92b60fdd9c
3 changed files with 38 additions and 26 deletions
|
@ -307,8 +307,12 @@ static QTimer locationUpdateTimer;
|
||||||
static QTimer identityPacketTimer;
|
static QTimer identityPacketTimer;
|
||||||
static QTimer pingTimer;
|
static QTimer pingTimer;
|
||||||
|
|
||||||
static const QString DISABLE_WATCHDOG_FLAG("HIFI_DISABLE_WATCHDOG");
|
#if defined(Q_OS_ANDROID)
|
||||||
static bool DISABLE_WATCHDOG = QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG);
|
static bool DISABLE_WATCHDOG = true;
|
||||||
|
#else
|
||||||
|
static const QString DISABLE_WATCHDOG_FLAG{ "HIFI_DISABLE_WATCHDOG" };
|
||||||
|
static bool DISABLE_WATCHDOG = nsightActive() || QProcessEnvironment::systemEnvironment().contains(DISABLE_WATCHDOG_FLAG);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16;
|
static const int MAX_CONCURRENT_RESOURCE_DOWNLOADS = 16;
|
||||||
|
@ -398,20 +402,26 @@ public:
|
||||||
*crashTrigger = 0xDEAD10CC;
|
*crashTrigger = 0xDEAD10CC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void withPause(const std::function<void()>& lambda) {
|
||||||
|
pause();
|
||||||
|
lambda();
|
||||||
|
resume();
|
||||||
|
}
|
||||||
static void pause() {
|
static void pause() {
|
||||||
_paused = true;
|
_paused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void resume() {
|
static void resume() {
|
||||||
_paused = false;
|
// Update the heartbeat BEFORE resuming the checks
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
_paused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void run() override {
|
void run() override {
|
||||||
while (!_quit) {
|
while (!_quit) {
|
||||||
QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
|
QThread::sleep(HEARTBEAT_UPDATE_INTERVAL_SECS);
|
||||||
// Don't do heartbeat detection under nsight
|
// Don't do heartbeat detection under nsight
|
||||||
if (nsightActive() || _paused) {
|
if (_paused) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
|
uint64_t lastHeartbeat = _heartbeat; // sample atomic _heartbeat, because we could context switch away and have it updated on us
|
||||||
|
@ -1103,9 +1113,6 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo
|
||||||
// Make sure we don't time out during slow operations at startup
|
// Make sure we don't time out during slow operations at startup
|
||||||
updateHeartbeat();
|
updateHeartbeat();
|
||||||
|
|
||||||
// Now that OpenGL is initialized, we are sure we have a valid context and can create the various pipeline shaders with success.
|
|
||||||
DependencyManager::get<GeometryCache>()->initializeShapePipelines();
|
|
||||||
|
|
||||||
// sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value.
|
// sessionRunTime will be reset soon by loadSettings. Grab it now to get previous session value.
|
||||||
// The value will be 0 if the user blew away settings this session, which is both a feature and a bug.
|
// The value will be 0 if the user blew away settings this session, which is both a feature and a bug.
|
||||||
static const QString TESTER = "HIFI_TESTER";
|
static const QString TESTER = "HIFI_TESTER";
|
||||||
|
@ -2220,25 +2227,21 @@ void Application::initializeGL() {
|
||||||
initDisplay();
|
initDisplay();
|
||||||
qCDebug(interfaceapp, "Initialized Display.");
|
qCDebug(interfaceapp, "Initialized Display.");
|
||||||
|
|
||||||
#ifdef Q_OS_OSX
|
// FIXME: on low end systems os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
|
||||||
// FIXME: on mac os the shaders take up to 1 minute to compile, so we pause the deadlock watchdog thread.
|
DeadlockWatchdogThread::withPause([&] {
|
||||||
DeadlockWatchdogThread::pause();
|
// Set up the render engine
|
||||||
#endif
|
render::CullFunctor cullFunctor = LODManager::shouldRender;
|
||||||
|
static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
|
||||||
|
bool isDeferred = !QProcessEnvironment::systemEnvironment().contains(RENDER_FORWARD);
|
||||||
|
_renderEngine->addJob<UpdateSceneTask>("UpdateScene");
|
||||||
|
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor);
|
||||||
|
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, isDeferred);
|
||||||
|
_renderEngine->load();
|
||||||
|
_renderEngine->registerScene(_main3DScene);
|
||||||
|
|
||||||
// Set up the render engine
|
// Now that OpenGL is initialized, we are sure we have a valid context and can create the various pipeline shaders with success.
|
||||||
render::CullFunctor cullFunctor = LODManager::shouldRender;
|
DependencyManager::get<GeometryCache>()->initializeShapePipelines();
|
||||||
static const QString RENDER_FORWARD = "HIFI_RENDER_FORWARD";
|
});
|
||||||
bool isDeferred = !QProcessEnvironment::systemEnvironment().contains(RENDER_FORWARD);
|
|
||||||
_renderEngine->addJob<UpdateSceneTask>("UpdateScene");
|
|
||||||
_renderEngine->addJob<SecondaryCameraRenderTask>("SecondaryCameraJob", cullFunctor);
|
|
||||||
_renderEngine->addJob<RenderViewTask>("RenderMainView", cullFunctor, isDeferred);
|
|
||||||
|
|
||||||
#ifdef Q_OS_OSX
|
|
||||||
DeadlockWatchdogThread::resume();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_renderEngine->load();
|
|
||||||
_renderEngine->registerScene(_main3DScene);
|
|
||||||
|
|
||||||
_offscreenContext = new OffscreenGLCanvas();
|
_offscreenContext = new OffscreenGLCanvas();
|
||||||
_offscreenContext->setObjectName("MainThreadContext");
|
_offscreenContext->setObjectName("MainThreadContext");
|
||||||
|
@ -2337,7 +2340,9 @@ void Application::initializeUi() {
|
||||||
tabletScriptingInterface->getTablet(SYSTEM_TABLET);
|
tabletScriptingInterface->getTablet(SYSTEM_TABLET);
|
||||||
}
|
}
|
||||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||||
|
DeadlockWatchdogThread::pause();
|
||||||
offscreenUi->create();
|
offscreenUi->create();
|
||||||
|
DeadlockWatchdogThread::resume();
|
||||||
|
|
||||||
auto surfaceContext = offscreenUi->getSurfaceContext();
|
auto surfaceContext = offscreenUi->getSurfaceContext();
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ void Application::paintGL() {
|
||||||
// If a display plugin loses it's underlying support, it
|
// If a display plugin loses it's underlying support, it
|
||||||
// needs to be able to signal us to not use it
|
// needs to be able to signal us to not use it
|
||||||
if (!displayPlugin->beginFrameRender(_renderFrameCount)) {
|
if (!displayPlugin->beginFrameRender(_renderFrameCount)) {
|
||||||
updateDisplayMode();
|
QMetaObject::invokeMethod(this, "updateDisplayMode");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -342,6 +342,13 @@ void Scene::updateItems(const Transaction::Updates& transactions) {
|
||||||
|
|
||||||
// Access the true item
|
// Access the true item
|
||||||
auto& item = _items[updateID];
|
auto& item = _items[updateID];
|
||||||
|
|
||||||
|
// If item doesn't exist it cannot be updated
|
||||||
|
if (!item.exist()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Good to go, deal with the update
|
||||||
auto oldCell = item.getCell();
|
auto oldCell = item.getCell();
|
||||||
auto oldKey = item.getKey();
|
auto oldKey = item.getKey();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue