diff --git a/indra/llrender/lltexture.h b/indra/llrender/lltexture.h index 8745b5059..6a08c5b2a 100644 --- a/indra/llrender/lltexture.h +++ b/indra/llrender/lltexture.h @@ -39,7 +39,7 @@ #ifndef LL_TEXTURE_H #define LL_TEXTURE_H -#include "llmemory.h" +#include "llrefcount.h" class LLImageGL ; class LLTexUnit ; class LLFontGL ; diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index c41d70ca6..b7edc08f6 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3604,14 +3604,29 @@ void LLAgent::setTeleportState(ETeleportState state) { LLFloaterSnapshot::hide(0); } - if (mTeleportState == TELEPORT_NONE) - { - mbTeleportKeepsLookAt = false; - } - if ((mTeleportState == TELEPORT_MOVING)) - { + + switch (mTeleportState) + + { + case TELEPORT_NONE: + mbTeleportKeepsLookAt = false; + break; + + case TELEPORT_MOVING: // We're outa here. Save "back" slurl. mTeleportSourceSLURL = getSLURL(); + break; + + case TELEPORT_ARRIVING: + // First two position updates after a teleport tend to be weird + LLViewerStats::getInstance()->mAgentPositionSnaps.mCountOfNextUpdatesToIgnore = 2; + + // Let the interested parties know we've teleported. + LLViewerParcelMgr::getInstance()->onTeleportFinished(false, getPositionGlobal()); + break; + + default: + break; } // [RLVa:KB] - Alternate: Snowglobe-1.2.4 | Version: 1.23.4 | Checked: 2009-07-07 (RLVa-1.0.0d) | Added: RLVa-0.2.0b if ( (rlv_handler_t::isEnabled()) && (TELEPORT_NONE == mTeleportState) ) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bae2c6819..b524f5dc4 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4179,7 +4179,7 @@ void LLAppViewer::idleNetwork() } } llpushcallstacks ; - gObjectList.mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); + LLViewerStats::getInstance()->mNumNewObjectsStat.addValue(gObjectList.mNumNewObjects); // Retransmit unacknowledged packets. gXferManager->retransmitUnackedPackets(); diff --git a/indra/newview/llfloaterstats.cpp b/indra/newview/llfloaterstats.cpp index f19b86040..4d8fd7099 100644 --- a/indra/newview/llfloaterstats.cpp +++ b/indra/newview/llfloaterstats.cpp @@ -107,7 +107,7 @@ void LLFloaterStats::buildStats() LLStatView *render_statviewp = stat_viewp->addStatView("render stat view", "Render", "OpenDebugStatRender", rect); - stat_barp = render_statviewp->addStat("KTris Drawn", &(gPipeline.mTrianglesDrawnStat), "DebugStatModeKTrisDrawnFr"); + stat_barp = render_statviewp->addStat("KTris Drawn", &(LLViewerStats::getInstance()->mTrianglesDrawnStat), "DebugStatModeKTrisDrawnFr"); stat_barp->setUnitLabel("/fr"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 500.f; @@ -116,7 +116,7 @@ void LLFloaterStats::buildStats() stat_barp->mPrecision = 1; stat_barp->mPerSec = FALSE; - stat_barp = render_statviewp->addStat("KTris Drawn", &(gPipeline.mTrianglesDrawnStat), "DebugStatModeKTrisDrawnSec"); + stat_barp = render_statviewp->addStat("KTris Drawn", &(LLViewerStats::getInstance()->mTrianglesDrawnStat), "DebugStatModeKTrisDrawnSec"); stat_barp->setUnitLabel("/sec"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 3000.f; @@ -124,14 +124,14 @@ void LLFloaterStats::buildStats() stat_barp->mLabelSpacing = 1000.f; stat_barp->mPrecision = 1; - stat_barp = render_statviewp->addStat("Total Objs", &(gObjectList.mNumObjectsStat), "DebugStatModeTotalObjs"); + stat_barp = render_statviewp->addStat("Total Objs", &(LLViewerStats::getInstance()->mNumObjectsStat), "DebugStatModeTotalObjs"); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 10000.f; stat_barp->mTickSpacing = 2500.f; stat_barp->mLabelSpacing = 5000.f; stat_barp->mPerSec = FALSE; - stat_barp = render_statviewp->addStat("New Objs", &(gObjectList.mNumNewObjectsStat), "DebugStatModeNewObjs"); + stat_barp = render_statviewp->addStat("New Objs", &(LLViewerStats::getInstance()->mNumNewObjectsStat), "DebugStatModeNewObjs"); stat_barp->setLabel("New Objs"); stat_barp->setUnitLabel("/sec"); stat_barp->mMinBar = 0.f; @@ -144,7 +144,7 @@ void LLFloaterStats::buildStats() // Texture statistics LLStatView *texture_statviewp = render_statviewp->addStatView("texture stat view", "Texture", "OpenDebugStatTexture", rect); - stat_barp = texture_statviewp->addStat("Count", &(gTextureList.sNumImagesStat), "DebugStatModeTextureCount"); + stat_barp = texture_statviewp->addStat("Count", &(LLViewerStats::getInstance()->mNumImagesStat), "DebugStatModeTextureCount"); stat_barp->setUnitLabel(""); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 8000.f; @@ -152,7 +152,7 @@ void LLFloaterStats::buildStats() stat_barp->mLabelSpacing = 4000.f; stat_barp->mPerSec = FALSE; - stat_barp = texture_statviewp->addStat("Raw Count", &(gTextureList.sNumRawImagesStat), "DebugStatModeRawCount"); + stat_barp = texture_statviewp->addStat("Raw Count", &(LLViewerStats::getInstance()->mNumRawImagesStat), "DebugStatModeRawCount"); stat_barp->setUnitLabel(""); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 8000.f; @@ -160,7 +160,7 @@ void LLFloaterStats::buildStats() stat_barp->mLabelSpacing = 4000.f; stat_barp->mPerSec = FALSE; - stat_barp = texture_statviewp->addStat("GL Mem", &(gTextureList.sGLTexMemStat), "DebugStatModeGLMem"); + stat_barp = texture_statviewp->addStat("GL Mem", &(LLViewerStats::getInstance()->mGLTexMemStat), "DebugStatModeGLMem"); stat_barp->setUnitLabel(""); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 400.f; @@ -169,7 +169,7 @@ void LLFloaterStats::buildStats() stat_barp->mPrecision = 1; stat_barp->mPerSec = FALSE; - stat_barp = texture_statviewp->addStat("Formatted Mem", &(gTextureList.sFormattedMemStat), "DebugStatModeFormattedMem"); + stat_barp = texture_statviewp->addStat("Formatted Mem", &(LLViewerStats::getInstance()->mFormattedMemStat), "DebugStatModeFormattedMem"); stat_barp->setUnitLabel(""); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 400.f; @@ -178,7 +178,7 @@ void LLFloaterStats::buildStats() stat_barp->mPrecision = 1; stat_barp->mPerSec = FALSE; - stat_barp = texture_statviewp->addStat("Raw Mem", &(gTextureList.sRawMemStat), "DebugStatModeRawMem"); + stat_barp = texture_statviewp->addStat("Raw Mem", &(LLViewerStats::getInstance()->mRawMemStat), "DebugStatModeRawMem"); stat_barp->setUnitLabel(""); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 400.f; @@ -187,7 +187,7 @@ void LLFloaterStats::buildStats() stat_barp->mPrecision = 1; stat_barp->mPerSec = FALSE; - stat_barp = texture_statviewp->addStat("Bound Mem", &(gTextureList.sGLBoundMemStat), "DebugStatModeBoundMem"); + stat_barp = texture_statviewp->addStat("Bound Mem", &(LLViewerStats::getInstance()->mGLBoundMemStat), "DebugStatModeBoundMem"); stat_barp->setUnitLabel(""); stat_barp->mMinBar = 0.f; stat_barp->mMaxBar = 400.f; diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 2ea1f46b7..37027f450 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -37,7 +37,8 @@ #include "lleditmenuhandler.h" #include "llundo.h" #include "lluuid.h" -#include "llmemory.h" +#include "llpointer.h" +#include "llsafehandle.h" #include "llsaleinfo.h" #include "llcategory.h" #include "v3dmath.h" diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 311168c0e..9b54b6c2a 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -79,6 +79,7 @@ #include "llviewerparceloverlay.h" #include "llviewerpartsource.h" #include "llviewerregion.h" +#include "llviewerstats.h" #include "llviewertextureanim.h" #include "llviewerwindow.h" // For getSpinAxis #include "llvoavatar.h" @@ -1979,6 +1980,12 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, avatar->clampAttachmentPositions(); } + + // If we're snapping the position by more than 0.5m, update LLViewerStats::mAgentPositionSnaps + if ( isAvatar() && gAgent.getAvatarObject() == this && (mag_sqr > 0.25f) ) + { + LLViewerStats::getInstance()->mAgentPositionSnaps.push( diff.length() ); + } } if (new_rot != mLastRot diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index f8756d52a..2c953c76f 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1026,10 +1026,10 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) } */ - mNumObjectsStat.addValue((S32) mObjects.size() - mNumDeadObjects); - mNumActiveObjectsStat.addValue(num_active_objects); - mNumSizeCulledStat.addValue(mNumSizeCulled); - mNumVisCulledStat.addValue(mNumVisCulled); + LLViewerStats::getInstance()->mNumObjectsStat.addValue((S32) mObjects.size() - mNumDeadObjects); + LLViewerStats::getInstance()->mNumActiveObjectsStat.addValue(num_active_objects); + LLViewerStats::getInstance()->mNumSizeCulledStat.addValue(mNumSizeCulled); + LLViewerStats::getInstance()->mNumVisCulledStat.addValue(mNumVisCulled); } #if MESH_ENABLED diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 6758e2a9f..a458f8e10 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -174,17 +174,6 @@ public: U32 mCurBin; // Current bin we're working on... - ////////////////////// - // - // Statistics data - // - // - LLStat mNumObjectsStat; - LLStat mNumActiveObjectsStat; - LLStat mNumNewObjectsStat; - LLStat mNumSizeCulledStat; - LLStat mNumVisCulledStat; - S32 mNumNewObjects; S32 mNumSizeCulled; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 3f24ba674..44fca9866 100644 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -60,6 +60,7 @@ #include "llworld.h" #include "llfeaturemanager.h" #include "llviewernetwork.h" +#include "llmeshrepository.h" //for LLMeshRepository::sBytesReceived #if LL_LCD_COMPILE #include "lllcd.h" #endif @@ -206,9 +207,72 @@ const StatAttributes STAT_INFO[LLViewerStats::ST_COUNT] = }; -LLViewerStats::LLViewerStats() - : mPacketsLostPercentStat(64), - mLastTimeDiff(0.0) +LLViewerStats::LLViewerStats() : + mKBitStat("kbitstat"), + mLayersKBitStat("layerskbitstat"), + mObjectKBitStat("objectkbitstat"), + mAssetKBitStat("assetkbitstat"), + mTextureKBitStat("texturekbitstat"), + mVFSPendingOperations("vfspendingoperations"), + mObjectsDrawnStat("objectsdrawnstat"), + mObjectsCulledStat("objectsculledstat"), + mObjectsTestedStat("objectstestedstat"), + mObjectsComparedStat("objectscomparedstat"), + mObjectsOccludedStat("objectsoccludedstat"), + mFPSStat("fpsstat"), + mPacketsInStat("packetsinstat"), + mPacketsLostStat("packetsloststat"), + mPacketsOutStat("packetsoutstat"), + mPacketsLostPercentStat("packetslostpercentstat", 64), + mTexturePacketsStat("texturepacketsstat"), + mActualInKBitStat("actualinkbitstat"), + mActualOutKBitStat("actualoutkbitstat"), + mTrianglesDrawnStat("trianglesdrawnstat"), + mSimTimeDilation("simtimedilation"), + mSimFPS("simfps"), + mSimPhysicsFPS("simphysicsfps"), + mSimAgentUPS("simagentups"), + mSimScriptEPS("simscripteps"), + mSimFrameMsec("simframemsec"), + mSimNetMsec("simnetmsec"), + mSimSimOtherMsec("simsimothermsec"), + mSimSimPhysicsMsec("simsimphysicsmsec"), + mSimSimPhysicsStepMsec("simsimphysicsstepmsec"), + mSimSimPhysicsShapeUpdateMsec("simsimphysicsshapeupdatemsec"), + mSimSimPhysicsOtherMsec("simsimphysicsothermsec"), + mSimAgentMsec("simagentmsec"), + mSimImagesMsec("simimagesmsec"), + mSimScriptMsec("simscriptmsec"), + mSimSpareMsec("simsparemsec"), + mSimSleepMsec("simsleepmsec"), + mSimPumpIOMsec("simpumpiomsec"), + mSimMainAgents("simmainagents"), + mSimChildAgents("simchildagents"), + mSimObjects("simobjects"), + mSimActiveObjects("simactiveobjects"), + mSimActiveScripts("simactivescripts"), + mSimInPPS("siminpps"), + mSimOutPPS("simoutpps"), + mSimPendingDownloads("simpendingdownloads"), + mSimPendingUploads("simpendinguploads"), + mSimPendingLocalUploads("simpendinglocaluploads"), + mSimTotalUnackedBytes("simtotalunackedbytes"), + mPhysicsPinnedTasks("physicspinnedtasks"), + mPhysicsLODTasks("physicslodtasks"), + mPhysicsMemoryAllocated("physicsmemoryallocated"), + mSimPingStat("simpingstat"), + mNumImagesStat("numimagesstat", 32, TRUE), + mNumRawImagesStat("numrawimagesstat", 32, TRUE), + mGLTexMemStat("gltexmemstat", 32, TRUE), + mGLBoundMemStat("glboundmemstat", 32, TRUE), + mRawMemStat("rawmemstat", 32, TRUE), + mFormattedMemStat("formattedmemstat", 32, TRUE), + mNumObjectsStat("numobjectsstat"), + mNumActiveObjectsStat("numactiveobjectsstat"), + mNumNewObjectsStat("numnewobjectsstat"), + mNumSizeCulledStat("numsizeculledstat"), + mNumVisCulledStat("numvisculledstat"), + mLastTimeDiff(0.0) { for (S32 i = 0; i < ST_COUNT; i++) { @@ -219,6 +283,8 @@ LLViewerStats::LLViewerStats() { mStats[ST_HAS_BAD_TIMER] = 1.0; } + + mAgentPositionSnaps.reset(); } LLViewerStats::~LLViewerStats() @@ -238,6 +304,8 @@ void LLViewerStats::resetStats() LLViewerStats::getInstance()->mPacketsOutStat.reset(); LLViewerStats::getInstance()->mFPSStat.reset(); LLViewerStats::getInstance()->mTexturePacketsStat.reset(); + + LLViewerStats::getInstance()->mAgentPositionSnaps.reset(); } @@ -332,6 +400,10 @@ void LLViewerStats::addToMessage(LLSD &body) const << llendl; } } + + body["AgentPositionSnaps"] = mAgentPositionSnaps.getData(); + llinfos << "STAT: AgentPositionSnaps: Mean = " << mAgentPositionSnaps.getMean() << "; StdDev = " << mAgentPositionSnaps.getStdDev() + << "; Count = " << mAgentPositionSnaps.getCount() << llendl; } // static @@ -532,7 +604,7 @@ void update_statistics(U32 frame_count) } } LLViewerStats::getInstance()->setStat(LLViewerStats::ST_ENABLE_VBO, (F64)gSavedSettings.getBOOL("RenderVBOEnable")); - //LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gSavedSettings.getS32("RenderLightingDetail")); + LLViewerStats::getInstance()->setStat(LLViewerStats::ST_LIGHTING_DETAIL, (F64)gPipeline.getLightingDetail()); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_DRAW_DIST, (F64)gSavedSettings.getF32("RenderFarClip")); LLViewerStats::getInstance()->setStat(LLViewerStats::ST_CHAT_BUBBLES, (F64)gSavedSettings.getBOOL("UseChatBubbles")); #if 0 // 1.9.2 @@ -599,7 +671,7 @@ void update_statistics(U32 frame_count) // Only update texture stats ones per second so that they are less noisy { - static const F32 texture_stats_freq = 1.f; + static const F32 texture_stats_freq = 10.f; static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { @@ -714,9 +786,11 @@ void send_stats() system["ram"] = (S32) gSysMemory.getPhysicalMemoryKB(); system["os"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); system["cpu"] = gSysCPU.getCPUString(); + unsigned char MACAddress[MAC_ADDRESS_BYTES]; + LLUUID::getNodeID(MACAddress); std::string macAddressString = llformat("%02x-%02x-%02x-%02x-%02x-%02x", - gMACAddress[0],gMACAddress[1],gMACAddress[2], - gMACAddress[3],gMACAddress[4],gMACAddress[5]); + MACAddress[0],MACAddress[1],MACAddress[2], + MACAddress[3],MACAddress[4],MACAddress[5]); system["mac_address"] = macAddressString; system["serial_number"] = LLAppViewer::instance()->getSerialNumber(); std::string gpu_desc = llformat( @@ -735,6 +809,7 @@ void send_stats() download["world_kbytes"] = gTotalWorldBytes / 1024.0; download["object_kbytes"] = gTotalObjectBytes / 1024.0; download["texture_kbytes"] = gTotalTextureBytes / 1024.0; + download["mesh_kbytes"] = LLMeshRepository::sBytesReceived/1024.0; LLSD &in = body["stats"]["net"]["in"]; @@ -770,13 +845,15 @@ void send_stats() // Screen size so the UI team can figure out how big the widgets // appear and use a "typical" size for end user tests. - S32 window_width = gViewerWindow->getWindowDisplayWidth(); - S32 window_height = gViewerWindow->getWindowDisplayHeight(); + S32 window_width = gViewerWindow->getWindowWidthRaw(); + S32 window_height = gViewerWindow->getWindowHeightRaw(); S32 window_size = (window_width * window_height) / 1024; misc["string_1"] = llformat("%d", window_size); - // misc["string_2"] = -// misc["int_1"] = LLFloaterDirectory::sOldSearchCount; // Steve: 1.18.6 -// misc["int_2"] = LLFloaterDirectory::sNewSearchCount; // Steve: 1.18.6 + if (gDebugTimers.find(0) != gDebugTimers.end() && gFrameTimeSeconds > 0) + { + misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gDebugTimers[0].getElapsedTimeF32(), gFrameTimeSeconds); + } + // misc["int_1"] = LLSD::Integer(gSavedSettings.getU32("RenderQualityPerformance")); // Steve: 1.21 // misc["int_2"] = LLSD::Integer(gFrameStalls); // Steve: 1.21 @@ -787,6 +864,11 @@ void send_stats() llinfos << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << llendl; llinfos << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << llendl; + + body["DisplayNamesEnabled"] = gSavedSettings.getS32("PhoenixNameSystem") > 0; + body["DisplayNamesShowUsername"] = gSavedSettings.getS32("PhoenixNameSystem") == 1; + + body["MinimalSkin"] = false; LLViewerStats::getInstance()->addToMessage(body); LLHTTPClient::post(url, body, new ViewerStatsResponder()); diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 1cea273ad..7f0f2d8cf 100644 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -58,6 +58,7 @@ public: LLStat mTexturePacketsStat; LLStat mActualInKBitStat; // From the packet ring (when faking a bad connection) LLStat mActualOutKBitStat; // From the packet ring (when faking a bad connection) + LLStat mTrianglesDrawnStat; // Simulator stats LLStat mSimTimeDilation; @@ -99,15 +100,22 @@ public: LLStat mPhysicsPinnedTasks; LLStat mPhysicsLODTasks; LLStat mPhysicsMemoryAllocated; - /* - LLStat mSimCPUUsageStat; - LLStat mSimMemTotalStat; - LLStat mSimMemRSSStat; - */ - LLStat mSimPingStat; + LLStat mNumImagesStat; + LLStat mNumRawImagesStat; + LLStat mGLTexMemStat; + LLStat mGLBoundMemStat; + LLStat mRawMemStat; + LLStat mFormattedMemStat; + + LLStat mNumObjectsStat; + LLStat mNumActiveObjectsStat; + LLStat mNumNewObjectsStat; + LLStat mNumSizeCulledStat; + LLStat mNumVisCulledStat; + void resetStats(); public: // If you change this, please also add a corresponding text label @@ -190,6 +198,90 @@ public: void addToMessage(LLSD &body) const; + struct StatsAccumulator + { + S32 mCount; + F32 mSum; + F32 mSumOfSquares; + F32 mMinValue; + F32 mMaxValue; + U32 mCountOfNextUpdatesToIgnore; + + inline StatsAccumulator() + { + reset(); + } + + inline void push( F32 val ) + { + if ( mCountOfNextUpdatesToIgnore > 0 ) + { + mCountOfNextUpdatesToIgnore--; + return; + } + + mCount++; + mSum += val; + mSumOfSquares += val * val; + if (mCount == 1 || val > mMaxValue) + { + mMaxValue = val; + } + if (mCount == 1 || val < mMinValue) + { + mMinValue = val; + } + } + + inline F32 getMean() const + { + return (mCount == 0) ? 0.f : ((F32)mSum)/mCount; + } + + inline F32 getMinValue() const + { + return mMinValue; + } + + inline F32 getMaxValue() const + { + return mMaxValue; + } + + inline F32 getStdDev() const + { + const F32 mean = getMean(); + return (mCount == 0) ? 0.f : sqrt( mSumOfSquares/mCount - (mean * mean) ); + } + + inline U32 getCount() const + { + return mCount; + } + + inline void reset() + { + mCount = 0; + mSum = mSumOfSquares = 0.f; + mMinValue = 0.0f; + mMaxValue = 0.0f; + mCountOfNextUpdatesToIgnore = 0; + } + + inline LLSD getData() const + { + LLSD data; + data["mean"] = getMean(); + data["std_dev"] = getStdDev(); + data["count"] = (S32)mCount; + data["min"] = getMinValue(); + data["max"] = getMaxValue(); + return data; + } + }; + + StatsAccumulator mAgentPositionSnaps; + private: F64 mStats[ST_COUNT]; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 5e3d397ac..5297e2d7c 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -72,12 +72,6 @@ void (*LLViewerTextureList::sUUIDCallback)(void **, const LLUUID&) = NULL; U32 LLViewerTextureList::sTextureBits = 0; U32 LLViewerTextureList::sTexturePackets = 0; S32 LLViewerTextureList::sNumImages = 0; -LLStat LLViewerTextureList::sNumImagesStat(32, TRUE); -LLStat LLViewerTextureList::sNumRawImagesStat(32, TRUE); -LLStat LLViewerTextureList::sGLTexMemStat(32, TRUE); -LLStat LLViewerTextureList::sGLBoundMemStat(32, TRUE); -LLStat LLViewerTextureList::sRawMemStat(32, TRUE); -LLStat LLViewerTextureList::sFormattedMemStat(32, TRUE); LLViewerTextureList gTextureList; @@ -608,12 +602,12 @@ void LLViewerTextureList::updateImages(F32 max_time) { LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec()); - sNumImagesStat.addValue(sNumImages); - sNumRawImagesStat.addValue(LLImageRaw::sRawImageCount); - sGLTexMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sGlobalTextureMemoryInBytes)); - sGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes)); - sRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory)); - sFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory)); + LLViewerStats::getInstance()->mNumImagesStat.addValue(sNumImages); + LLViewerStats::getInstance()->mNumRawImagesStat.addValue(LLImageRaw::sRawImageCount); + LLViewerStats::getInstance()->mGLTexMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sGlobalTextureMemoryInBytes)); + LLViewerStats::getInstance()->mGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes)); + LLViewerStats::getInstance()->mRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory)); + LLViewerStats::getInstance()->mFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory)); updateImagesDecodePriorities(); diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index cabaa6764..fd09c60cd 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -207,13 +207,6 @@ public: static U32 sTextureBits; static U32 sTexturePackets; - static LLStat sNumImagesStat; - static LLStat sNumRawImagesStat; - static LLStat sGLTexMemStat; - static LLStat sGLBoundMemStat; - static LLStat sRawMemStat; - static LLStat sFormattedMemStat; - private: static S32 sNumImages; static void (*sUUIDCallback)(void**, const LLUUID &); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 260dbec21..680cda270 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -85,6 +85,7 @@ #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" // for audio debugging. +#include "llviewerstats.h" #include "llviewerwindow.h" // For getSpinAxis #include "llvoavatar.h" #include "llvoground.h" @@ -391,7 +392,7 @@ void LLPipeline::init() getPool(LLDrawPool::POOL_BUMP); getPool(LLDrawPool::POOL_GLOW); - mTrianglesDrawnStat.reset(); + LLViewerStats::getInstance()->mTrianglesDrawnStat.reset(); resetFrameStats(); for (U32 i = 0; i < NUM_RENDER_TYPES; ++i) @@ -1443,7 +1444,7 @@ void LLPipeline::resetFrameStats() { assertInitialized(); - mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f); + LLViewerStats::getInstance()->mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f); if (mBatchCount > 0) { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 943e8b1f6..d3fea1ff2 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -443,7 +443,6 @@ public: S32 mMeanBatchSize; S32 mTrianglesDrawn; S32 mNumVisibleNodes; - LLStat mTrianglesDrawnStat; S32 mVerticesRelit; S32 mLightingChanges;