summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp181
1 files changed, 98 insertions, 83 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9e06fc3ac0..0197857a99 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -108,6 +108,7 @@
#include "llscenemonitor.h"
#include "llavatarrenderinfoaccountant.h"
#include "lllocalbitmaps.h"
+#include "llperfstats.h"
// Linden library includes
#include "llavatarnamecache.h"
@@ -1376,82 +1377,91 @@ bool LLAppViewer::frame()
bool LLAppViewer::doFrame()
{
- LL_RECORD_BLOCK_TIME(FTM_FRAME);
+ LL_RECORD_BLOCK_TIME(FTM_FRAME);
+ {
+ // and now adjust the visuals from previous frame.
+ if(LLPerfStats::tunables.userAutoTuneEnabled && LLPerfStats::tunables.tuningFlag != LLPerfStats::Tunables::Nothing)
+ {
+ LLPerfStats::tunables.applyUpdates();
+ }
+ LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_FRAME);
if (!LLWorld::instanceExists())
{
LLWorld::createInstance();
}
- LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop"));
- LLSD newFrame;
-
- {
- LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df LLTrace");
- if (LLFloaterReg::instanceVisible("block_timers"))
+ LLEventPump& mainloop(LLEventPumps::instance().obtain("mainloop"));
+ LLSD newFrame;
+ {
+ LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_IDLE); // perf stats
{
- LLTrace::BlockTimer::processTimes();
- }
-
- LLTrace::get_frame_recording().nextPeriod();
- LLTrace::BlockTimer::logStats();
- }
+ LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df LLTrace");
+ if (LLFloaterReg::instanceVisible("block_timers"))
+ {
+ LLTrace::BlockTimer::processTimes();
+ }
- LLTrace::get_thread_recorder()->pullFromChildren();
+ LLTrace::get_frame_recording().nextPeriod();
+ LLTrace::BlockTimer::logStats();
+ }
- //clear call stack records
- LL_CLEAR_CALLSTACKS();
+ LLTrace::get_thread_recorder()->pullFromChildren();
- {
- LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df processMiscNativeEvents" )
- pingMainloopTimeout("Main:MiscNativeWindowEvents");
+ //clear call stack records
+ LL_CLEAR_CALLSTACKS();
+ }
+ {
+ {
+ LLPerfStats::RecordSceneTime T(LLPerfStats::StatType_t::RENDER_IDLE); // ensure we have the entire top scope of frame covered (input event and coro)
+ LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df processMiscNativeEvents")
+ pingMainloopTimeout("Main:MiscNativeWindowEvents");
- if (gViewerWindow)
- {
- LL_RECORD_BLOCK_TIME(FTM_MESSAGES);
- gViewerWindow->getWindow()->processMiscNativeEvents();
- }
+ if (gViewerWindow)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_MESSAGES);
+ gViewerWindow->getWindow()->processMiscNativeEvents();
+ }
- {
- LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df gatherInput" )
- pingMainloopTimeout("Main:GatherInput");
- }
+ {
+ LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df gatherInput")
+ pingMainloopTimeout("Main:GatherInput");
+ }
- if (gViewerWindow)
- {
- LL_RECORD_BLOCK_TIME(FTM_MESSAGES);
- if (!restoreErrorTrap())
- {
- LL_WARNS() << " Someone took over my signal/exception handler (post messagehandling)!" << LL_ENDL;
- }
+ if (gViewerWindow)
+ {
+ LL_RECORD_BLOCK_TIME(FTM_MESSAGES);
+ if (!restoreErrorTrap())
+ {
+ LL_WARNS() << " Someone took over my signal/exception handler (post messagehandling)!" << LL_ENDL;
+ }
- gViewerWindow->getWindow()->gatherInput();
- }
+ gViewerWindow->getWindow()->gatherInput();
+ }
- //memory leaking simulation
- if (gSimulateMemLeak)
- {
- LLFloaterMemLeak* mem_leak_instance =
- LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking");
- if (mem_leak_instance)
- {
- mem_leak_instance->idle();
- }
- }
+ //memory leaking simulation
+ if (gSimulateMemLeak)
+ {
+ LLFloaterMemLeak* mem_leak_instance =
+ LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking");
+ if (mem_leak_instance)
+ {
+ mem_leak_instance->idle();
+ }
+ }
- {
- LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df mainloop" )
- // canonical per-frame event
- mainloop.post(newFrame);
- }
+ {
+ LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df mainloop")
+ // canonical per-frame event
+ mainloop.post(newFrame);
+ }
- {
- LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df suspend" )
- // give listeners a chance to run
- llcoro::suspend();
- // if one of our coroutines threw an uncaught exception, rethrow it now
- LLCoros::instance().rethrow();
- }
+ {
+ LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df suspend")
+ // give listeners a chance to run
+ llcoro::suspend();
+ }
+ }
if (!LLApp::isExiting())
{
@@ -1469,6 +1479,7 @@ bool LLAppViewer::doFrame()
&& (gHeadlessClient || !gViewerWindow->getShowProgress())
&& !gFocusMgr.focusLocked())
{
+ LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_IDLE);
joystick->scanJoystick();
gKeyboard->scanKeyboard();
gViewerInput.scanMouse();
@@ -1482,6 +1493,7 @@ bool LLAppViewer::doFrame()
}
{
+ LLPerfStats::RecordSceneTime T (LLPerfStats::StatType_t::RENDER_IDLE);
LL_PROFILE_ZONE_NAMED_CATEGORY_APP("df idle"); //LL_RECORD_BLOCK_TIME(FTM_IDLE);
idle();
}
@@ -1516,14 +1528,20 @@ bool LLAppViewer::doFrame()
display();
- {
- LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df Snapshot" )
- pingMainloopTimeout("Main:Snapshot");
- LLFloaterSnapshot::update(); // take snapshots
- LLFloaterSimpleOutfitSnapshot::update();
- gGLActive = FALSE;
- }
- }
+ {
+ LLPerfStats::RecordSceneTime T(LLPerfStats::StatType_t::RENDER_IDLE);
+ LL_PROFILE_ZONE_NAMED_CATEGORY_APP( "df Snapshot" )
+ pingMainloopTimeout("Main:Snapshot");
+ LLFloaterSnapshot::update(); // take snapshots
+ LLFloaterSimpleOutfitSnapshot::update();
+ gGLActive = FALSE;
+ }
+
+ if (LLViewerStatsRecorder::instanceExists())
+ {
+ LLViewerStatsRecorder::instance().idle();
+ }
+ }
}
{
@@ -1568,7 +1586,8 @@ bool LLAppViewer::doFrame()
// of equal priority on Windows
if (milliseconds_to_sleep > 0)
{
- ms_sleep(milliseconds_to_sleep);
+ LLPerfStats::RecordSceneTime T ( LLPerfStats::StatType_t::RENDER_SLEEP );
+ ms_sleep(milliseconds_to_sleep);
// also pause worker threads during this wait period
LLAppViewer::getTextureCache()->pause();
LLAppViewer::getImageDecodeThread()->pause();
@@ -1669,7 +1688,7 @@ bool LLAppViewer::doFrame()
LL_INFOS() << "Exiting main_loop" << LL_ENDL;
}
-
+ }LLPerfStats::StatsRecorder::endFrame();
LL_PROFILER_FRAME_END
return ! LLApp::isRunning();
@@ -2159,6 +2178,7 @@ bool LLAppViewer::cleanup()
LLSelectMgr::deleteSingleton();
LLViewerEventRecorder::deleteSingleton();
LLWorld::deleteSingleton();
+ LLVoiceClient::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
@@ -3010,15 +3030,9 @@ void LLAppViewer::initStrings()
}
}
-//
-// This function decides whether the client machine meets the minimum requirements to
-// run in a maximized window, per the consensus of davep, boa and nyx on 3/30/2011.
-//
bool LLAppViewer::meetsRequirementsForMaximizedStart()
{
- bool maximizedOk = (LLFeatureManager::getInstance()->getGPUClass() >= GPU_CLASS_2);
-
- maximizedOk &= (gSysMemory.getPhysicalMemoryKB() >= U32Gigabytes(1));
+ bool maximizedOk = (gSysMemory.getPhysicalMemoryKB() >= U32Gigabytes(1));
return maximizedOk;
}
@@ -3195,15 +3209,16 @@ LLSD LLAppViewer::getViewerInfo() const
// LLFloaterAbout.
LLSD info;
auto& versionInfo(LLVersionInfo::instance());
- info["VIEWER_VERSION"] = LLSDArray(versionInfo.getMajor())(versionInfo.getMinor())(versionInfo.getPatch())(versionInfo.getBuild());
+ info["VIEWER_VERSION"] = llsd::array(versionInfo.getMajor(), versionInfo.getMinor(),
+ versionInfo.getPatch(), versionInfo.getBuild());
info["VIEWER_VERSION_STR"] = versionInfo.getVersion();
info["CHANNEL"] = versionInfo.getChannel();
- info["ADDRESS_SIZE"] = ADDRESS_SIZE;
- std::string build_config = versionInfo.getBuildConfig();
- if (build_config != "Release")
- {
- info["BUILD_CONFIG"] = build_config;
- }
+ info["ADDRESS_SIZE"] = ADDRESS_SIZE;
+ std::string build_config = versionInfo.getBuildConfig();
+ if (build_config != "Release")
+ {
+ info["BUILD_CONFIG"] = build_config;
+ }
// return a URL to the release notes for this viewer, such as:
// https://releasenotes.secondlife.com/viewer/2.1.0.123456.html