From aa358035a3553e382128c62d24755b7dce2a8278 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 20 Apr 2021 10:49:33 -0600 Subject: DRTVWR-528 remove wrapper code for RAD telemetry library --- indra/newview/llappviewer.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 891722e1bd..79f1cc0e8f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -91,7 +91,6 @@ #include "llsdutil_math.h" #include "lllocationhistory.h" #include "llfasttimerview.h" -#include "lltelemetry.h" #include "llvector4a.h" #include "llviewermenufile.h" #include "llvoicechannel.h" @@ -1668,8 +1667,6 @@ bool LLAppViewer::doFrame() LL_INFOS() << "Exiting main_loop" << LL_ENDL; } - LLPROFILE_UPDATE(); - return ! LLApp::isRunning(); } -- cgit v1.2.3 From df5127136f9f520aa31c06ddb37ac79b6a8dc16d Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 27 Jul 2021 15:31:15 -0700 Subject: SL-15709: Add Tracy support to viewer --- indra/newview/llappviewer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 79f1cc0e8f..94f0b31ecd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1667,6 +1667,8 @@ bool LLAppViewer::doFrame() LL_INFOS() << "Exiting main_loop" << LL_ENDL; } + LL_PROFILER_FRAME_END + return ! LLApp::isRunning(); } -- cgit v1.2.3 From 4ab77cdb60465d655a05cf7f1e9de73867284ac1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 16 Sep 2021 18:39:02 +0100 Subject: SL-15999 - throttle frame rate even more when noninteractive --- indra/newview/llappviewer.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 891722e1bd..6ff9b2b2eb 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1557,6 +1557,15 @@ bool LLAppViewer::doFrame() ms_sleep(yield_time); } + static LLCachedControl s_non_interactive(gSavedSettings, "NonInteractive", false); + if (s_non_interactive) + { + S32 non_interactive_ms_sleep_time = 1000; + LLAppViewer::getTextureCache()->pause(); + LLAppViewer::getImageDecodeThread()->pause(); + ms_sleep(non_interactive_ms_sleep_time); + } + // yield cooperatively when not running as foreground window // and when not quiting (causes trouble at mac's cleanup stage) if (!LLApp::isExiting() -- cgit v1.2.3 From c10d601ce8d2a6ca7e354772a217a998cd9865b3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 20 Sep 2021 13:19:20 +0100 Subject: SL-15999 - track --noninteractive state with gNonInteractive flag --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6ff9b2b2eb..970bc0a83d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1557,8 +1557,7 @@ bool LLAppViewer::doFrame() ms_sleep(yield_time); } - static LLCachedControl s_non_interactive(gSavedSettings, "NonInteractive", false); - if (s_non_interactive) + if (gNonInteractive) { S32 non_interactive_ms_sleep_time = 1000; LLAppViewer::getTextureCache()->pause(); @@ -2979,6 +2978,7 @@ bool LLAppViewer::initWindow() // store setting in a global for easy access and modification gHeadlessClient = gSavedSettings.getBOOL("HeadlessClient"); + gNonInteractive = gSavedSettings.getBOOL("NonInteractive"); // always start windowed BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); -- cgit v1.2.3 From 9bb566ea26c7fd5d93b5b42a9ee3f4aba92ebf7a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 20 Sep 2021 14:03:19 +0100 Subject: SL-15999 - support for temporarily changing other settings while noninteractive, including a fix for unwanted SLURL redirects --- indra/newview/llappviewer.cpp | 68 ++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 970bc0a83d..eab91f5d02 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2439,6 +2439,37 @@ namespace } } // anonymous namespace +// Set a named control temporarily for this session, as when set via the command line --set option. +bool tempSetControl(const std::string& name, const std::string& value) +{ + std::string name_part; + std::string group_part; + LLControlVariable* control = NULL; + + // Name can be further split into ControlGroup.Name, with the default control group being Global + size_t pos = name.find('.'); + if (pos != std::string::npos) + { + group_part = name.substr(0, pos); + name_part = name.substr(pos+1); + LL_INFOS() << "Setting " << group_part << "." << name_part << " to " << value << LL_ENDL; + LLControlGroup* g = LLControlGroup::getInstance(group_part); + if (g) control = g->getControl(name_part); + } + else + { + LL_INFOS() << "Setting Global." << name << " to " << value << LL_ENDL; + control = gSavedSettings.getControl(name); + } + + if (control) + { + control->setValue(value, false); + return true; + } + return false; +} + bool LLAppViewer::initConfiguration() { //Load settings files list @@ -2635,34 +2666,10 @@ bool LLAppViewer::initConfiguration() { const std::string& name = *itr; const std::string& value = *(++itr); - std::string name_part; - std::string group_part; - LLControlVariable* control = NULL; - - // Name can be further split into ControlGroup.Name, with the default control group being Global - size_t pos = name.find('.'); - if (pos != std::string::npos) + if (!tempSetControl(name,value)) { - group_part = name.substr(0, pos); - name_part = name.substr(pos+1); - LL_INFOS() << "Setting " << group_part << "." << name_part << " to " << value << LL_ENDL; - LLControlGroup* g = LLControlGroup::getInstance(group_part); - if (g) control = g->getControl(name_part); - } - else - { - LL_INFOS() << "Setting Global." << name << " to " << value << LL_ENDL; - control = gSavedSettings.getControl(name); - } - - if (control) - { - control->setValue(value, false); - } - else - { LL_WARNS() << "Failed --set " << name << ": setting name unknown." << LL_ENDL; - } + } } } } @@ -2747,6 +2754,14 @@ bool LLAppViewer::initConfiguration() } } + gNonInteractive = gSavedSettings.getBOOL("NonInteractive"); + if (gNonInteractive) + { + tempSetControl("SLURLPassToOtherInstance", "FALSE"); + llassert_always(!gSavedSettings.getBOOL("SLURLPassToOtherInstance")); + } + + // Handle slurl use. NOTE: Don't let SL-55321 reappear. // This initial-SLURL logic, up through the call to // sendURLToOtherInstance(), must precede LLSplashScreen::show() -- @@ -2978,7 +2993,6 @@ bool LLAppViewer::initWindow() // store setting in a global for easy access and modification gHeadlessClient = gSavedSettings.getBOOL("HeadlessClient"); - gNonInteractive = gSavedSettings.getBOOL("NonInteractive"); // always start windowed BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); -- cgit v1.2.3 From 014dd037dde0a93f6c591618e4c111c6b598b60e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 20 Sep 2021 21:22:17 +0000 Subject: SL-16043 Fix DisableVerticalSync, default DisableVerticalSync to off, remove broken frame limiter code (use vsync if you want to limit framerate). --- indra/newview/llappviewer.cpp | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 94f0b31ecd..a71ef69512 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -694,8 +694,7 @@ LLAppViewer::LLAppViewer() mPeriodicSlowFrame(LLCachedControl(gSavedSettings,"Periodic Slow Frame", FALSE)), mFastTimerLogThread(NULL), mSettingsLocationList(NULL), - mIsFirstRun(false), - mMinMicroSecPerFrame(0.f) + mIsFirstRun(false) { if(NULL != sInstance) { @@ -1326,10 +1325,6 @@ bool LLAppViewer::init() joystick = LLViewerJoystick::getInstance(); joystick->setNeedsReset(true); /*----------------------------------------------------------------------*/ - - gSavedSettings.getControl("FramePerSecondLimit")->getSignal()->connect(boost::bind(&LLAppViewer::onChangeFrameLimit, this, _2)); - onChangeFrameLimit(gSavedSettings.getLLSD("FramePerSecondLimit")); - // Load User's bindings loadKeyBindings(); @@ -1518,21 +1513,6 @@ bool LLAppViewer::doFrame() display(); - static U64 last_call = 0; - if (!gTeleportDisplay) - { - // Frame/draw throttling, controlled by FramePerSecondLimit - U64 elapsed_time = LLTimer::getTotalTime() - last_call; - if (elapsed_time < mMinMicroSecPerFrame) - { - LL_RECORD_BLOCK_TIME(FTM_SLEEP); - // llclamp for when time function gets funky - U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6); - micro_sleep(sleep_time, 0); - } - } - last_call = LLTimer::getTotalTime(); - pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); @@ -5613,19 +5593,6 @@ void LLAppViewer::disconnectViewer() LLUrlEntryParcel::setDisconnected(gDisconnected); } -bool LLAppViewer::onChangeFrameLimit(LLSD const & evt) -{ - if (evt.asInteger() > 0) - { - mMinMicroSecPerFrame = (U64)(1000000.0f / F32(evt.asInteger())); - } - else - { - mMinMicroSecPerFrame = 0; - } - return false; -} - void LLAppViewer::forceErrorLLError() { LL_ERRS() << "This is a deliberate llerror" << LL_ENDL; -- cgit v1.2.3 From a0157baf08ab5a4ac3f667520e18a796a11b9ad7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Sep 2021 17:01:57 +0100 Subject: SL-15999 - try to force non-interactive agents to always start out standing --- indra/newview/llappviewer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index eab91f5d02..b6446e40ac 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2440,6 +2440,7 @@ namespace } // anonymous namespace // Set a named control temporarily for this session, as when set via the command line --set option. +// Name can be specified as ".", with default group being Global. bool tempSetControl(const std::string& name, const std::string& value) { std::string name_part; -- cgit v1.2.3 From c0eadc87e8bc8ce5658f49a960af4868a0865ddc Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 15 Sep 2021 17:44:09 -0700 Subject: SL-16014: Add Tracy logging to doFrame() --- indra/newview/llappviewer.cpp | 74 ++++++++++++++++++++++++++++++++----------- 1 file changed, 56 insertions(+), 18 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 94f0b31ecd..ab2b846c09 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1424,9 +1424,13 @@ bool LLAppViewer::doFrame() LLSD newFrame; LL_RECORD_BLOCK_TIME(FTM_FRAME); - LLTrace::BlockTimer::processTimes(); - LLTrace::get_frame_recording().nextPeriod(); - LLTrace::BlockTimer::logStats(); + + { + LL_PROFILE_ZONE_NAMED( ":blocktimer" ) + LLTrace::BlockTimer::processTimes(); + LLTrace::get_frame_recording().nextPeriod(); + LLTrace::BlockTimer::logStats(); + } LLTrace::get_thread_recorder()->pullFromChildren(); @@ -1434,6 +1438,7 @@ bool LLAppViewer::doFrame() LL_CLEAR_CALLSTACKS(); { + LL_PROFILE_ZONE_NAMED( ":processMiscNativeEvents" ) pingMainloopTimeout("Main:MiscNativeWindowEvents"); if (gViewerWindow) @@ -1442,7 +1447,10 @@ bool LLAppViewer::doFrame() gViewerWindow->getWindow()->processMiscNativeEvents(); } - pingMainloopTimeout("Main:GatherInput"); + { + LL_PROFILE_ZONE_NAMED( ":gatherInput" ) + pingMainloopTimeout("Main:GatherInput"); + } if (gViewerWindow) { @@ -1466,13 +1474,21 @@ bool LLAppViewer::doFrame() } } - // canonical per-frame event - mainloop.post(newFrame); - // give listeners a chance to run - llcoro::suspend(); + { + LL_PROFILE_ZONE_NAMED( ":mainloop" ) + // canonical per-frame event + mainloop.post(newFrame); + } + + { + LL_PROFILE_ZONE_NAMED( ":suspend" ) + // give listeners a chance to run + llcoro::suspend(); + } if (!LLApp::isExiting()) { + LL_PROFILE_ZONE_NAMED( ":JoystickKeyboard" ) pingMainloopTimeout("Main:JoystickKeyboard"); // Scan keyboard for movement keys. Command keys and typing @@ -1493,12 +1509,18 @@ bool LLAppViewer::doFrame() // Update state based on messages, user input, object idle. { - pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds! + { + LL_PROFILE_ZONE_NAMED( ":pauseMainloopTimeout" ) + pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds! + } LL_RECORD_BLOCK_TIME(FTM_IDLE); idle(); - resumeMainloopTimeout(); + { + LL_PROFILE_ZONE_NAMED( ":resumeMainloopTimeout" ) + resumeMainloopTimeout(); + } } if (gDoDisconnect && (LLStartUp::getStartupState() == STATE_STARTED)) @@ -1513,6 +1535,7 @@ bool LLAppViewer::doFrame() // *TODO: Should we run display() even during gHeadlessClient? DK 2011-02-18 if (!LLApp::isExiting() && !gHeadlessClient && gViewerWindow) { + LL_PROFILE_ZONE_NAMED( ":Display" ) pingMainloopTimeout("Main:Display"); gGLActive = TRUE; @@ -1533,16 +1556,22 @@ bool LLAppViewer::doFrame() } last_call = LLTimer::getTotalTime(); - pingMainloopTimeout("Main:Snapshot"); - LLFloaterSnapshot::update(); // take snapshots + { + LL_PROFILE_ZONE_NAMED( ":Snapshot" ) + pingMainloopTimeout("Main:Snapshot"); + LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); - gGLActive = FALSE; + gGLActive = FALSE; + } } } - pingMainloopTimeout("Main:Sleep"); + { + LL_PROFILE_ZONE_NAMED( ":pauseMainloopTimeout" ) + pingMainloopTimeout("Main:Sleep"); - pauseMainloopTimeout(); + pauseMainloopTimeout(); + } // Sleep and run background threads { @@ -1615,16 +1644,22 @@ bool LLAppViewer::doFrame() total_io_pending += io_pending ; } - gMeshRepo.update() ; + + { + LL_PROFILE_ZONE_NAMED( ":gMeshRepo" ) + gMeshRepo.update() ; + } if(!total_work_pending) //pause texture fetching threads if nothing to process. { + LL_PROFILE_ZONE_NAMED( ":getTextureCache" ) LLAppViewer::getTextureCache()->pause(); LLAppViewer::getImageDecodeThread()->pause(); LLAppViewer::getTextureFetch()->pause(); } if(!total_io_pending) //pause file threads if nothing to process. { + LL_PROFILE_ZONE_NAMED( ":LLVFSThread" ) LLVFSThread::sLocal->pause(); LLLFSThread::sLocal->pause(); } @@ -1632,6 +1667,7 @@ bool LLAppViewer::doFrame() //texture fetching debugger if(LLTextureFetchDebugger::isEnabled()) { + LL_PROFILE_ZONE_NAMED( ":tex_fetch_debugger_instance" ) LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = LLFloaterReg::findTypedInstance("tex_fetch_debugger"); if(tex_fetch_debugger_instance) @@ -1640,8 +1676,10 @@ bool LLAppViewer::doFrame() } } - resumeMainloopTimeout(); - + { + LL_PROFILE_ZONE_NAMED( ":resumeMainloopTimeout" ) + resumeMainloopTimeout(); + } pingMainloopTimeout("Main:End"); } } -- cgit v1.2.3 From 5fa9b510293fc3a36776f75fa6e88aefe3233a94 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Mon, 20 Sep 2021 09:54:32 -0700 Subject: SL-16014: Add Tracy markup to doFrame() --- indra/newview/llappviewer.cpp | 48 ++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 21 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ab2b846c09..879cc6fc85 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1358,7 +1358,8 @@ void LLAppViewer::initMaxHeapSize() } static LLTrace::BlockTimerStatHandle FTM_MESSAGES("System Messages"); -static LLTrace::BlockTimerStatHandle FTM_SLEEP("Sleep"); +static LLTrace::BlockTimerStatHandle FTM_SLEEP1("Sleep1"); +static LLTrace::BlockTimerStatHandle FTM_SLEEP2("Sleep2"); static LLTrace::BlockTimerStatHandle FTM_YIELD("Yield"); static LLTrace::BlockTimerStatHandle FTM_TEXTURE_CACHE("Texture Cache"); @@ -1420,13 +1421,13 @@ bool LLAppViewer::frame() bool LLAppViewer::doFrame() { + LL_RECORD_BLOCK_TIME(FTM_FRAME); + LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); LLSD newFrame; - LL_RECORD_BLOCK_TIME(FTM_FRAME); - { - LL_PROFILE_ZONE_NAMED( ":blocktimer" ) + LL_PROFILE_ZONE_NAMED( "df blocktimer" ) LLTrace::BlockTimer::processTimes(); LLTrace::get_frame_recording().nextPeriod(); LLTrace::BlockTimer::logStats(); @@ -1438,7 +1439,7 @@ bool LLAppViewer::doFrame() LL_CLEAR_CALLSTACKS(); { - LL_PROFILE_ZONE_NAMED( ":processMiscNativeEvents" ) + LL_PROFILE_ZONE_NAMED( "df processMiscNativeEvents" ) pingMainloopTimeout("Main:MiscNativeWindowEvents"); if (gViewerWindow) @@ -1448,7 +1449,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( ":gatherInput" ) + LL_PROFILE_ZONE_NAMED( "df gatherInput" ) pingMainloopTimeout("Main:GatherInput"); } @@ -1475,20 +1476,20 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( ":mainloop" ) + LL_PROFILE_ZONE_NAMED( "df mainloop" ) // canonical per-frame event mainloop.post(newFrame); } { - LL_PROFILE_ZONE_NAMED( ":suspend" ) + LL_PROFILE_ZONE_NAMED( "df suspend" ) // give listeners a chance to run llcoro::suspend(); } if (!LLApp::isExiting()) { - LL_PROFILE_ZONE_NAMED( ":JoystickKeyboard" ) + LL_PROFILE_ZONE_NAMED( "df JoystickKeyboard" ) pingMainloopTimeout("Main:JoystickKeyboard"); // Scan keyboard for movement keys. Command keys and typing @@ -1510,7 +1511,7 @@ bool LLAppViewer::doFrame() // Update state based on messages, user input, object idle. { { - LL_PROFILE_ZONE_NAMED( ":pauseMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED( "df pauseMainloopTimeout" ) pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds! } @@ -1518,7 +1519,7 @@ bool LLAppViewer::doFrame() idle(); { - LL_PROFILE_ZONE_NAMED( ":resumeMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED( "df resumeMainloopTimeout" ) resumeMainloopTimeout(); } } @@ -1535,7 +1536,7 @@ bool LLAppViewer::doFrame() // *TODO: Should we run display() even during gHeadlessClient? DK 2011-02-18 if (!LLApp::isExiting() && !gHeadlessClient && gViewerWindow) { - LL_PROFILE_ZONE_NAMED( ":Display" ) + LL_PROFILE_ZONE_NAMED( "df Display" ) pingMainloopTimeout("Main:Display"); gGLActive = TRUE; @@ -1548,16 +1549,19 @@ bool LLAppViewer::doFrame() U64 elapsed_time = LLTimer::getTotalTime() - last_call; if (elapsed_time < mMinMicroSecPerFrame) { - LL_RECORD_BLOCK_TIME(FTM_SLEEP); + //LL_RECORD_BLOCK_TIME(FTM_SLEEP1); + LL_PROFILE_ZONE_WARN( "Sleep1" ) // llclamp for when time function gets funky U64 sleep_time = llclamp(mMinMicroSecPerFrame - elapsed_time, (U64)1, (U64)1e6); + + LL_PROFILE_ZONE_NUM( sleep_time ) micro_sleep(sleep_time, 0); } } last_call = LLTimer::getTotalTime(); { - LL_PROFILE_ZONE_NAMED( ":Snapshot" ) + LL_PROFILE_ZONE_NAMED( "df Snapshot" ) pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); @@ -1567,7 +1571,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( ":pauseMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED( "df pauseMainloopTimeout" ) pingMainloopTimeout("Main:Sleep"); pauseMainloopTimeout(); @@ -1575,13 +1579,15 @@ bool LLAppViewer::doFrame() // Sleep and run background threads { - LL_RECORD_BLOCK_TIME(FTM_SLEEP); + //LL_RECORD_BLOCK_TIME(SLEEP2); + LL_PROFILE_ZONE_WARN( "Sleep2" ) // yield some time to the os based on command line option static LLCachedControl yield_time(gSavedSettings, "YieldTime", -1); if(yield_time >= 0) { LL_RECORD_BLOCK_TIME(FTM_YIELD); + LL_PROFILE_ZONE_NUM( yield_time ) ms_sleep(yield_time); } @@ -1646,20 +1652,20 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( ":gMeshRepo" ) + LL_PROFILE_ZONE_NAMED( "df gMeshRepo" ) gMeshRepo.update() ; } if(!total_work_pending) //pause texture fetching threads if nothing to process. { - LL_PROFILE_ZONE_NAMED( ":getTextureCache" ) + LL_PROFILE_ZONE_NAMED( "df getTextureCache" ) LLAppViewer::getTextureCache()->pause(); LLAppViewer::getImageDecodeThread()->pause(); LLAppViewer::getTextureFetch()->pause(); } if(!total_io_pending) //pause file threads if nothing to process. { - LL_PROFILE_ZONE_NAMED( ":LLVFSThread" ) + LL_PROFILE_ZONE_NAMED( "df LLVFSThread" ) LLVFSThread::sLocal->pause(); LLLFSThread::sLocal->pause(); } @@ -1667,7 +1673,7 @@ bool LLAppViewer::doFrame() //texture fetching debugger if(LLTextureFetchDebugger::isEnabled()) { - LL_PROFILE_ZONE_NAMED( ":tex_fetch_debugger_instance" ) + LL_PROFILE_ZONE_NAMED( "df tex_fetch_debugger_instance" ) LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = LLFloaterReg::findTypedInstance("tex_fetch_debugger"); if(tex_fetch_debugger_instance) @@ -1677,7 +1683,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( ":resumeMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED( "df resumeMainloopTimeout" ) resumeMainloopTimeout(); } pingMainloopTimeout("Main:End"); -- cgit v1.2.3 From 502d37913d3df8abb4e8e103c446e24ded2996a6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 27 Sep 2021 21:23:49 +0100 Subject: SL-15999 - noninteractive: debugging run issues, suppress AFK/Away pose --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b6446e40ac..fb69f46bc5 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1559,7 +1559,7 @@ bool LLAppViewer::doFrame() if (gNonInteractive) { - S32 non_interactive_ms_sleep_time = 1000; + S32 non_interactive_ms_sleep_time = 100; LLAppViewer::getTextureCache()->pause(); LLAppViewer::getImageDecodeThread()->pause(); ms_sleep(non_interactive_ms_sleep_time); -- cgit v1.2.3 From 675514bdb372c25b50dd2c42b06633895c86b8ce Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 27 Sep 2021 23:56:06 +0000 Subject: SL-16093 Don't force the console window to be open on developer builds because it causes frame stalls while logging. --- indra/newview/llappviewer.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fc35590667..3d49a9eb78 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2501,12 +2501,7 @@ bool LLAppViewer::initConfiguration() #ifndef LL_RELEASE_FOR_DOWNLOAD // provide developer build only overrides for these control variables that are not // persisted to settings.xml - LLControlVariable* c = gSavedSettings.getControl("ShowConsoleWindow"); - if (c) - { - c->setValue(true, false); - } - c = gSavedSettings.getControl("AllowMultipleViewers"); + LLControlVariable* c = gSavedSettings.getControl("AllowMultipleViewers"); if (c) { c->setValue(true, false); -- cgit v1.2.3 From a184a0fbeea8a9dea855dc6e4fd29d81803fa738 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 28 Sep 2021 20:10:06 +0100 Subject: SL-15999 - noninteractive mode: create minimal objects,load no textures --- indra/newview/llappviewer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fb69f46bc5..1f59134679 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2759,6 +2759,8 @@ bool LLAppViewer::initConfiguration() if (gNonInteractive) { tempSetControl("SLURLPassToOtherInstance", "FALSE"); + tempSetControl("RenderWater", "FALSE"); + tempSetControl("FlyingAtExit", "FALSE"); llassert_always(!gSavedSettings.getBOOL("SLURLPassToOtherInstance")); } -- cgit v1.2.3 From 542f1917e9e963862088936b819fd9f0c1425541 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 28 Sep 2021 20:20:23 +0100 Subject: SL-15999 - draw no objects when noninteractive --- indra/newview/llappviewer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1f59134679..a146f72dde 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2761,6 +2761,7 @@ bool LLAppViewer::initConfiguration() tempSetControl("SLURLPassToOtherInstance", "FALSE"); tempSetControl("RenderWater", "FALSE"); tempSetControl("FlyingAtExit", "FALSE"); + gPipeline.clearAllRenderTypes(); llassert_always(!gSavedSettings.getBOOL("SLURLPassToOtherInstance")); } -- cgit v1.2.3 From 187d5862398820e28a8935ce9058f444f4963153 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 28 Sep 2021 21:24:38 +0100 Subject: SL-15999 - noninteractive sessions disable logging --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a146f72dde..5413045e7a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2761,7 +2761,7 @@ bool LLAppViewer::initConfiguration() tempSetControl("SLURLPassToOtherInstance", "FALSE"); tempSetControl("RenderWater", "FALSE"); tempSetControl("FlyingAtExit", "FALSE"); - gPipeline.clearAllRenderTypes(); + LLError::setEnabledLogTypesMask(0); llassert_always(!gSavedSettings.getBOOL("SLURLPassToOtherInstance")); } -- cgit v1.2.3 From 391500b5f7f2fb251acdd192d80e1da7eea02c4c Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Wed, 29 Sep 2021 12:37:57 +0300 Subject: SL-16034 Disable all displays and UI in noninteractive mode --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5413045e7a..9a8b773a66 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2632,9 +2632,10 @@ bool LLAppViewer::initConfiguration() disableCrashlogger(); } + gNonInteractive = gSavedSettings.getBOOL("NonInteractive"); // Handle initialization from settings. // Start up the debugging console before handling other options. - if (gSavedSettings.getBOOL("ShowConsoleWindow")) + if (gSavedSettings.getBOOL("ShowConsoleWindow") && !gNonInteractive) { initConsole(); } @@ -2755,7 +2756,6 @@ bool LLAppViewer::initConfiguration() } } - gNonInteractive = gSavedSettings.getBOOL("NonInteractive"); if (gNonInteractive) { tempSetControl("SLURLPassToOtherInstance", "FALSE"); -- cgit v1.2.3 From 3c4198e4b50de0221020f3b5bbf7d3f7ff7cf984 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 Sep 2021 16:50:32 +0100 Subject: SL-15999 - noninteractive sessions should quit cleanly when they get a close message. Removed some possible crashes --- indra/newview/llappviewer.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5413045e7a..bd1b30b4a1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2761,6 +2761,8 @@ bool LLAppViewer::initConfiguration() tempSetControl("SLURLPassToOtherInstance", "FALSE"); tempSetControl("RenderWater", "FALSE"); tempSetControl("FlyingAtExit", "FALSE"); + tempSetControl("WindowWidth", "1024"); + tempSetControl("WindowHeight", "200"); LLError::setEnabledLogTypesMask(0); llassert_always(!gSavedSettings.getBOOL("SLURLPassToOtherInstance")); } -- cgit v1.2.3 From 9561e986ce879833def4243700971fc53bd878d4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 Sep 2021 19:47:23 +0100 Subject: SL-15999 - force multiple viewers support for noninteractive mode --- indra/newview/llappviewer.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e1fbbf6ce5..41a83a1484 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2758,6 +2758,7 @@ bool LLAppViewer::initConfiguration() if (gNonInteractive) { + tempSetControl("AllowMultipleViewers", "TRUE"); tempSetControl("SLURLPassToOtherInstance", "FALSE"); tempSetControl("RenderWater", "FALSE"); tempSetControl("FlyingAtExit", "FALSE"); -- cgit v1.2.3 From 3e99853b2984a40093ff6b504abfcabe065b251b Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Tue, 5 Oct 2021 15:59:21 -0600 Subject: SL-16138 remove checks for now-mandatory capabilities --- indra/newview/llappviewer.cpp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3d49a9eb78..98409106a1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1010,19 +1010,6 @@ bool LLAppViewer::init() return 0; } - // If we don't have the right shader requirements. - if (!gGLManager.mHasShaderObjects - || !gGLManager.mHasVertexShader - || !gGLManager.mHasFragmentShader) - { - LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedShaderRequirements"); - OSMessageBox( - details.getString(), - LLStringUtil::null, - OSMB_OK); - return 0; - } - // Without SSE2 support we will crash almost immediately, warn here. if (!gSysCPU.hasSSE2()) { -- cgit v1.2.3 From 2cb09dd4a828756dce6180505c63851aa9875187 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 7 Oct 2021 11:53:45 -0400 Subject: SL-16024: Return shared_ptr from LLInstanceTracker::getInstance(). It feels wrong to return a dumb LLInstanceTracker subclass* from getInstance() when we use std::shared_ptr and std::weak_ptr internally. But tweak consumers to use 'auto' or LLInstanceTracker::ptr_t in case we later revisit this decision. We did add a couple get() calls where it's important to obtain a dumb pointer. --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 891722e1bd..4a9a1ad0d4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2336,7 +2336,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name() << " - from location " << location_key << LL_ENDL; - LLControlGroup* settings_group = LLControlGroup::getInstance(file.name); + auto settings_group = LLControlGroup::getInstance(file.name); if(!settings_group) { LL_WARNS("Settings") << "No matching settings group for name " << file.name() << LL_ENDL; @@ -2638,7 +2638,7 @@ bool LLAppViewer::initConfiguration() group_part = name.substr(0, pos); name_part = name.substr(pos+1); LL_INFOS() << "Setting " << group_part << "." << name_part << " to " << value << LL_ENDL; - LLControlGroup* g = LLControlGroup::getInstance(group_part); + auto g = LLControlGroup::getInstance(group_part); if (g) control = g->getControl(name_part); } else -- cgit v1.2.3 From d00272e0cc9974f35a46f0c313ee2c0e11cddbda Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 11 Oct 2021 16:03:40 +0000 Subject: SL-16099 Multi-threaded OpenGL usage on Windows, enable Core Profile and VAOs by default. --- indra/newview/llappviewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 722a6caa65..e46e8feb14 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -613,7 +613,7 @@ static void settings_modify() LLPipeline::sRenderDeferred = LLPipeline::sRenderTransparentWater && LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] - gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; + gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); } @@ -4831,6 +4831,7 @@ void LLAppViewer::idle() LLNotificationsUI::LLToast::updateClass(); LLSmoothInterpolation::updateInterpolants(); LLMortician::updateClass(); + LLImageGL::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() LLDirPickerThread::clearDead(); F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); -- cgit v1.2.3 From eda264c2821a86505b4ec2a898ff3169ab82f895 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 20 Oct 2021 18:38:36 -0400 Subject: SL-16220: Add a WorkQueue to be serviced by mainloop. Make LLAppViewer::idle() call LL::WorkQueue::runFor() to dequeue and run some or all of the pending responses from worker threads. Add a MainWorkTime setting to specify the time slice the main loop may devote each frame to servicing such responses. --- indra/newview/llappviewer.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 722a6caa65..7c932a3959 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -233,6 +233,8 @@ #include "llavatariconctrl.h" #include "llgroupiconctrl.h" #include "llviewerassetstats.h" +#include "workqueue.h" +using namespace LL; // Include for security api initialization #include "llsecapi.h" @@ -366,6 +368,8 @@ BOOL gLogoutInProgress = FALSE; BOOL gSimulateMemLeak = FALSE; +WorkQueue gMainloopWork("mainloop"); + //////////////////////////////////////////////////////////// // Internal globals... that should be removed. static std::string gArgs; @@ -5210,6 +5214,20 @@ void LLAppViewer::idle() // Execute deferred tasks. LLDeferredTaskList::instance().run(); + // Service the WorkQueue we use for replies from worker threads. + // Use function statics for the timeslice setting so we only have to fetch + // and convert MainWorkTime once. + static F32 MainWorkTimeRaw = gSavedSettings.getF32("MainWorkTime"); + static F32Milliseconds MainWorkTimeMs(MainWorkTimeRaw); + // MainWorkTime is specified in fractional milliseconds, but std::chrono + // uses integer representations. What if we want less than a microsecond? + // Use nanoseconds. We're very sure we will never need to specify a + // MainWorkTime that would be larger than we could express in + // std::chrono::nanoseconds. + static std::chrono::nanoseconds MainWorkTimeNanoSec{ + std::chrono::nanoseconds::rep(MainWorkTimeMs.value() * 1000000)}; + gMainloopWork.runFor(MainWorkTimeNanoSec); + // Handle shutdown process, for example, // wait for floaters to close, send quit message, // forcibly quit if it has taken too long -- cgit v1.2.3 From 11afa09ea3f56c0e20eb195ae1520a88602ceaca Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 22 Oct 2021 11:36:31 -0400 Subject: SL-16220: Add LL::ThreadPool class and a "General" instance. ThreadPool bundles a WorkQueue with the specified number of worker threads to service it. Each ThreadPool has a name that can be used to locate its WorkQueue. Each worker thread calls WorkQueue::runUntilClose(). ThreadPool listens on the "LLApp" LLEventPump for shutdown notification. On receiving that, it closes its WorkQueue and then join()s each of its worker threads for orderly shutdown. Add a settings.xml entry "ThreadPoolSizes", the first LLSD-valued settings entry to expect a map: pool name->size. The expectation is that usually code instantiating a particular ThreadPool will have a default size in mind, but it should check "ThreadPoolSizes" for a user override. Make idle_startup()'s STATE_SEED_CAP_GRANTED state instantiate a "General" ThreadPool. This is function-static for lazy initialization. Eliminate LLMainLoopRepeater, which is completely unreferenced. Any potential future use cases are better addressed by posting to the main loop's WorkQueue. Eliminate llappviewer.cpp's private LLDeferredTaskList class, which implemented LLAppViewer::addOnIdleCallback(). Make addOnIdleCallback() post work to the main loop's WorkQueue instead. --- indra/newview/llappviewer.cpp | 47 +------------------------------------------ 1 file changed, 1 insertion(+), 46 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7c932a3959..7c363eea5e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -239,7 +239,6 @@ using namespace LL; // Include for security api initialization #include "llsecapi.h" #include "llmachineid.h" -#include "llmainlooprepeater.h" #include "llcleanup.h" #include "llcoproceduremanager.h" @@ -385,42 +384,6 @@ static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; -//-- LLDeferredTaskList ------------------------------------------------------ - -/** - * A list of deferred tasks. - * - * We sometimes need to defer execution of some code until the viewer gets idle, - * e.g. removing an inventory item from within notifyObservers() may not work out. - * - * Tasks added to this list will be executed in the next LLAppViewer::idle() iteration. - * All tasks are executed only once. - */ -class LLDeferredTaskList: public LLSingleton -{ - LLSINGLETON_EMPTY_CTOR(LLDeferredTaskList); - LOG_CLASS(LLDeferredTaskList); - - friend class LLAppViewer; - typedef boost::signals2::signal signal_t; - - void addTask(const signal_t::slot_type& cb) - { - mSignal.connect(cb); - } - - void run() - { - if (!mSignal.empty()) - { - mSignal(); - mSignal.disconnect_all_slots(); - } - } - - signal_t mSignal; -}; - //---------------------------------------------------------------------------- // List of entries from strings.xml to always replace @@ -980,9 +943,6 @@ bool LLAppViewer::init() } LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ; - // Initialize the repeater service. - LLMainLoopRepeater::instance().start(); - // // Initialize the window // @@ -2171,8 +2131,6 @@ bool LLAppViewer::cleanup() SUBSYSTEM_CLEANUP(LLProxy); LLCore::LLHttp::cleanup(); - LLMainLoopRepeater::instance().stop(); - ll_close_fail_log(); LLError::LLCallStacks::cleanup(); @@ -4437,7 +4395,7 @@ bool LLAppViewer::initCache() void LLAppViewer::addOnIdleCallback(const boost::function& cb) { - LLDeferredTaskList::instance().addTask(cb); + gMainloopWork.post(cb); } void LLAppViewer::loadKeyBindings() @@ -5211,9 +5169,6 @@ void LLAppViewer::idle() } } - // Execute deferred tasks. - LLDeferredTaskList::instance().run(); - // Service the WorkQueue we use for replies from worker threads. // Use function statics for the timeslice setting so we only have to fetch // and convert MainWorkTime once. -- cgit v1.2.3 From 081ae57831b40d46acfe8f70e727ab804597ae58 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Mon, 25 Oct 2021 15:51:35 -0600 Subject: SL-16246 protect null deference --- indra/newview/llappviewer.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8492aba222..400a6a722b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -864,8 +864,6 @@ bool LLAppViewer::init() LLNotifications::instance(); LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; - writeSystemInfo(); - ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////// @@ -986,6 +984,9 @@ bool LLAppViewer::init() initWindow(); LL_INFOS("InitInfo") << "Window is initialized." << LL_ENDL ; + // writeSystemInfo can be called after window is initialized (gViewerWindow non-null) + writeSystemInfo(); + // initWindow also initializes the Feature List, so now we can initialize this global. LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); @@ -3540,12 +3541,15 @@ void LLAppViewer::writeSystemInfo() gDebugInfo["FirstLogin"] = LLSD::Boolean(gAgent.isFirstLogin()); gDebugInfo["FirstRunThisInstall"] = gSavedSettings.getBOOL("FirstRunThisInstall"); gDebugInfo["StartupState"] = LLStartUp::getStartupStateString(); - - std::vector resolutions = gViewerWindow->getWindow()->getDisplaysResolutionList(); - for (auto res_iter : resolutions) - { - gDebugInfo["DisplayInfo"].append(res_iter); - } + + if (gViewerWindow) + { + std::vector resolutions = gViewerWindow->getWindow()->getDisplaysResolutionList(); + for (auto res_iter : resolutions) + { + gDebugInfo["DisplayInfo"].append(res_iter); + } + } writeDebugInfo(); // Save out debug_info.log early, in case of crash. } -- cgit v1.2.3 From 8d20480c5f77fe1fab8149d3cda79bdd61e77656 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 28 Oct 2021 18:06:21 +0000 Subject: SL-16148 SL-16244 SL-16270 SL-16253 Remove most BlockTimers, remove LLMemTracked, introduce alignas, hook most/all reamining allocs, disable synchronous occlusion, and convert frequently accessed LLSingletons to LLSimpleton --- indra/newview/llappviewer.cpp | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 400a6a722b..8b4fcfccd9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -977,6 +977,9 @@ bool LLAppViewer::init() // Initialize the repeater service. LLMainLoopRepeater::instance().start(); + // Initialize event recorder + LLViewerEventRecorder::createInstance(); + // // Initialize the window // @@ -1316,6 +1319,13 @@ bool LLAppViewer::init() // Load User's bindings loadKeyBindings(); + //LLSimpleton creations + LLEnvironment::createInstance(); + LLEnvironment::getInstance()->initSingleton(); + LLWorld::createInstance(); + LLSelectMgr::createInstance(); + LLViewerCamera::createInstance(); + return true; } @@ -1410,10 +1420,14 @@ bool LLAppViewer::doFrame() LLSD newFrame; { - LL_PROFILE_ZONE_NAMED( "df blocktimer" ) - LLTrace::BlockTimer::processTimes(); - LLTrace::get_frame_recording().nextPeriod(); - LLTrace::BlockTimer::logStats(); + LL_PROFILE_ZONE_NAMED("df LLTrace"); + if (LLFloaterReg::instanceVisible("block_timers")) + { + LLTrace::BlockTimer::processTimes(); + } + + LLTrace::get_frame_recording().nextPeriod(); + LLTrace::BlockTimer::logStats(); } LLTrace::get_thread_recorder()->pullFromChildren(); @@ -2184,6 +2198,10 @@ bool LLAppViewer::cleanup() LLError::LLCallStacks::cleanup(); + LLEnvironment::deleteSingleton(); + LLSelectMgr::deleteSingleton(); + LLViewerEventRecorder::deleteSingleton(); + // It's not at first obvious where, in this long sequence, a generic cleanup // call OUGHT to go. So let's say this: as we migrate cleanup from // explicit hand-placed calls into the generic mechanism, eventually @@ -2195,6 +2213,7 @@ bool LLAppViewer::cleanup() // deleteSingleton() methods. LLSingletonBase::deleteAll(); + LL_INFOS() << "Goodbye!" << LL_ENDL; removeDumpDir(); @@ -5641,6 +5660,7 @@ void LLAppViewer::disconnectViewer() LLWorld::getInstance()->destroyClass(); } LLVOCache::deleteSingleton(); + LLViewerCamera::deleteSingleton(); // call all self-registered classes LLDestroyClassList::instance().fireCallbacks(); -- cgit v1.2.3 From d848d9e888690210dd37a40c634820fd473699fb Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 4 Nov 2021 16:50:31 -0400 Subject: SL-16202: Streamline WorkQueues in LLImageGLThread. Use the new WorkQueue::postIfOpen() method in LLImageGLThread::post(). That makes the LLImageGLThread method a trivial wrapper, which can accept templated work items and pass them through to the WorkQueue method, eliminating double indirection due to multiple layers of std::function. Eliminate LLImageGLThread's WorkQueue intended for work on the main queue. Since the main loop already has a WorkQueue of its own, post work directly to that WorkQueue instead of using a separate WorkQueue misleadingly embedded in LLImageGLThread. Instead of looking up the main thread's WorkQueue every time, capture a pointer in LLImageGL's constructor. We no longer need a fallback queue for when the main thread's WorkQueue is full. We no longer need the main loop to poll LLImageGL to service the local main-thread-targeted WorkQueue, or to copy work from the fallback queue to the main queue. That eliminates LLImageGLThread::postCallback(), mCallbackQueue, mPendingCallbackQ, executeCallbacks() -- and even LLImageGL::updateClass() and LLAppViewer's call to it. Change LLViewerFetchedTexture::scheduleCreateTexture() to post work to the main thread's WorkQueue instead of calling LLImageGLThread::postCallback(). --- indra/newview/llappviewer.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 220dff3ccb..ea2e3a4007 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4848,7 +4848,6 @@ void LLAppViewer::idle() LLNotificationsUI::LLToast::updateClass(); LLSmoothInterpolation::updateInterpolants(); LLMortician::updateClass(); - LLImageGL::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() LLDirPickerThread::clearDead(); F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); -- cgit v1.2.3 From 834e7ca088b5f417235327cd290b42459c733594 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 4 Nov 2021 17:18:57 -0400 Subject: SL-16202: Use large WorkQueue size limits for mainloop and General. Give ThreadPool and WorkQueue the ability to override default ThreadSafeSchedule capacity. Instantiate "mainloop" WorkQueue and "General" ThreadPool with very large capacity because we never want to have to block trying to push to either. --- indra/newview/llappviewer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ea2e3a4007..02b4dd57f1 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -367,7 +367,9 @@ BOOL gLogoutInProgress = FALSE; BOOL gSimulateMemLeak = FALSE; -WorkQueue gMainloopWork("mainloop"); +// We don't want anyone, especially threads working on the graphics pipeline, +// to have to block due to this WorkQueue being full. +WorkQueue gMainloopWork("mainloop", 1024*1024); //////////////////////////////////////////////////////////// // Internal globals... that should be removed. -- cgit v1.2.3 From 709184e0ffdd9967444c07bd52d479be4d932835 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 14 Sep 2021 22:43:17 +0300 Subject: SL-15993 Disabling transparent water should not disable advanced lighting --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8b4fcfccd9..89756d0881 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -610,7 +610,7 @@ static void settings_modify() LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderDeferred"); LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); - LLPipeline::sRenderDeferred = LLPipeline::sRenderTransparentWater && LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); + LLPipeline::sRenderDeferred = LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; -- cgit v1.2.3 From 029b41c0419e975bbb28454538b46dc69ce5d2ba Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Mon, 15 Nov 2021 09:25:35 -0700 Subject: Revert "SL-16220: Merge branch 'origin/DRTVWR-546' into glthread" This reverts commit 5188a26a8521251dda07ac0140bb129f28417e49, reversing changes made to 819088563e13f1d75e048311fbaf0df4a79b7e19. --- indra/newview/llappviewer.cpp | 66 ++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 20 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 93e5c2e341..89756d0881 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -233,12 +233,11 @@ #include "llavatariconctrl.h" #include "llgroupiconctrl.h" #include "llviewerassetstats.h" -#include "workqueue.h" -using namespace LL; // Include for security api initialization #include "llsecapi.h" #include "llmachineid.h" +#include "llmainlooprepeater.h" #include "llcleanup.h" #include "llcoproceduremanager.h" @@ -367,10 +366,6 @@ BOOL gLogoutInProgress = FALSE; BOOL gSimulateMemLeak = FALSE; -// We don't want anyone, especially threads working on the graphics pipeline, -// to have to block due to this WorkQueue being full. -WorkQueue gMainloopWork("mainloop", 1024*1024); - //////////////////////////////////////////////////////////// // Internal globals... that should be removed. static std::string gArgs; @@ -386,6 +381,42 @@ static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; +//-- LLDeferredTaskList ------------------------------------------------------ + +/** + * A list of deferred tasks. + * + * We sometimes need to defer execution of some code until the viewer gets idle, + * e.g. removing an inventory item from within notifyObservers() may not work out. + * + * Tasks added to this list will be executed in the next LLAppViewer::idle() iteration. + * All tasks are executed only once. + */ +class LLDeferredTaskList: public LLSingleton +{ + LLSINGLETON_EMPTY_CTOR(LLDeferredTaskList); + LOG_CLASS(LLDeferredTaskList); + + friend class LLAppViewer; + typedef boost::signals2::signal signal_t; + + void addTask(const signal_t::slot_type& cb) + { + mSignal.connect(cb); + } + + void run() + { + if (!mSignal.empty()) + { + mSignal(); + mSignal.disconnect_all_slots(); + } + } + + signal_t mSignal; +}; + //---------------------------------------------------------------------------- // List of entries from strings.xml to always replace @@ -943,6 +974,9 @@ bool LLAppViewer::init() } LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ; + // Initialize the repeater service. + LLMainLoopRepeater::instance().start(); + // Initialize event recorder LLViewerEventRecorder::createInstance(); @@ -2158,6 +2192,8 @@ bool LLAppViewer::cleanup() SUBSYSTEM_CLEANUP(LLProxy); LLCore::LLHttp::cleanup(); + LLMainLoopRepeater::instance().stop(); + ll_close_fail_log(); LLError::LLCallStacks::cleanup(); @@ -4452,7 +4488,7 @@ bool LLAppViewer::initCache() void LLAppViewer::addOnIdleCallback(const boost::function& cb) { - gMainloopWork.post(cb); + LLDeferredTaskList::instance().addTask(cb); } void LLAppViewer::loadKeyBindings() @@ -4850,6 +4886,7 @@ void LLAppViewer::idle() LLNotificationsUI::LLToast::updateClass(); LLSmoothInterpolation::updateInterpolants(); LLMortician::updateClass(); + LLImageGL::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() LLDirPickerThread::clearDead(); F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); @@ -5226,19 +5263,8 @@ void LLAppViewer::idle() } } - // Service the WorkQueue we use for replies from worker threads. - // Use function statics for the timeslice setting so we only have to fetch - // and convert MainWorkTime once. - static F32 MainWorkTimeRaw = gSavedSettings.getF32("MainWorkTime"); - static F32Milliseconds MainWorkTimeMs(MainWorkTimeRaw); - // MainWorkTime is specified in fractional milliseconds, but std::chrono - // uses integer representations. What if we want less than a microsecond? - // Use nanoseconds. We're very sure we will never need to specify a - // MainWorkTime that would be larger than we could express in - // std::chrono::nanoseconds. - static std::chrono::nanoseconds MainWorkTimeNanoSec{ - std::chrono::nanoseconds::rep(MainWorkTimeMs.value() * 1000000)}; - gMainloopWork.runFor(MainWorkTimeNanoSec); + // Execute deferred tasks. + LLDeferredTaskList::instance().run(); // Handle shutdown process, for example, // wait for floaters to close, send quit message, -- cgit v1.2.3 From 1acd92c30c88a9718385f29a558b77bd20588764 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 14 Sep 2021 22:43:17 +0300 Subject: SL-15993 Disabling transparent water should not disable advanced lighting --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 02b4dd57f1..93e5c2e341 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -579,7 +579,7 @@ static void settings_modify() LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderDeferred"); LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); - LLPipeline::sRenderDeferred = LLPipeline::sRenderTransparentWater && LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); + LLPipeline::sRenderDeferred = LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; -- cgit v1.2.3 From 53cf740d874f376f212a5d706ca70cbf35fee259 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 19 Nov 2021 14:42:49 -0500 Subject: SL-16094: Service mainloop WorkQueue every LLAppViewer::idle() call even if idle() exits early. --- indra/newview/llappviewer.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 93e5c2e341..e7f104d6fd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4854,6 +4854,20 @@ void LLAppViewer::idle() LLDirPickerThread::clearDead(); F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); + // Service the WorkQueue we use for replies from worker threads. + // Use function statics for the timeslice setting so we only have to fetch + // and convert MainWorkTime once. + static F32 MainWorkTimeRaw = gSavedSettings.getF32("MainWorkTime"); + static F32Milliseconds MainWorkTimeMs(MainWorkTimeRaw); + // MainWorkTime is specified in fractional milliseconds, but std::chrono + // uses integer representations. What if we want less than a microsecond? + // Use nanoseconds. We're very sure we will never need to specify a + // MainWorkTime that would be larger than we could express in + // std::chrono::nanoseconds. + static std::chrono::nanoseconds MainWorkTimeNanoSec{ + std::chrono::nanoseconds::rep(MainWorkTimeMs.value() * 1000000)}; + gMainloopWork.runFor(MainWorkTimeNanoSec); + // Cap out-of-control frame times // Too low because in menus, swapping, debugger, etc. // Too high because idle called with no objects in view, etc. @@ -5226,20 +5240,6 @@ void LLAppViewer::idle() } } - // Service the WorkQueue we use for replies from worker threads. - // Use function statics for the timeslice setting so we only have to fetch - // and convert MainWorkTime once. - static F32 MainWorkTimeRaw = gSavedSettings.getF32("MainWorkTime"); - static F32Milliseconds MainWorkTimeMs(MainWorkTimeRaw); - // MainWorkTime is specified in fractional milliseconds, but std::chrono - // uses integer representations. What if we want less than a microsecond? - // Use nanoseconds. We're very sure we will never need to specify a - // MainWorkTime that would be larger than we could express in - // std::chrono::nanoseconds. - static std::chrono::nanoseconds MainWorkTimeNanoSec{ - std::chrono::nanoseconds::rep(MainWorkTimeMs.value() * 1000000)}; - gMainloopWork.runFor(MainWorkTimeNanoSec); - // Handle shutdown process, for example, // wait for floaters to close, send quit message, // forcibly quit if it has taken too long -- cgit v1.2.3 From 28f9fb06a9f4cb9edccb2ff8132c7f6a9b27c060 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 20 Nov 2021 18:49:19 +0000 Subject: SL-16289 Rigged mesh rendering overhaul --- indra/newview/llappviewer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 52ef2966ce..177558d38f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1430,6 +1430,11 @@ bool LLAppViewer::doFrame() { LL_RECORD_BLOCK_TIME(FTM_FRAME); + if (!LLWorld::instanceExists()) + { + LLWorld::createInstance(); + } + LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop")); LLSD newFrame; -- cgit v1.2.3 From 0b066539fe68dc5750900c3452189645c40adb45 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 24 Nov 2021 10:47:54 -0500 Subject: DRTVWR-546, SL-16220, SL-16094: Undo previous glthread branch revert. Reverting a merge is sticky: it tells git you never want to see that branch again. Merging the DRTVWR-546 branch, which contained the revert, into the glthread branch undid much of the development work on that branch. To restore it we must revert the revert. This reverts commit 029b41c0419e975bbb28454538b46dc69ce5d2ba. --- indra/newview/llappviewer.cpp | 51 ++++++------------------------------------- 1 file changed, 7 insertions(+), 44 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5b3cbff9b8..e13c0a2472 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -233,11 +233,12 @@ #include "llavatariconctrl.h" #include "llgroupiconctrl.h" #include "llviewerassetstats.h" +#include "workqueue.h" +using namespace LL; // Include for security api initialization #include "llsecapi.h" #include "llmachineid.h" -#include "llmainlooprepeater.h" #include "llcleanup.h" #include "llcoproceduremanager.h" @@ -366,6 +367,10 @@ BOOL gLogoutInProgress = FALSE; BOOL gSimulateMemLeak = FALSE; +// We don't want anyone, especially threads working on the graphics pipeline, +// to have to block due to this WorkQueue being full. +WorkQueue gMainloopWork("mainloop", 1024*1024); + //////////////////////////////////////////////////////////// // Internal globals... that should be removed. static std::string gArgs; @@ -381,42 +386,6 @@ static std::string gLaunchFileOnQuit; // Used on Win32 for other apps to identify our window (eg, win_setup) const char* const VIEWER_WINDOW_CLASSNAME = "Second Life"; -//-- LLDeferredTaskList ------------------------------------------------------ - -/** - * A list of deferred tasks. - * - * We sometimes need to defer execution of some code until the viewer gets idle, - * e.g. removing an inventory item from within notifyObservers() may not work out. - * - * Tasks added to this list will be executed in the next LLAppViewer::idle() iteration. - * All tasks are executed only once. - */ -class LLDeferredTaskList: public LLSingleton -{ - LLSINGLETON_EMPTY_CTOR(LLDeferredTaskList); - LOG_CLASS(LLDeferredTaskList); - - friend class LLAppViewer; - typedef boost::signals2::signal signal_t; - - void addTask(const signal_t::slot_type& cb) - { - mSignal.connect(cb); - } - - void run() - { - if (!mSignal.empty()) - { - mSignal(); - mSignal.disconnect_all_slots(); - } - } - - signal_t mSignal; -}; - //---------------------------------------------------------------------------- // List of entries from strings.xml to always replace @@ -973,9 +942,6 @@ bool LLAppViewer::init() } LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ; - // Initialize the repeater service. - LLMainLoopRepeater::instance().start(); - // Initialize event recorder LLViewerEventRecorder::createInstance(); @@ -2217,8 +2183,6 @@ bool LLAppViewer::cleanup() SUBSYSTEM_CLEANUP(LLProxy); LLCore::LLHttp::cleanup(); - LLMainLoopRepeater::instance().stop(); - ll_close_fail_log(); LLError::LLCallStacks::cleanup(); @@ -4550,7 +4514,7 @@ bool LLAppViewer::initCache() void LLAppViewer::addOnIdleCallback(const boost::function& cb) { - LLDeferredTaskList::instance().addTask(cb); + gMainloopWork.post(cb); } void LLAppViewer::loadKeyBindings() @@ -4948,7 +4912,6 @@ void LLAppViewer::idle() LLNotificationsUI::LLToast::updateClass(); LLSmoothInterpolation::updateInterpolants(); LLMortician::updateClass(); - LLImageGL::updateClass(); LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify() LLDirPickerThread::clearDead(); F32 dt_raw = idle_timer.getElapsedTimeAndResetF32(); -- cgit v1.2.3 From f7258b49b20cb306804db8276b1caf7d9bb75e23 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 25 Nov 2021 17:33:13 +0200 Subject: SL-16408 Fix for crashing on disconnect --- indra/newview/llappviewer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 177558d38f..58e15c3630 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1768,6 +1768,8 @@ bool LLAppViewer::cleanup() //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; + LLViewerCamera::deleteSingleton(); + LLNotifications::instance().clear(); // workaround for DEV-35406 crash on shutdown @@ -5722,7 +5724,6 @@ void LLAppViewer::disconnectViewer() LLWorld::getInstance()->destroyClass(); } LLVOCache::deleteSingleton(); - LLViewerCamera::deleteSingleton(); // call all self-registered classes LLDestroyClassList::instance().fireCallbacks(); -- cgit v1.2.3 From 5641f9612cfadaac697a54a4c80b4bb08815bc5b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Mon, 29 Nov 2021 17:52:11 +0200 Subject: SL-16408 fixed regression - crash on exit --- indra/newview/llappviewer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 58e15c3630..13670b7f13 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1768,9 +1768,7 @@ bool LLAppViewer::cleanup() //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; - LLViewerCamera::deleteSingleton(); - - LLNotifications::instance().clear(); + LLNotifications::instance().clear(); // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); @@ -1811,6 +1809,7 @@ bool LLAppViewer::cleanup() LLPluginProcessParent::shutdown(); disconnectViewer(); + LLViewerCamera::deleteSingleton(); LL_INFOS() << "Viewer disconnected" << LL_ENDL; -- cgit v1.2.3 From 9be88050e67edcb8578ce6edbee255ba66e553a1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 30 Nov 2021 14:05:35 -0500 Subject: SL-16421: Unify LLAppViewer::cleanup() indentation. Use hard tabs because most of the existing function uses those. --- indra/newview/llappviewer.cpp | 77 +++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 39 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d6c6eb6a98..529db397b2 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1729,12 +1729,12 @@ void LLAppViewer::flushVFSIO() bool LLAppViewer::cleanup() { - LLAtmosphere::cleanupClass(); + LLAtmosphere::cleanupClass(); //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; - LLNotifications::instance().clear(); + LLNotifications::instance().clear(); // workaround for DEV-35406 crash on shutdown LLEventPumps::instance().reset(); @@ -1771,14 +1771,14 @@ bool LLAppViewer::cleanup() // to ensure shutdown order LLMortician::setZealous(TRUE); - // Give any remaining SLPlugin instances a chance to exit cleanly. - LLPluginProcessParent::shutdown(); + // Give any remaining SLPlugin instances a chance to exit cleanly. + LLPluginProcessParent::shutdown(); disconnectViewer(); - LLViewerCamera::deleteSingleton(); + LLViewerCamera::deleteSingleton(); LL_INFOS() << "Viewer disconnected" << LL_ENDL; - + if (gKeyboard) { gKeyboard->resetKeys(); @@ -1843,15 +1843,15 @@ bool LLAppViewer::cleanup() if (gAudiop) { - // be sure to stop the internet stream cleanly BEFORE destroying the interface to stop it. - gAudiop->stopInternetStream(); - // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem. - LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl(); + // be sure to stop the internet stream cleanly BEFORE destroying the interface to stop it. + gAudiop->stopInternetStream(); + // shut down the streaming audio sub-subsystem first, in case it relies on not outliving the general audio subsystem. + LLStreamingAudioInterface *sai = gAudiop->getStreamingAudioImpl(); delete sai; gAudiop->setStreamingAudioImpl(NULL); - // shut down the audio subsystem - gAudiop->shutdown(); + // shut down the audio subsystem + gAudiop->shutdown(); delete gAudiop; gAudiop = NULL; @@ -1920,11 +1920,11 @@ bool LLAppViewer::cleanup() delete gKeyboard; gKeyboard = NULL; - if (LLViewerJoystick::instanceExists()) - { - // Turn off Space Navigator and similar devices - LLViewerJoystick::getInstance()->terminate(); - } + if (LLViewerJoystick::instanceExists()) + { + // Turn off Space Navigator and similar devices + LLViewerJoystick::getInstance()->terminate(); + } LL_INFOS() << "Cleaning up Objects" << LL_ENDL; @@ -1976,11 +1976,11 @@ bool LLAppViewer::cleanup() // Store the time of our current logoff gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); - if (LLEnvironment::instanceExists()) - { - //Store environment settings if nessesary - LLEnvironment::getInstance()->saveToSettings(); - } + if (LLEnvironment::instanceExists()) + { + //Store environment settings if necessary + LLEnvironment::getInstance()->saveToSettings(); + } // Must do this after all panels have been deleted because panels that have persistent rects // save their rects on delete. @@ -2030,7 +2030,7 @@ bool LLAppViewer::cleanup() LLConversationLog::instance().cache(); } - clearSecHandler(); + clearSecHandler(); if (mPurgeCacheOnExit) { @@ -2073,13 +2073,13 @@ bool LLAppViewer::cleanup() } } - if (mPurgeUserDataOnExit) - { - // Ideally we should not save anything from this session since it is going to be purged now, - // but this is a very 'rare' case (user deleting himself), not worth overcomplicating 'save&cleanup' code - std::string user_path = gDirUtilp->getOSUserAppDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getUserId(); - gDirUtilp->deleteDirAndContents(user_path); - } + if (mPurgeUserDataOnExit) + { + // Ideally we should not save anything from this session since it is going to be purged now, + // but this is a very 'rare' case (user deleting himself), not worth overcomplicating 'save&cleanup' code + std::string user_path = gDirUtilp->getOSUserAppDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getUserId(); + gDirUtilp->deleteDirAndContents(user_path); + } // Delete workers first // shotdown all worker threads before deleting them in case of co-dependencies @@ -2102,11 +2102,11 @@ bool LLAppViewer::cleanup() //MUST happen AFTER SUBSYSTEM_CLEANUP(LLCurl) delete sTextureCache; - sTextureCache = NULL; + sTextureCache = NULL; delete sTextureFetch; - sTextureFetch = NULL; + sTextureFetch = NULL; delete sImageDecodeThread; - sImageDecodeThread = NULL; + sImageDecodeThread = NULL; delete mFastTimerLogThread; mFastTimerLogThread = NULL; @@ -2182,15 +2182,15 @@ bool LLAppViewer::cleanup() // make sure nothing uses applyProxySettings by this point. LL_INFOS() << "Cleaning up LLProxy." << LL_ENDL; SUBSYSTEM_CLEANUP(LLProxy); - LLCore::LLHttp::cleanup(); + LLCore::LLHttp::cleanup(); ll_close_fail_log(); LLError::LLCallStacks::cleanup(); - LLEnvironment::deleteSingleton(); - LLSelectMgr::deleteSingleton(); - LLViewerEventRecorder::deleteSingleton(); + LLEnvironment::deleteSingleton(); + LLSelectMgr::deleteSingleton(); + LLViewerEventRecorder::deleteSingleton(); // It's not at first obvious where, in this long sequence, a generic cleanup // call OUGHT to go. So let's say this: as we migrate cleanup from @@ -2203,8 +2203,7 @@ bool LLAppViewer::cleanup() // deleteSingleton() methods. LLSingletonBase::deleteAll(); - - LL_INFOS() << "Goodbye!" << LL_ENDL; + LL_INFOS() << "Goodbye!" << LL_ENDL; removeDumpDir(); -- cgit v1.2.3 From 01317a2faded53c79db7e0814426f1d8b2fd12fc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 30 Nov 2021 15:22:26 -0500 Subject: SL-16421: Destroy the "General" ThreadPool as soon as cleanup starts. Introduce LLAppViewer::onCleanup(), a method that accepts a nullary callable to execute once viewer shutdown begins. Fire the collected callables in LLAppViewer::cleanup(). In llstartup.cpp, instead of declaring a static unique_ptr and relying on static object destruction to clean up the "General" ThreadPool, bind the pointer to the new ThreadPool into an onCleanup() lambda that will delete it when called. ~ThreadPool() takes care of orderly shutdown. --- indra/newview/llappviewer.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 529db397b2..a5d32ba243 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1729,6 +1729,11 @@ void LLAppViewer::flushVFSIO() bool LLAppViewer::cleanup() { + // Since we don't know what functions are going to be queued by + // onCleanup(), we have to assume they might rely on some of the things + // we're about to destroy below. Run them first. + mOnCleanup(); + LLAtmosphere::cleanupClass(); //ditch LLVOAvatarSelf instance -- cgit v1.2.3 From 5e5be92d79b6ad49f971e7b2f2ddd359d762c163 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 6 Dec 2021 15:29:34 +0000 Subject: SL-16202 Put Multi-threaded GL behind a feature flag and update featuretable (decruftify settings, compatibility pass). --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a5d32ba243..22d986a27e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1104,7 +1104,7 @@ bool LLAppViewer::init() { url = LLTrans::getString("NvidiaDriverPage"); } - else if (gGLManager.mIsATI) + else if (gGLManager.mIsAMD) { url = LLTrans::getString("AMDDriverPage"); } -- cgit v1.2.3 From 0fd7d20949a3f471e7ebb78731612013dfad7b0d Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Thu, 16 Dec 2021 11:14:14 -0700 Subject: DRTVWR-546 fix sUseFBO merge errors --- indra/newview/llappviewer.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 0a8780b1e1..89e0da3ea7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -566,13 +566,14 @@ static void settings_to_globals() static void settings_modify() { - LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); - LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); - LLPipeline::sRenderDeferred = LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); - LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); - LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] - gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; - gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); + LLPipeline::sRenderTransparentWater = gSavedSettings.getBOOL("RenderTransparentWater"); + LLPipeline::sRenderBump = gSavedSettings.getBOOL("RenderObjectBump"); + LLPipeline::sRenderDeferred = LLPipeline::sRenderBump && gSavedSettings.getBOOL("RenderDeferred"); + LLRenderTarget::sUseFBO = LLPipeline::sRenderDeferred; + LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); + LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; // square lod factor to get exponential range of [1,4] + gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; + gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); } class LLFastTimerLogThread : public LLThread -- cgit v1.2.3 From f268230902103fc68fb33c0a2a6b533369966447 Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 13 Jan 2022 11:25:52 -0800 Subject: SL-16606: Add profiler category APP --- indra/newview/llappviewer.cpp | 53 +++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 89e0da3ea7..dc973e9154 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1391,7 +1391,7 @@ bool LLAppViewer::doFrame() LLSD newFrame; { - LL_PROFILE_ZONE_NAMED("df LLTrace"); + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df LLTrace"); if (LLFloaterReg::instanceVisible("block_timers")) { LLTrace::BlockTimer::processTimes(); @@ -1407,7 +1407,7 @@ bool LLAppViewer::doFrame() LL_CLEAR_CALLSTACKS(); { - LL_PROFILE_ZONE_NAMED( "df processMiscNativeEvents" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df processMiscNativeEvents" ) pingMainloopTimeout("Main:MiscNativeWindowEvents"); if (gViewerWindow) @@ -1417,7 +1417,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( "df gatherInput" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df gatherInput" ) pingMainloopTimeout("Main:GatherInput"); } @@ -1444,20 +1444,20 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( "df mainloop" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df mainloop" ) // canonical per-frame event mainloop.post(newFrame); } { - LL_PROFILE_ZONE_NAMED( "df suspend" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df suspend" ) // give listeners a chance to run llcoro::suspend(); } if (!LLApp::isExiting()) { - LL_PROFILE_ZONE_NAMED( "df JoystickKeyboard" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df JoystickKeyboard" ) pingMainloopTimeout("Main:JoystickKeyboard"); // Scan keyboard for movement keys. Command keys and typing @@ -1479,17 +1479,19 @@ bool LLAppViewer::doFrame() // Update state based on messages, user input, object idle. { { - LL_PROFILE_ZONE_NAMED( "df pauseMainloopTimeout" ) - pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds! + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df pauseMainloopTimeout" ) + pauseMainloopTimeout(); // *TODO: Remove. Messages shouldn't be stalling for 20+ seconds! } - LL_RECORD_BLOCK_TIME(FTM_IDLE); - idle(); + { + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df idle"); //LL_RECORD_BLOCK_TIME(FTM_IDLE); + idle(); + } { - LL_PROFILE_ZONE_NAMED( "df resumeMainloopTimeout" ) - resumeMainloopTimeout(); - } + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df resumeMainloopTimeout" ) + resumeMainloopTimeout(); + } } if (gDoDisconnect && (LLStartUp::getStartupState() == STATE_STARTED)) @@ -1510,14 +1512,14 @@ bool LLAppViewer::doFrame() // *TODO: Should we run display() even during gHeadlessClient? DK 2011-02-18 if (!LLApp::isExiting() && !gHeadlessClient && gViewerWindow) { - LL_PROFILE_ZONE_NAMED( "df Display" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df Display" ) pingMainloopTimeout("Main:Display"); gGLActive = TRUE; display(); { - LL_PROFILE_ZONE_NAMED( "df Snapshot" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df Snapshot" ) pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); @@ -1527,7 +1529,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( "df pauseMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df pauseMainloopTimeout" ) pingMainloopTimeout("Main:Sleep"); pauseMainloopTimeout(); @@ -1612,27 +1614,27 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( "df gMeshRepo" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df gMeshRepo" ) gMeshRepo.update() ; } if(!total_work_pending) //pause texture fetching threads if nothing to process. { - LL_PROFILE_ZONE_NAMED( "df getTextureCache" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df getTextureCache" ) LLAppViewer::getTextureCache()->pause(); LLAppViewer::getImageDecodeThread()->pause(); LLAppViewer::getTextureFetch()->pause(); } if(!total_io_pending) //pause file threads if nothing to process. { - LL_PROFILE_ZONE_NAMED( "df LLVFSThread" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df LLVFSThread" ) LLLFSThread::sLocal->pause(); } //texture fetching debugger if(LLTextureFetchDebugger::isEnabled()) { - LL_PROFILE_ZONE_NAMED( "df tex_fetch_debugger_instance" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df tex_fetch_debugger_instance" ) LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = LLFloaterReg::findTypedInstance("tex_fetch_debugger"); if(tex_fetch_debugger_instance) @@ -1642,7 +1644,7 @@ bool LLAppViewer::doFrame() } { - LL_PROFILE_ZONE_NAMED( "df resumeMainloopTimeout" ) + LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df resumeMainloopTimeout" ) resumeMainloopTimeout(); } pingMainloopTimeout("Main:End"); @@ -4701,6 +4703,7 @@ static LLTrace::BlockTimerStatHandle FTM_HUD_EFFECTS("HUD Effects"); /////////////////////////////////////////////////////// void LLAppViewer::idle() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_APP; pingMainloopTimeout("Main:Idle"); // Update frame timers @@ -5051,8 +5054,10 @@ void LLAppViewer::idle() // Here, particles are updated and drawables are moved. // - LL_RECORD_BLOCK_TIME(FTM_WORLD_UPDATE); - gPipeline.updateMove(); + { + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("world update"); //LL_RECORD_BLOCK_TIME(FTM_WORLD_UPDATE); + gPipeline.updateMove(); + } LLWorld::getInstance()->updateParticles(); @@ -5091,7 +5096,7 @@ void LLAppViewer::idle() LLAvatarRenderInfoAccountant::getInstance()->idle(); { - LL_RECORD_BLOCK_TIME(FTM_AUDIO_UPDATE); + LL_PROFILE_ZONE_NAMED_CATEGORY_APP("audio update"); //LL_RECORD_BLOCK_TIME(FTM_AUDIO_UPDATE); if (gAudiop) { -- cgit v1.2.3 From f571de9de4ef1d597f93680d92b0508c584a5fef Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Thu, 13 Jan 2022 12:28:20 -0800 Subject: SL-16606: Add profiler category NETWORK --- indra/newview/llappviewer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index dc973e9154..a2391ef889 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4785,7 +4785,7 @@ void LLAppViewer::idle() if (!gDisconnected) { - LL_RECORD_BLOCK_TIME(FTM_NETWORK); + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("network"); //LL_RECORD_BLOCK_TIME(FTM_NETWORK); // Update spaceserver timeinfo LLWorld::getInstance()->setSpaceTimeUSec(LLWorld::getInstance()->getSpaceTimeUSec() + LLUnits::Seconds::fromValue(dt_raw)); @@ -4817,7 +4817,7 @@ void LLAppViewer::idle() || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) { - LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE); + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; //LL_RECORD_BLOCK_TIME(FTM_AGENT_UPDATE); // Send avatar and camera info mLastAgentControlFlags = gAgent.getControlFlags(); mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time; @@ -5337,6 +5337,7 @@ static LLTrace::BlockTimerStatHandle FTM_CHECK_REGION_CIRCUIT("Check Region Circ void LLAppViewer::idleNetwork() { + LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; pingMainloopTimeout("idleNetwork"); gObjectList.mNumNewObjects = 0; @@ -5344,7 +5345,7 @@ void LLAppViewer::idleNetwork() if (!gSavedSettings.getBOOL("SpeedTest")) { - LL_RECORD_BLOCK_TIME(FTM_IDLE_NETWORK); // decode + LL_PROFILE_ZONE_NAMED_CATEGORY_NETWORK("idle network"); //LL_RECORD_BLOCK_TIME(FTM_IDLE_NETWORK); // decode LLTimer check_message_timer; // Read all available packets from network -- cgit v1.2.3