diff options
Diffstat (limited to 'indra/newview/llappviewer.cpp')
| -rw-r--r-- | indra/newview/llappviewer.cpp | 83 | 
1 files changed, 48 insertions, 35 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ac9464d86e..9eb0d3fade 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -993,6 +993,7 @@ bool LLAppViewer::init()          return false;      } +#if defined(LL_X86) || defined(LL_X86_64)      // Without SSE2 support we will crash almost immediately, warn here.      if (!gSysCPU.hasSSE2())      { @@ -1004,6 +1005,7 @@ bool LLAppViewer::init()          // quit immediately          return false;      } +#endif      // alert the user if they are using unsupported hardware      if (!gSavedSettings.getBOOL("AlertedUnsupportedHardware")) @@ -1289,7 +1291,7 @@ void LLAppViewer::initMaxHeapSize()      //------------------------------------------------------------------------------------------      //currently SL is built under 32-bit setting, we set its max heap size no more than 1.6 GB. - #ifndef LL_X86_64 + #if !defined(LL_X86_64) && !defined(LL_ARM64)      F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize") ;  #else      F32Gigabytes max_heap_size_gb = (F32Gigabytes)gSavedSettings.getF32("MaxHeapSize64"); @@ -1352,6 +1354,7 @@ bool LLAppViewer::doFrame()  #endif      LL_RECORD_BLOCK_TIME(FTM_FRAME); +    LL_PROFILE_GPU_ZONE("Frame");      {      // and now adjust the visuals from previous frame.      if(LLPerfStats::tunables.userAutoTuneEnabled && LLPerfStats::tunables.tuningFlag != LLPerfStats::Tunables::Nothing) @@ -1441,24 +1444,26 @@ bool LLAppViewer::doFrame()          if (!LLApp::isExiting())          { -            LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df JoystickKeyboard"); -            pingMainloopTimeout("Main:JoystickKeyboard"); - -            // Scan keyboard for movement keys.  Command keys and typing -            // are handled by windows callbacks.  Don't do this until we're -            // done initializing.  JC -            if (gViewerWindow -                && (gHeadlessClient || gViewerWindow->getWindow()->getVisible()) -                && gViewerWindow->getActive() -                && !gViewerWindow->getWindow()->getMinimized() -                && LLStartUp::getStartupState() == STATE_STARTED -                && (gHeadlessClient || !gViewerWindow->getShowProgress()) -                && !gFocusMgr.focusLocked())              { -                LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_IDLE); -                joystick->scanJoystick(); -                gKeyboard->scanKeyboard(); -                gViewerInput.scanMouse(); +                LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df JoystickKeyboard"); +                pingMainloopTimeout("Main:JoystickKeyboard"); + +                // Scan keyboard for movement keys.  Command keys and typing +                // are handled by windows callbacks.  Don't do this until we're +                // done initializing.  JC +                if (gViewerWindow +                    && (gHeadlessClient || gViewerWindow->getWindow()->getVisible()) +                    && gViewerWindow->getActive() +                    && !gViewerWindow->getWindow()->getMinimized() +                    && LLStartUp::getStartupState() == STATE_STARTED +                    && (gHeadlessClient || !gViewerWindow->getShowProgress()) +                    && !gFocusMgr.focusLocked()) +                { +                    LLPerfStats::RecordSceneTime T(LLPerfStats::StatType_t::RENDER_IDLE); +                    joystick->scanJoystick(); +                    gKeyboard->scanKeyboard(); +                    gViewerInput.scanMouse(); +                }              }              // Update state based on messages, user input, object idle. @@ -3167,17 +3172,6 @@ bool LLAppViewer::initWindow()      LLNotificationsUI::LLNotificationManager::getInstance(); - -#ifdef LL_DARWIN -    //Satisfy both MAINT-3135 (OSX 10.6 and earlier) MAINT-3288 (OSX 10.7 and later) -    LLOSInfo& os_info = LLOSInfo::instance(); -    if (os_info.mMajorVer == 10 && os_info.mMinorVer < 7) -    { -        if ( os_info.mMinorVer == 6 && os_info.mBuild < 8 ) -            gViewerWindow->getWindow()->setOldResize(true); -    } -#endif -      if (gSavedSettings.getBOOL("WindowMaximized"))      {          gViewerWindow->getWindow()->maximize(); @@ -3292,6 +3286,11 @@ LLSD LLAppViewer::getViewerInfo() const      info["VIEWER_VERSION_STR"] = versionInfo.getVersion();      info["CHANNEL"] = versionInfo.getChannel();      info["ADDRESS_SIZE"] = ADDRESS_SIZE; +#if LL_ARM64 +    info["ARCHITECTURE"] = "ARM"; +#else +    info["ARCHITECTURE"] = "x86"; +#endif      std::string build_config = versionInfo.getBuildConfig();      if (build_config != "Release")      { @@ -4426,6 +4425,9 @@ bool LLAppViewer::initCache()      const U32 CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS = 128;      LLVOCache::getInstance()->initCache(LL_PATH_CACHE, CACHE_NUMBER_OF_REGIONS_FOR_OBJECTS, getObjectCacheVersion()); +    // Remove old, stale CEF cache folders +    purgeCefStaleCaches(); +      return true;  } @@ -4450,18 +4452,27 @@ void LLAppViewer::loadKeyBindings()      LLUrlRegistry::instance().setKeybindingHandler(&gViewerInput);  } +// As per GHI #4498, remove old, stale CEF cache folders from previous sessions +void LLAppViewer::purgeCefStaleCaches() +{ +    // TODO: we really shouldn't use a hard coded name for the cache folder here... +    const std::string browser_parent_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache"); +    if (LLFile::isdir(browser_parent_cache)) +    { +        // This is a sledgehammer approach - nukes the cef_cache dir entirely +        // which is then recreated the first time a CEF instance creates an +        // individual cache folder. If we ever decide to retain some folders +        // e.g. Search UI cache - then we will need a more granular approach. +        gDirUtilp->deleteDirAndContents(browser_parent_cache); +    } +} +  void LLAppViewer::purgeCache()  {      LL_INFOS("AppCache") << "Purging Cache and Texture Cache..." << LL_ENDL;      LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE);      LLVOCache::getInstance()->removeCache(LL_PATH_CACHE);      LLViewerShaderMgr::instance()->clearShaderCache(); -    std::string browser_cache = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "cef_cache"); -    if (LLFile::isdir(browser_cache)) -    { -        // cef does not support clear_cache and clear_cookies, so clear what we can manually. -        gDirUtilp->deleteDirAndContents(browser_cache); -    }      gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""), "*");  } @@ -5647,8 +5658,10 @@ void LLAppViewer::forceErrorBreakpoint()  #ifdef LL_WINDOWS      DebugBreak();  #else +#if defined(LL_X86) || defined(LL_X86_64)      asm ("int $3");  #endif +#endif      return;  }  | 
