diff options
author | Don Kjer <don@lindenlab.com> | 2011-05-17 21:01:36 +0000 |
---|---|---|
committer | Don Kjer <don@lindenlab.com> | 2011-05-17 21:01:36 +0000 |
commit | 0a86e39d90e06f0a690b1ff5caf2dee5fe347f8f (patch) | |
tree | c0e4f0df907c3f876dafdab3caa83e9356434fa9 /indra/newview/llappviewer.cpp | |
parent | ae8ed3fc2d4a7dda92ad8fdb34bc559478eb9177 (diff) | |
parent | 79459bc9ba8cefa67091e65dd676f50c9ddc612d (diff) |
Merge with viewer-development (mesh)
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 108 |
1 files changed, 84 insertions, 24 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2b2afb65db..5e3ed4e35f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -46,6 +46,7 @@ #include "llviewerstats.h" #include "llviewerstatsrecorder.h" #include "llmd5.h" +#include "llmeshrepository.h" #include "llpumpio.h" #include "llmimetypes.h" #include "llslurl.h" @@ -75,6 +76,8 @@ #include "llteleporthistory.h" #include "lllocationhistory.h" #include "llfasttimerview.h" +#include "llvector4a.h" +#include "llviewermenufile.h" #include "llvoicechannel.h" #include "llvoavatarself.h" #include "llsidetray.h" @@ -200,7 +203,6 @@ // Include for security api initialization #include "llsecapi.h" #include "llmachineid.h" - #include "llmainlooprepeater.h" // *FIX: These extern globals should be cleaned up. @@ -306,7 +308,7 @@ BOOL gLogoutInProgress = FALSE; //////////////////////////////////////////////////////////// // Internal globals... that should be removed. -static std::string gArgs; +static std::string gArgs = "Mesh Beta"; const std::string MARKER_FILE_NAME("SecondLife.exec_marker"); const std::string ERROR_MARKER_FILE_NAME("SecondLife.error_marker"); @@ -506,8 +508,8 @@ static void settings_to_globals() LLSelectMgr::sRenderHiddenSelections = gSavedSettings.getBOOL("RenderHiddenSelections"); LLSelectMgr::sRenderLightRadius = gSavedSettings.getBOOL("RenderLightRadius"); - gAgentPilot.mNumRuns = gSavedSettings.getS32("StatsNumRuns"); - gAgentPilot.mQuitAfterRuns = gSavedSettings.getBOOL("StatsQuitAfterRuns"); + gAgentPilot.setNumRuns(gSavedSettings.getS32("StatsNumRuns")); + gAgentPilot.setQuitAfterRuns(gSavedSettings.getBOOL("StatsQuitAfterRuns")); gAgent.setHideGroupTitle(gSavedSettings.getBOOL("RenderHideGroupTitle")); gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); @@ -517,7 +519,8 @@ static void settings_to_globals() static void settings_modify() { - LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderUseFBO"); + LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderDeferred"); + LLPipeline::sRenderDeferred = gSavedSettings.getBOOL("RenderDeferred"); LLVOAvatar::sUseImpostors = gSavedSettings.getBOOL("RenderUseImpostors"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] @@ -568,7 +571,7 @@ public: std::string mFile; LLFastTimerLogThread(std::string& test_name) : LLThread("fast timer log") - { + { std::string file_name = test_name + std::string(".slp"); mFile = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, file_name); } @@ -586,7 +589,6 @@ public: os.close(); } - }; //virtual @@ -672,6 +674,9 @@ bool LLAppViewer::init() // LLFastTimer::reset(); + // initialize SSE options + LLVector4a::initClass(); + // Need to do this initialization before we do anything else, since anything // that touches files should really go through the lldir API gDirUtilp->initAppDirs("SecondLife"); @@ -888,7 +893,7 @@ bool LLAppViewer::init() // Initialize the repeater service. LLMainLoopRepeater::instance().start(); - + // // Initialize the window // @@ -935,6 +940,18 @@ bool LLAppViewer::init() return 0; } + // Without SSE2 support we will crash almost immediately, warn here. + if (!gSysCPU.hasSSE2()) + { + // can't use an alert here since we're exiting and + // all hell breaks lose. + OSMessageBox( + LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"), + LLStringUtil::null, + OSMB_OK); + return 0; + } + // alert the user if they are using unsupported hardware if(!gSavedSettings.getBOOL("AlertedUnsupportedHardware")) { @@ -994,7 +1011,7 @@ bool LLAppViewer::init() gDebugInfo["GraphicsCard"] = LLFeatureManager::getInstance()->getGPUString(); // Save the current version to the prefs file - gSavedSettings.setString("LastRunVersion", + gSavedSettings.setString("LastRunVersion", LLVersionInfo::getChannelAndVersion()); gSimLastTime = gRenderStartTime.getElapsedTimeF32(); @@ -1072,7 +1089,7 @@ bool LLAppViewer::mainLoop() gServicePump = new LLPumpIO(gAPRPoolp); LLHTTPClient::setPump(*gServicePump); LLCurl::setCAFile(gDirUtilp->getCAFile()); - + // Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be instantiated. LLVoiceChannel::initClass(); @@ -1316,6 +1333,7 @@ bool LLAppViewer::mainLoop() break; } } + gMeshRepo.update() ; if(!total_work_pending) //pause texture fetching threads if nothing to process. { @@ -1421,6 +1439,20 @@ bool LLAppViewer::cleanup() // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); + if (LLFastTimerView::sAnalyzePerformance) + { + llinfos << "Analyzing performance" << llendl; + std::string baseline_name = LLFastTimer::sLogName + "_baseline.slp"; + std::string current_name = LLFastTimer::sLogName + ".slp"; + std::string report_name = LLFastTimer::sLogName + "_report.csv"; + + LLFastTimerView::doAnalysis( + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, current_name), + gDirUtilp->getExpandedFilename(LL_PATH_LOGS, report_name)); + } + LLMetricPerformanceTesterBasic::cleanClass(); + // remove any old breakpad minidump files from the log directory if (! isError()) { @@ -1459,6 +1491,9 @@ bool LLAppViewer::cleanup() llinfos << "Cleaning Up" << llendflush; + // shut down mesh streamer + gMeshRepo.shutdown(); + // Must clean up texture references before viewer window is destroyed. if(LLHUDManager::instanceExists()) { @@ -1727,6 +1762,8 @@ bool LLAppViewer::cleanup() sTextureFetch->shutDownTextureCacheThread() ; sTextureFetch->shutDownImageDecodeThread() ; + LLFilePickerThread::cleanupClass(); + delete sTextureCache; sTextureCache = NULL; delete sTextureFetch; @@ -1748,7 +1785,8 @@ bool LLAppViewer::cleanup() gDirUtilp->getExpandedFilename(LL_PATH_LOGS, baseline_name), gDirUtilp->getExpandedFilename(LL_PATH_LOGS, current_name), gDirUtilp->getExpandedFilename(LL_PATH_LOGS, report_name)); - } + } + LLMetricPerformanceTesterBasic::cleanClass() ; #if LL_RECORD_VIEWER_STATS @@ -1876,6 +1914,11 @@ bool LLAppViewer::initThreads() mFastTimerLogThread->start(); } + // Mesh streaming and caching + gMeshRepo.init(); + + LLFilePickerThread::initClass(); + // *FIX: no error handling here! return true; } @@ -2088,6 +2131,8 @@ bool LLAppViewer::initConfiguration() gSavedSettings.setString("ClientSettingsFile", gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Global"))); + gSavedSettings.setString("VersionChannelName", LLVersionInfo::getChannel()); + #ifndef LL_RELEASE_FOR_DOWNLOAD // provide developer build only overrides for these control variables that are not // persisted to settings.xml @@ -2258,7 +2303,6 @@ bool LLAppViewer::initConfiguration() { LLVersionInfo::resetChannel(clp.getOption("channel")[0]); } - // If we have specified crash on startup, set the global so we'll trigger the crash at the right time if(clp.hasOption("crashonstartup")) @@ -2269,12 +2313,12 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("logperformance")) { LLFastTimer::sLog = TRUE; - LLFastTimer::sLogName = std::string("performance"); + LLFastTimer::sLogName = std::string("performance"); } if (clp.hasOption("logmetrics")) - { - LLFastTimer::sMetricLog = TRUE ; + { + LLFastTimer::sMetricLog = TRUE ; // '--logmetrics' can be specified with a named test metric argument so the data gathering is done only on that test // In the absence of argument, every metric is gathered (makes for a rather slow run and hard to decipher report...) std::string test_name = clp.getOption("logmetrics")[0]; @@ -2288,7 +2332,7 @@ bool LLAppViewer::initConfiguration() { LLFastTimer::sLogName = test_name; } - } + } if (clp.hasOption("graphicslevel")) { @@ -2331,7 +2375,7 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("replaysession")) { - LLAgentPilot::sReplaySession = TRUE; + gAgentPilot.setReplaySession(TRUE); } if (clp.hasOption("nonotifications")) @@ -2539,7 +2583,7 @@ bool LLAppViewer::initConfiguration() namespace { // *TODO - decide if there's a better place for these functions. - // do we need a file llupdaterui.cpp or something? -brad + // do we need a file llupdaterui.cpp or something? -brad void apply_update_callback(LLSD const & notification, LLSD const & response) { @@ -2632,8 +2676,8 @@ namespace { LLAppViewer::instance()->forceQuit(); } - bool notify_update(LLSD const & evt) - { + bool notify_update(LLSD const & evt) + { std::string notification_name; switch (evt["type"].asInteger()) { @@ -2652,8 +2696,8 @@ namespace { } // let others also handle this event by default - return false; - } + return false; + } bool on_bandwidth_throttle(LLUpdaterService * updater, LLSD const & evt) { @@ -2810,6 +2854,7 @@ bool LLAppViewer::initWindow() gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); gPipeline.init(); + stop_glerror(); gViewerWindow->initGLDefaults(); @@ -2884,7 +2929,7 @@ void LLAppViewer::cleanupSavedSettings() if (!maximized) { LLCoordScreen window_pos; - + if (gViewerWindow->mWindow->getPosition(&window_pos)) { gSavedSettings.setS32("WindowX", window_pos.mX); @@ -2974,6 +3019,8 @@ void LLAppViewer::writeSystemInfo() LL_INFOS("SystemInfo") << "OS: " << getOSInfo().getOSStringSimple() << LL_ENDL; LL_INFOS("SystemInfo") << "OS info: " << getOSInfo() << LL_ENDL; + LL_INFOS("SystemInfo") << "Timers: " << LLFastTimer::sClockType << LL_ENDL; + writeDebugInfo(); // Save out debug_info.log early, in case of crash. } @@ -3946,6 +3993,8 @@ static LLFastTimer::DeclareTimer FTM_OBJECTLIST_UPDATE("Update Objectlist"); static LLFastTimer::DeclareTimer FTM_REGION_UPDATE("Update Region"); static LLFastTimer::DeclareTimer FTM_WORLD_UPDATE("Update World"); static LLFastTimer::DeclareTimer FTM_NETWORK("Network"); +static LLFastTimer::DeclareTimer FTM_AGENT_NETWORK("Agent Network"); +static LLFastTimer::DeclareTimer FTM_VLMANAGER("VL Manager"); /////////////////////////////////////////////////////// // idle() @@ -3966,6 +4015,8 @@ void LLAppViewer::idle() LLEventTimer::updateClass(); LLCriticalDamp::updateInterpolants(); LLMortician::updateClass(); + LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() + F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); // Cap out-of-control frame times @@ -4301,8 +4352,12 @@ void LLAppViewer::idle() LLWorld::getInstance()->updateParticles(); - if (LLViewerJoystick::getInstance()->getOverrideCamera()) + if (gAgentPilot.isPlaying() && gAgentPilot.getOverrideCamera()) { + gAgentPilot.moveCamera(); + } + else if (LLViewerJoystick::getInstance()->getOverrideCamera()) + { LLViewerJoystick::getInstance()->moveFlycam(); } else @@ -4540,6 +4595,11 @@ static F32 CheckMessagesMaxTime = CHECK_MESSAGES_DEFAULT_MAX_TIME; #endif static LLFastTimer::DeclareTimer FTM_IDLE_NETWORK("Idle Network"); +static LLFastTimer::DeclareTimer FTM_MESSAGE_ACKS("Message Acks"); +static LLFastTimer::DeclareTimer FTM_RETRANSMIT("Retransmit"); +static LLFastTimer::DeclareTimer FTM_TIMEOUT_CHECK("Timeout Check"); +static LLFastTimer::DeclareTimer FTM_DYNAMIC_THROTTLE("Dynamic Throttle"); +static LLFastTimer::DeclareTimer FTM_CHECK_REGION_CIRCUIT("Check Region Circuit"); void LLAppViewer::idleNetwork() { |