diff options
author | Richard Linden <none@none> | 2012-11-08 23:42:18 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2012-11-08 23:42:18 -0800 |
commit | 0bb0bd514b235948c1a21c81ab0e8ab6223b1990 (patch) | |
tree | e0d49acc9074d0a5ed30c9c53fde908e5305b10f /indra/newview | |
parent | ed17c181dd37f56b808838748d289ee7bb5567ec (diff) |
SH-3499 WIP Ensure asset stats output is correct
Finished making LLUnit implicitly convertible to/from scalar integer values
cleaned up test code
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llappviewer.h | 2 | ||||
-rw-r--r-- | indra/newview/lldrawpoolwater.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/lltextureview.cpp | 18 | ||||
-rwxr-xr-x | indra/newview/llviewerassetstats.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llviewermessage.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llviewerstats.cpp | 6 | ||||
-rwxr-xr-x | indra/newview/llviewerstats.h | 6 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 18 | ||||
-rwxr-xr-x | indra/newview/llviewertexture.h | 14 | ||||
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 2 |
11 files changed, 47 insertions, 47 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 838a982cb4..ac659c409b 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -277,7 +277,7 @@ LLPumpIO* gServicePump = NULL; U64 gFrameTime = 0; F32 gFrameTimeSeconds = 0.f; -LLUnit::Seconds<F32> gFrameIntervalSeconds = 0.f; +LLUnit<LLUnits::Seconds, F32> gFrameIntervalSeconds = 0.f; F32 gFPSClamped = 10.f; // Pretend we start at target rate. F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index d9d888c626..f2bea7cdb2 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -322,7 +322,7 @@ extern LLPumpIO* gServicePump; extern U64 gFrameTime; // The timestamp of the most-recently-processed frame extern F32 gFrameTimeSeconds; // Loses msec precision after ~4.5 hours... -extern LLUnit::Seconds<F32> gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds +extern LLUnit<LLUnits::Seconds, F32> gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds extern F32 gFPSClamped; // Frames per second, smoothed, weighted toward last frame extern F32 gFrameDTClamped; extern U64 gStartTime; diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index 4f6eaa5a5b..61f5ecc46f 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -463,7 +463,7 @@ void LLDrawPoolWater::renderReflection(LLFace* face) gGL.getTexUnit(0)->bind(mHBTex[dr]); - LLOverrideFaceColor override(this, face->getFaceColor().mV); + LLOverrideFaceColor override(this, LLColor4(face->getFaceColor().mV)); face->renderIndexed(); } diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index d734620f10..288c1233e5 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -503,17 +503,17 @@ private: void LLGLTexMemBar::draw() { - LLUnit::Megabytes<S32> bound_mem = LLViewerTexture::sBoundTextureMemory; - LLUnit::Megabytes<S32> max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; - LLUnit::Megabytes<S32> total_mem = LLViewerTexture::sTotalTextureMemory; - LLUnit::Megabytes<S32> max_total_mem = LLViewerTexture::sMaxTotalTextureMem; + LLUnit<LLUnits::Megabytes, S32> bound_mem = LLViewerTexture::sBoundTextureMemory; + LLUnit<LLUnits::Megabytes, S32> max_bound_mem = LLViewerTexture::sMaxBoundTextureMem; + LLUnit<LLUnits::Megabytes, S32> total_mem = LLViewerTexture::sTotalTextureMemory; + LLUnit<LLUnits::Megabytes, S32> max_total_mem = LLViewerTexture::sMaxTotalTextureMem; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; F32 cache_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getUsage()).value() ; F32 cache_max_usage = (F32)LLTrace::Megabytes(LLAppViewer::getTextureCache()->getMaxUsage()).value() ; S32 line_height = LLFontGL::getFontMonospace()->getLineHeight(); S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); - LLUnit::Megabytes<F32> total_texture_downloaded = gTotalTextureData; - LLUnit::Megabytes<F32> total_object_downloaded = gTotalObjectData; + LLUnit<LLUnits::Megabytes, F32> total_texture_downloaded = gTotalTextureData; + LLUnit<LLUnits::Megabytes, F32> total_object_downloaded = gTotalObjectData; U32 total_http_requests = LLAppViewer::getTextureFetch()->getCurlRequest().getTotalIssuedRequests() ; //---------------------------------------------------------------------------- LLGLSUIDefault gls_ui; @@ -661,7 +661,7 @@ void LLGLTexSizeBar::draw() if(LLImageGL::sCurTexSizeBar == mIndex) { - F32 text_color[] = {1.f, 1.f, 1.f, 0.75f}; + LLColor4 text_color(1.f, 1.f, 1.f, 0.75f); std::string text; text = llformat("%d", mTopLoaded) ; @@ -673,8 +673,8 @@ void LLGLTexSizeBar::draw() text_color, LLFontGL::LEFT, LLFontGL::TOP); } - F32 loaded_color[] = {1.0f, 0.0f, 0.0f, 0.75f}; - F32 bound_color[] = {1.0f, 1.0f, 0.0f, 0.75f}; + LLColor4 loaded_color(1.0f, 0.0f, 0.0f, 0.75f); + LLColor4 bound_color(1.0f, 1.0f, 0.0f, 0.75f); gl_rect_2d(mLeft, mBottom + (S32)(mTopLoaded * mScale), (mLeft + mRight) / 2, mBottom, loaded_color) ; gl_rect_2d((mLeft + mRight) / 2, mBottom + (S32)(mTopBound * mScale), mRight, mBottom, bound_color) ; } diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index bad2f5b4cd..73a2e24424 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -430,10 +430,10 @@ void LLViewerAssetStats::getStats(AssetStats& stats, bool compact_output) grid_from_region_handle(it->first, &grid_x, &grid_y); r.grid_x(grid_x); r.grid_y(grid_y); - r.duration(LLUnit::Microseconds<F64>(rec.getDuration()).value()); + r.duration(LLUnit<LLUnits::Microseconds, F64>(rec.getDuration()).value()); } - stats.duration(mCurRecording ? LLUnit::Microseconds<F64>(mCurRecording->getDuration()).value() : 0.0); + stats.duration(mCurRecording ? LLUnit<LLUnits::Microseconds, F64>(mCurRecording->getDuration()).value() : 0.0); stats.avatar.setProvided(true); for (S32 rez_stat=0; rez_stat < mAvatarRezStates.size(); ++rez_stat) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index acbe836c29..197d91593c 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2587,7 +2587,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) LLSD args; args["SUBJECT"] = subj; args["MESSAGE"] = mes; - LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).time_stamp(timestamp)); + LLNotifications::instance().add(LLNotification::Params("GroupNotice").substitutions(args).payload(payload).time_stamp(LLDate(timestamp))); } // Also send down the old path for now. @@ -4416,18 +4416,18 @@ void send_agent_update(BOOL force_send, BOOL send_reliable) // *TODO: Remove this dependency, or figure out a better way to handle // this hack. -extern LLUnit::Bits<U32> gObjectData; +extern LLUnit<LLUnits::Bits, U32> gObjectData; void process_object_update(LLMessageSystem *mesgsys, void **user_data) { // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveSize(); } // Update the object... @@ -4439,11 +4439,11 @@ void process_compressed_object_update(LLMessageSystem *mesgsys, void **user_data // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveSize(); } // Update the object... @@ -4455,11 +4455,11 @@ void process_cached_object_update(LLMessageSystem *mesgsys, void **user_data) // Update the data counters if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveSize(); } // Update the object... @@ -4471,11 +4471,11 @@ void process_terse_object_update_improved(LLMessageSystem *mesgsys, void **user_ { if (mesgsys->getReceiveCompressedSize()) { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveCompressedSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveCompressedSize(); } else { - gObjectData += (LLUnit::Bytes<U32>)mesgsys->getReceiveSize(); + gObjectData += (LLUnit<LLUnits::Bytes, U32>)mesgsys->getReceiveSize(); } gObjectList.processCompressedObjectUpdate(mesgsys, user_data, OUT_TERSE_IMPROVED); diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index 317fe5eaf8..36b1179e04 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -288,13 +288,13 @@ F32 gAveLandCompression = 0.f, gWorstLandCompression = 0.f, gWorstWaterCompression = 0.f; -LLUnit::Bytes<U32> gTotalWorldData = 0, +LLUnit<LLUnits::Bytes, U32> gTotalWorldData = 0, gTotalObjectData = 0, gTotalTextureData = 0; U32 gSimPingCount = 0; -LLUnit::Bits<U32> gObjectData = 0; +LLUnit<LLUnits::Bits, U32> gObjectData = 0; F32 gAvgSimPing = 0.f; -LLUnit::Bytes<U32> gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; +LLUnit<LLUnits::Bytes, U32> gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {0}; extern U32 gVisCompared; extern U32 gVisTested; diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index eda7b3329d..14ee41dba0 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -319,7 +319,7 @@ void update_statistics(); void send_stats(); extern LLFrameTimer gTextureTimer; -extern LLUnit::Bytes<U32> gTotalTextureData; -extern LLUnit::Bytes<U32> gTotalObjectData; -extern LLUnit::Bytes<U32> gTotalTextureBytesPerBoostLevel[] ; +extern LLUnit<LLUnits::Bytes, U32> gTotalTextureData; +extern LLUnit<LLUnits::Bytes, U32> gTotalObjectData; +extern LLUnit<LLUnits::Bytes, U32> gTotalTextureBytesPerBoostLevel[] ; #endif // LL_LLVIEWERSTATS_H diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index ceb8d3155c..f4e8e3eae1 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -65,8 +65,8 @@ /////////////////////////////////////////////////////////////////////////////// // extern -const LLUnit::Megabytes<S32> gMinVideoRam = 32; -const LLUnit::Megabytes<S32> gMaxVideoRam = 512; +const LLUnit<LLUnits::Megabytes, S32> gMinVideoRam = 32; +const LLUnit<LLUnits::Megabytes, S32> gMaxVideoRam = 512; // statics @@ -87,11 +87,11 @@ S32 LLViewerTexture::sAuxCount = 0; LLFrameTimer LLViewerTexture::sEvaluationTimer; F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; -LLUnit::Bytes<S32> LLViewerTexture::sBoundTextureMemory = 0; -LLUnit::Bytes<S32> LLViewerTexture::sTotalTextureMemory = 0; -LLUnit::Megabytes<S32> LLViewerTexture::sMaxBoundTextureMem = 0; -LLUnit::Megabytes<S32> LLViewerTexture::sMaxTotalTextureMem = 0; -LLUnit::Bytes<S32> LLViewerTexture::sMaxDesiredTextureMem = 0 ; +LLUnit<LLUnits::Bytes, S32> LLViewerTexture::sBoundTextureMemory = 0; +LLUnit<LLUnits::Bytes, S32> LLViewerTexture::sTotalTextureMemory = 0; +LLUnit<LLUnits::Megabytes, S32> LLViewerTexture::sMaxBoundTextureMem = 0; +LLUnit<LLUnits::Megabytes, S32> LLViewerTexture::sMaxTotalTextureMem = 0; +LLUnit<LLUnits::Bytes, S32> LLViewerTexture::sMaxDesiredTextureMem = 0 ; S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ; F32 LLViewerTexture::sCameraMovingBias = 0.0f ; S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size @@ -532,8 +532,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity if (sBoundTextureMemory >= sMaxBoundTextureMem || sTotalTextureMemory >= sMaxTotalTextureMem) { - //when texture memory overflows, lower down the threashold to release the textures more aggressively. - sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, LLUnit::Bytes<S32>(gMaxVideoRam)); + //when texture memory overflows, lower down the threshold to release the textures more aggressively. + sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, LLUnit<LLUnits::Bytes, S32>(gMaxVideoRam)); // If we are using more texture memory than we should, // scale up the desired discard level diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index aa1e2010b4..e9efb751f8 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -39,8 +39,8 @@ #include <map> #include <list> -extern const LLUnit::Megabytes<S32> gMinVideoRam; -extern const LLUnit::Megabytes<S32> gMaxVideoRam; +extern const LLUnit<LLUnits::Megabytes, S32> gMinVideoRam; +extern const LLUnit<LLUnits::Megabytes, S32> gMaxVideoRam; class LLFace; class LLImageGL ; @@ -323,11 +323,11 @@ public: static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; static F32 sDesiredDiscardScale; - static LLUnit::Bytes<S32> sBoundTextureMemory; - static LLUnit::Bytes<S32> sTotalTextureMemory; - static LLUnit::Megabytes<S32> sMaxBoundTextureMem; - static LLUnit::Megabytes<S32> sMaxTotalTextureMem; - static LLUnit::Bytes<S32> sMaxDesiredTextureMem ; + static LLUnit<LLUnits::Bytes, S32> sBoundTextureMemory; + static LLUnit<LLUnits::Bytes, S32> sTotalTextureMemory; + static LLUnit<LLUnits::Megabytes, S32> sMaxBoundTextureMem; + static LLUnit<LLUnits::Megabytes, S32> sMaxTotalTextureMem; + static LLUnit<LLUnits::Bytes, S32> sMaxDesiredTextureMem ; static S8 sCameraMovingDiscardBias; static F32 sCameraMovingBias; static S32 sMaxSculptRez ; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index b7415669bb..8e72ca1d74 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -733,7 +733,7 @@ public: { if(gTotalTextureBytesPerBoostLevel[i] > 0) { - addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit::Megabytes<F32>(gTotalTextureBytesPerBoostLevel[i]).value())); + addText(xpos, ypos, llformat("Boost_Level %d: %.3f MB", i, LLUnit<LLUnits::Megabytes, F32>(gTotalTextureBytesPerBoostLevel[i]).value())); ypos += y_inc; } } |