diff options
author | Richard Linden <none@none> | 2012-10-17 00:06:22 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2012-10-17 00:06:22 -0700 |
commit | e6ca5471a2a816a24888ae1b38332531b22b7254 (patch) | |
tree | 8eb0adb0db391bc775e79dee6486e2d51a6e3c04 /indra/newview | |
parent | 8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 (diff) |
SH-3275 Update viewer metrics system to be more flexible
put template parameter back in LLUnit units
added free function operators for mathematical manipulation of unit values
converted texture memory tracking to units
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lltexturefetch.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/lltextureview.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llviewerobject.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llviewerstats.cpp | 28 | ||||
-rwxr-xr-x | indra/newview/llviewerstats.h | 12 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 43 | ||||
-rwxr-xr-x | indra/newview/llviewertexture.h | 15 | ||||
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 20 | ||||
-rwxr-xr-x | indra/newview/llviewerwindow.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llworld.cpp | 6 |
11 files changed, 79 insertions, 73 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f2caa01644..8ddaac5cc8 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2316,7 +2316,7 @@ S32 LLTextureFetch::update(F32 max_time_ms) if(mCurlGetRequest) { - LLStatViewer::TEXTURE_KBIT.add<LLUnits::Bits>(mCurlGetRequest->getTotalReceivedBits()); + LLStatViewer::TEXTURE_KBIT.add<LLTrace::Bits>(mCurlGetRequest->getTotalReceivedBits()); //gTextureList.sTextureBits += mCurlGetRequest->getTotalReceivedBits(); } diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index c60b4155a0..a88233e120 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -503,13 +503,13 @@ private: void LLGLTexMemBar::draw() { - S32 bound_mem = BYTES_TO_MEGA_BYTES(LLViewerTexture::sBoundTextureMemoryInBytes); - S32 max_bound_mem = LLViewerTexture::sMaxBoundTextureMemInMegaBytes; - S32 total_mem = BYTES_TO_MEGA_BYTES(LLViewerTexture::sTotalTextureMemoryInBytes); - S32 max_total_mem = LLViewerTexture::sMaxTotalTextureMemInMegaBytes; + 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; F32 discard_bias = LLViewerTexture::sDesiredDiscardBias; - F32 cache_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getUsage()) ; - F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ; + 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); F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024); @@ -526,10 +526,10 @@ void LLGLTexMemBar::draw() text_color, LLFontGL::LEFT, LLFontGL::TOP); text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", - total_mem, - max_total_mem, - bound_mem, - max_bound_mem, + total_mem.value(), + max_total_mem.value(), + bound_mem.value(), + max_bound_mem.value(), LLRenderTarget::sBytesAllocated/(1024*1024), LLImageRaw::sGlobalRawMemory >> 20, discard_bias, cache_usage, cache_max_usage); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 989a1c4e5a..747dfd3250 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2033,7 +2033,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, // If we're snapping the position by more than 0.5m, update LLViewerStats::mAgentPositionSnaps if ( asAvatar() && asAvatar()->isSelf() && (mag_sqr > 0.25f) ) { - LLStatViewer::AGENT_POSITION_SNAP.sample<LLUnits::Meters>(diff.length()); + LLStatViewer::AGENT_POSITION_SNAP.sample<LLTrace::Meters>(diff.length()); //LLViewerStats::getInstance()->mAgentPositionSnaps.push( diff.length() ); } } diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp index f0ad04e0ba..ccc0c9ba59 100755 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -89,7 +89,7 @@ LLTrace::Count<> FPS("fpsstat"), FRAMETIME_DOUBLED("frametimedoubled", "Ratio of frames 2x longer than previous"), TEX_BAKES("texbakes"), TEX_REBAKES("texrebakes"); -LLTrace::Count<LLUnits::Kilobits> KBIT("kbitstat"), +LLTrace::Count<LLTrace::Kilobits> KBIT("kbitstat"), LAYERS_KBIT("layerskbitstat"), OBJECT_KBIT("objectkbitstat"), ASSET_KBIT("assetkbitstat"), @@ -97,7 +97,7 @@ LLTrace::Count<LLUnits::Kilobits> KBIT("kbitstat"), ACTUAL_IN_KBIT("actualinkbit"), ACTUAL_OUT_KBIT("actualoutkbit"); -LLTrace::Count<LLUnits::Seconds> AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), +LLTrace::Count<LLTrace::Seconds> AVATAR_EDIT_TIME("avataredittime", "Seconds in Edit Appearence"), TOOLBOX_TIME("toolboxtime", "Seconds using Toolbox"), MOUSELOOK_TIME("mouselooktime", "Seconds in Mouselook"), FPS_10_TIME("fps10time", "Seconds below 10 FPS"), @@ -146,10 +146,10 @@ LLTrace::Measurement<> NUM_IMAGES("numimagesstat"), WINDOW_WIDTH("windowwidth", "Window width"), WINDOW_HEIGHT("windowheight", "Window height"); -LLTrace::Measurement<LLUnits::Meters> AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); +LLTrace::Measurement<LLTrace::Meters> AGENT_POSITION_SNAP("agentpositionsnap", "agent position corrections"); -LLTrace::Measurement<LLUnits::Bytes> SIM_UNACKED_BYTES("simtotalunackedbytes"), +LLTrace::Measurement<LLTrace::Bytes> SIM_UNACKED_BYTES("simtotalunackedbytes"), SIM_PHYSICS_MEM("physicsmemoryallocated"), GL_TEX_MEM("gltexmemstat"), GL_BOUND_MEM("glboundmemstat"), @@ -159,7 +159,7 @@ LLTrace::Measurement<LLUnits::Bytes> SIM_UNACKED_BYTES("simtotalunackedbytes"), MAX_BANDWIDTH("maxbandwidth", "Max bandwidth setting"); -SimMeasurement<LLUnits::Milliseconds> SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), +SimMeasurement<LLTrace::Milliseconds> SIM_FRAME_TIME("simframemsec", "", LL_SIM_STAT_FRAMEMS), SIM_NET_TIME("simnetmsec", "", LL_SIM_STAT_NETMS), SIM_OTHER_TIME("simsimothermsec", "", LL_SIM_STAT_SIMOTHERMS), SIM_PHYSICS_TIME("simsimphysicsmsec", "", LL_SIM_STAT_SIMPHYSICSMS), @@ -174,7 +174,7 @@ SimMeasurement<LLUnits::Milliseconds> SIM_FRAME_TIME("simframemsec", "", LL_SIM_ SIM_SLEEP_TIME("simsleepmsec", "", LL_SIM_STAT_SIMSLEEPTIME), SIM_PUMP_IO_TIME("simpumpiomsec", "", LL_SIM_STAT_IOPUMPTIME); -LLTrace::Measurement<LLUnits::Milliseconds> FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), +LLTrace::Measurement<LLTrace::Milliseconds> FRAMETIME_JITTER("frametimejitter", "Average delta between successive frame times"), FRAMETIME_SLEW("frametimeslew", "Average delta between frame time and mean"), LOGIN_SECONDS("loginseconds", "Time between LoginRequest and LoginReply"), REGION_CROSSING_TIME("regioncrossingtime", "CROSSING_AVG"), @@ -266,10 +266,10 @@ void LLViewerStats::updateFrameStats(const F64 time_diff) F32 max_bandwidth = gViewerThrottle.getMaxBandwidth(); F32 delta_bandwidth = gViewerThrottle.getCurrentBandwidth() - max_bandwidth; - LLStatViewer::DELTA_BANDWIDTH.sample<LLUnits::Bits>(delta_bandwidth); + LLStatViewer::DELTA_BANDWIDTH.sample<LLTrace::Bits>(delta_bandwidth); //setStat(ST_DELTA_BANDWIDTH, delta_bandwidth / 1024.f); - LLStatViewer::MAX_BANDWIDTH.sample<LLUnits::Bits>(max_bandwidth); + LLStatViewer::MAX_BANDWIDTH.sample<LLTrace::Bits>(max_bandwidth); //setStat(ST_MAX_BANDWIDTH, max_bandwidth / 1024.f); } @@ -360,27 +360,27 @@ void update_statistics() LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(gAgent.getRegion()->getHost()); if (cdp) { - LLStatViewer::SIM_PING.sample<LLUnits::Seconds>(cdp->getPingDelay()); + LLStatViewer::SIM_PING.sample<LLTrace::Seconds>(cdp->getPingDelay()); //stats.mSimPingStat.addValue(cdp->getPingDelay()); gAvgSimPing = ((gAvgSimPing * (F32)gSimPingCount) + (F32)(cdp->getPingDelay())) / ((F32)gSimPingCount + 1); gSimPingCount++; } else { - LLStatViewer::SIM_PING.sample<LLUnits::Seconds>(10000); + LLStatViewer::SIM_PING.sample<LLTrace::Seconds>(10000); //stats.mSimPingStat.addValue(10000); } //stats.mFPSStat.addValue(1); LLStatViewer::FPS.add(1); F32 layer_bits = (F32)(gVLManager.getLandBits() + gVLManager.getWindBits() + gVLManager.getCloudBits()); - LLStatViewer::LAYERS_KBIT.add<LLUnits::Bits>(layer_bits); + LLStatViewer::LAYERS_KBIT.add<LLTrace::Bits>(layer_bits); //stats.mLayersKBitStat.addValue(layer_bits/1024.f); - LLStatViewer::OBJECT_KBIT.add<LLUnits::Bits>(gObjectBits); + LLStatViewer::OBJECT_KBIT.add<LLTrace::Bits>(gObjectBits); //stats.mObjectKBitStat.addValue(gObjectBits/1024.f); //stats.mVFSPendingOperations.addValue(LLVFile::getVFSThread()->getPending()); LLStatViewer::PENDING_VFS_OPERATIONS.sample(LLVFile::getVFSThread()->getPending()); - LLStatViewer::ASSET_KBIT.add<LLUnits::Bits>(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); + LLStatViewer::ASSET_KBIT.add<LLTrace::Bits>(gTransferManager.getTransferBitsIn(LLTCT_ASSET)); //stats.mAssetKBitStat.addValue(gTransferManager.getTransferBitsIn(LLTCT_ASSET)/1024.f); gTransferManager.resetTransferBitsIn(LLTCT_ASSET); @@ -419,7 +419,7 @@ void update_statistics() static LLFrameTimer texture_stats_timer; if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq) { - gTotalTextureBytes = LLUnits::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); + gTotalTextureBytes = LLTrace::Bytes(LLViewerStats::instance().getRecording().getSum(LLStatViewer::TEXTURE_KBIT)).value(); texture_stats_timer.reset(); } } diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 40109bcea3..b182a40403 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -88,7 +88,7 @@ extern LLTrace::Count<> FPS, TEX_REBAKES; -extern LLTrace::Count<LLUnits::Kilobits> KBIT, +extern LLTrace::Count<LLTrace::Kilobits> KBIT, LAYERS_KBIT, OBJECT_KBIT, ASSET_KBIT, @@ -96,7 +96,7 @@ extern LLTrace::Count<LLUnits::Kilobits> KBIT, ACTUAL_IN_KBIT, ACTUAL_OUT_KBIT; -extern LLTrace::Count<LLUnits::Seconds> AVATAR_EDIT_TIME, +extern LLTrace::Count<LLTrace::Seconds> AVATAR_EDIT_TIME, TOOLBOX_TIME, MOUSELOOK_TIME, FPS_10_TIME, @@ -145,9 +145,9 @@ extern LLTrace::Measurement<> NUM_IMAGES, WINDOW_WIDTH, WINDOW_HEIGHT; -extern LLTrace::Measurement<LLUnits::Meters> AGENT_POSITION_SNAP; +extern LLTrace::Measurement<LLTrace::Meters> AGENT_POSITION_SNAP; -extern LLTrace::Measurement<LLUnits::Bytes> SIM_UNACKED_BYTES, +extern LLTrace::Measurement<LLTrace::Bytes> SIM_UNACKED_BYTES, DELTA_BANDWIDTH, MAX_BANDWIDTH, SIM_PHYSICS_MEM, @@ -156,7 +156,7 @@ extern LLTrace::Measurement<LLUnits::Bytes> SIM_UNACKED_BYTES, RAW_MEM, FORMATTED_MEM; -extern SimMeasurement<LLUnits::Milliseconds> SIM_FRAME_TIME, +extern SimMeasurement<LLTrace::Milliseconds> SIM_FRAME_TIME, SIM_NET_TIME, SIM_OTHER_TIME, SIM_PHYSICS_TIME, @@ -172,7 +172,7 @@ extern SimMeasurement<LLUnits::Milliseconds> SIM_FRAME_TIME, SIM_PUMP_IO_TIME; -extern LLTrace::Measurement<LLUnits::Milliseconds> FRAMETIME_JITTER, +extern LLTrace::Measurement<LLTrace::Milliseconds> FRAMETIME_JITTER, FRAMETIME_SLEW, LOGIN_SECONDS, REGION_CROSSING_TIME, diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index b0f8f60d1e..f64134b8b7 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -64,6 +64,11 @@ #include "lltexturecache.h" /////////////////////////////////////////////////////////////////////////////// +// extern +const LLUnit::Megabytes<S32> gMinVideoRam = 32; +const LLUnit::Megabytes<S32> gMaxVideoRam = 512; + + // statics LLPointer<LLViewerTexture> LLViewerTexture::sNullImagep = NULL; LLPointer<LLViewerTexture> LLViewerTexture::sBlackImagep = NULL; @@ -82,11 +87,11 @@ S32 LLViewerTexture::sAuxCount = 0; LLFrameTimer LLViewerTexture::sEvaluationTimer; F32 LLViewerTexture::sDesiredDiscardBias = 0.f; F32 LLViewerTexture::sDesiredDiscardScale = 1.1f; -S32 LLViewerTexture::sBoundTextureMemoryInBytes = 0; -S32 LLViewerTexture::sTotalTextureMemoryInBytes = 0; -S32 LLViewerTexture::sMaxBoundTextureMemInMegaBytes = 0; -S32 LLViewerTexture::sMaxTotalTextureMemInMegaBytes = 0; -S32 LLViewerTexture::sMaxDesiredTextureMemInBytes = 0 ; +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 ; S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ; F32 LLViewerTexture::sCameraMovingBias = 0.0f ; S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size @@ -518,17 +523,17 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity LLViewerMediaTexture::updateClass() ; } - sBoundTextureMemoryInBytes = LLImageGL::sBoundTextureMemoryInBytes;//in bytes - sTotalTextureMemoryInBytes = LLImageGL::sGlobalTextureMemoryInBytes;//in bytes - sMaxBoundTextureMemInMegaBytes = gTextureList.getMaxResidentTexMem();//in MB - sMaxTotalTextureMemInMegaBytes = gTextureList.getMaxTotalTextureMem() ;//in MB - sMaxDesiredTextureMemInBytes = MEGA_BYTES_TO_BYTES(sMaxTotalTextureMemInMegaBytes) ; //in Bytes, by default and when total used texture memory is small. + sBoundTextureMemory = LLImageGL::sBoundTextureMemory;//in bytes + sTotalTextureMemory = LLImageGL::sGlobalTextureMemory;//in bytes + sMaxBoundTextureMem = gTextureList.getMaxResidentTexMem();//in MB + sMaxTotalTextureMem = gTextureList.getMaxTotalTextureMem() ;//in MB + sMaxDesiredTextureMem = sMaxTotalTextureMem ; //in Bytes, by default and when total used texture memory is small. - if (BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) >= sMaxBoundTextureMemInMegaBytes || - BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) >= sMaxTotalTextureMemInMegaBytes) + if (sBoundTextureMemory >= sMaxBoundTextureMem || + sTotalTextureMemory >= sMaxTotalTextureMem) { //when texture memory overflows, lower down the threashold to release the textures more aggressively. - sMaxDesiredTextureMemInBytes = llmin((S32)(sMaxDesiredTextureMemInBytes * 0.75f) , MEGA_BYTES_TO_BYTES(MAX_VIDEO_RAM_IN_MEGA_BYTES)) ;//512 MB + sMaxDesiredTextureMem = llmin(sMaxDesiredTextureMem * 0.75f, (LLUnit::Bytes<S32>)gMaxVideoRam) ;//512 MB // If we are using more texture memory than we should, // scale up the desired discard level @@ -544,8 +549,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sEvaluationTimer.reset(); } else if (sDesiredDiscardBias > 0.0f && - BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < sMaxBoundTextureMemInMegaBytes * texmem_lower_bound_scale && - BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < sMaxTotalTextureMemInMegaBytes * texmem_lower_bound_scale) + sBoundTextureMemory < sMaxBoundTextureMem * texmem_lower_bound_scale && + sTotalTextureMemory < sMaxTotalTextureMem * texmem_lower_bound_scale) { // If we are using less texture memory than we should, // scale down the desired discard level @@ -563,8 +568,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1); sCameraMovingDiscardBias = (S8)(sCameraMovingBias); - LLViewerTexture::sFreezeImageScalingDown = (BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < 0.75f * sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale) && - (BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < 0.75f * sMaxTotalTextureMemInMegaBytes * texmem_middle_bound_scale) ; + LLViewerTexture::sFreezeImageScalingDown = (sBoundTextureMemory < 0.75f * sMaxBoundTextureMem * texmem_middle_bound_scale) && + (sTotalTextureMemory < 0.75f * sMaxTotalTextureMem * texmem_middle_bound_scale) ; } //end of static functions @@ -3301,13 +3306,13 @@ void LLViewerLODTexture::processTextureStats() scaleDown() ; } // Limit the amount of GL memory bound each frame - else if ( BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) > sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale && + else if ( sBoundTextureMemory > sMaxBoundTextureMem * texmem_middle_bound_scale && (!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel)) { scaleDown() ; } // Only allow GL to have 2x the video card memory - else if ( BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) > sMaxTotalTextureMemInMegaBytes*texmem_middle_bound_scale && + else if ( sTotalTextureMemory > sMaxTotalTextureMem*texmem_middle_bound_scale && (!getBoundRecently() || mDesiredDiscardLevel >= mCachedRawDiscardLevel)) { scaleDown() ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 2ea9a07e9a..aa1e2010b4 100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -34,12 +34,13 @@ #include "llgltypes.h" #include "llrender.h" #include "llmetricperformancetester.h" +#include "llunit.h" #include <map> #include <list> -#define MIN_VIDEO_RAM_IN_MEGA_BYTES 32 -#define MAX_VIDEO_RAM_IN_MEGA_BYTES 512 // 512MB max for performance reasons. +extern const LLUnit::Megabytes<S32> gMinVideoRam; +extern const LLUnit::Megabytes<S32> gMaxVideoRam; class LLFace; class LLImageGL ; @@ -322,11 +323,11 @@ public: static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; static F32 sDesiredDiscardScale; - static S32 sBoundTextureMemoryInBytes; - static S32 sTotalTextureMemoryInBytes; - static S32 sMaxBoundTextureMemInMegaBytes; - static S32 sMaxTotalTextureMemInMegaBytes; - static S32 sMaxDesiredTextureMemInBytes ; + 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 S8 sCameraMovingDiscardBias; static F32 sCameraMovingBias; static S32 sMaxSculptRez ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 56ccf3b1f0..d355432e8a 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -606,8 +606,8 @@ void LLViewerTextureList::updateImages(F32 max_time) if(gTeleportDisplay) { if(!cleared) - { - clearFetchingRequests(); + { + clearFetchingRequests(); gPipeline.clearRebuildGroups(); cleared = TRUE; } @@ -623,10 +623,10 @@ void LLViewerTextureList::updateImages(F32 max_time) using namespace LLStatViewer; NUM_IMAGES.sample(sNumImages); NUM_RAW_IMAGES.sample(LLImageRaw::sRawImageCount); - GL_TEX_MEM.sample<LLUnits::Bytes>(LLImageGL::sGlobalTextureMemoryInBytes); - GL_BOUND_MEM.sample<LLUnits::Bytes>(LLImageGL::sBoundTextureMemoryInBytes); - RAW_MEM.sample<LLUnits::Bytes>(LLImageRaw::sGlobalRawMemory); - FORMATTED_MEM.sample<LLUnits::Bytes>(LLImageFormatted::sGlobalFormattedMemory); + GL_TEX_MEM.sample(LLImageGL::sGlobalTextureMemory); + GL_BOUND_MEM.sample(LLImageGL::sBoundTextureMemory); + RAW_MEM.sample<LLTrace::Bytes>(LLImageRaw::sGlobalRawMemory); + FORMATTED_MEM.sample<LLTrace::Bytes>(LLImageFormatted::sGlobalFormattedMemory); } { @@ -1184,7 +1184,7 @@ S32 LLViewerTextureList::getMinVideoRamSetting() { S32 system_ram = (S32)BYTES_TO_MEGA_BYTES(gSysMemory.getPhysicalMemoryClamped()); //min texture mem sets to 64M if total physical mem is more than 1.5GB - return (system_ram > 1500) ? 64 : MIN_VIDEO_RAM_IN_MEGA_BYTES ; + return (system_ram > 1500) ? 64 : gMinVideoRam.value() ; } //static @@ -1234,7 +1234,7 @@ S32 LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended) else max_texmem = llmin(max_texmem, (S32)(system_ram)); - max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), MAX_VIDEO_RAM_IN_MEGA_BYTES); + max_texmem = llclamp(max_texmem, getMinVideoRamSetting(), gMaxVideoRam.value()); return max_texmem; } @@ -1322,7 +1322,7 @@ void LLViewerTextureList::receiveImageHeader(LLMessageSystem *msg, void **user_d { received_size = msg->getReceiveSize() ; } - LLStatViewer::TEXTURE_KBIT.add<LLUnits::Bytes>(received_size); + LLStatViewer::TEXTURE_KBIT.add<LLTrace::Bytes>(received_size); LLStatViewer::TEXTURE_PACKETS.add(1); U8 codec; @@ -1396,7 +1396,7 @@ void LLViewerTextureList::receiveImagePacket(LLMessageSystem *msg, void **user_d received_size = msg->getReceiveSize() ; } - LLStatViewer::TEXTURE_KBIT.add<LLUnits::Bytes>(received_size); + LLStatViewer::TEXTURE_KBIT.add<LLTrace::Bytes>(received_size); LLStatViewer::TEXTURE_PACKETS.add(1); //llprintline("Start decode, image header..."); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 8161caf5e4..2062f07650 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4740,7 +4740,7 @@ void LLViewerWindow::stopGL(BOOL save_state) gGLManager.mIsDisabled = TRUE; stop_glerror(); - llinfos << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemoryInBytes << " bytes" << llendl; + llinfos << "Remaining allocated texture memory: " << LLImageGL::sGlobalTextureMemory.value() << " bytes" << llendl; } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 3e8b07b6dc..9f0921ff59 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2790,7 +2790,7 @@ void LLVOAvatarSelf::deleteScratchTextures() sScratchTexNames.deleteAllData(); sScratchTexLastBindTime.deleteAllData(); - LLImageGL::sGlobalTextureMemoryInBytes -= sScratchTexBytes; + LLImageGL::sGlobalTextureMemory -= sScratchTexBytes; sScratchTexBytes = 0; } } diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index 604741ff27..dced5a847b 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -703,11 +703,11 @@ void LLWorld::updateNetStats() S32 actual_in_bits = gMessageSystem->mPacketRing.getAndResetActualInBits(); S32 actual_out_bits = gMessageSystem->mPacketRing.getAndResetActualOutBits(); - LLStatViewer::ACTUAL_IN_KBIT.add<LLUnits::Bits>(actual_in_bits); - LLStatViewer::ACTUAL_OUT_KBIT.add<LLUnits::Bits>(actual_out_bits); + LLStatViewer::ACTUAL_IN_KBIT.add<LLTrace::Bits>(actual_in_bits); + LLStatViewer::ACTUAL_OUT_KBIT.add<LLTrace::Bits>(actual_out_bits); //LLViewerStats::getInstance()->mActualInKBitStat.addValue(actual_in_bits/1024.f); //LLViewerStats::getInstance()->mActualOutKBitStat.addValue(actual_out_bits/1024.f); - LLStatViewer::KBIT.add<LLUnits::Bits>(bits); + LLStatViewer::KBIT.add<LLTrace::Bits>(bits); //LLViewerStats::getInstance()->mKBitStat.addValue(bits/1024.f); LLStatViewer::PACKETS_IN.add(packets_in); LLStatViewer::PACKETS_OUT.add(packets_out); |