summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorRichard Linden <none@none>2012-10-17 00:06:22 -0700
committerRichard Linden <none@none>2012-10-17 00:06:22 -0700
commite6ca5471a2a816a24888ae1b38332531b22b7254 (patch)
tree8eb0adb0db391bc775e79dee6486e2d51a6e3c04 /indra/llrender
parent8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 (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/llrender')
-rwxr-xr-xindra/llrender/llimagegl.cpp16
-rwxr-xr-xindra/llrender/llimagegl.h7
2 files changed, 12 insertions, 11 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index a4d7872ec2..fc1edbe664 100755
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -50,9 +50,9 @@ U32 wpo2(U32 i);
U32 LLImageGL::sUniqueCount = 0;
U32 LLImageGL::sBindCount = 0;
-S32 LLImageGL::sGlobalTextureMemoryInBytes = 0;
-S32 LLImageGL::sBoundTextureMemoryInBytes = 0;
-S32 LLImageGL::sCurBoundTextureMemory = 0;
+LLUnit::Bytes<S32> LLImageGL::sGlobalTextureMemory = 0;
+LLUnit::Bytes<S32> LLImageGL::sBoundTextureMemory = 0;
+LLUnit::Bytes<S32> LLImageGL::sCurBoundTextureMemory = 0;
S32 LLImageGL::sCount = 0;
LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE];
U32 LLImageGL::sCurTexName = 1;
@@ -243,7 +243,7 @@ void LLImageGL::updateStats(F32 current_time)
{
LLFastTimer t(FTM_IMAGE_UPDATE_STATS);
sLastFrameTime = current_time;
- sBoundTextureMemoryInBytes = sCurBoundTextureMemory;
+ sBoundTextureMemory = sCurBoundTextureMemory;
sCurBoundTextureMemory = 0;
}
@@ -251,7 +251,7 @@ void LLImageGL::updateStats(F32 current_time)
S32 LLImageGL::updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category)
{
LLImageGL::sCurBoundTextureMemory += mem ;
- return LLImageGL::sCurBoundTextureMemory;
+ return LLImageGL::sCurBoundTextureMemory.value();
}
//----------------------------------------------------------------------------
@@ -1395,7 +1395,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
if (old_name != 0)
{
- sGlobalTextureMemoryInBytes -= mTextureMemory;
+ sGlobalTextureMemory -= mTextureMemory;
LLImageGL::deleteTextures(mBindTarget, mFormatInternal, mMipLevels, 1, &old_name);
@@ -1403,7 +1403,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
}
mTextureMemory = getMipBytes(discard_level);
- sGlobalTextureMemoryInBytes += mTextureMemory;
+ sGlobalTextureMemory += mTextureMemory;
mTexelsInGLTexture = getWidth() * getHeight() ;
// mark this as bound at this point, so we don't throw it out immediately
@@ -1562,7 +1562,7 @@ void LLImageGL::destroyGLTexture()
{
if(mTextureMemory)
{
- sGlobalTextureMemoryInBytes -= mTextureMemory;
+ sGlobalTextureMemory -= mTextureMemory;
mTextureMemory = 0;
}
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index cf3c484c79..dfa59f2a34 100755
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -34,6 +34,7 @@
#include "llpointer.h"
#include "llrefcount.h"
#include "v2math.h"
+#include "llunit.h"
#include "llrender.h"
class LLTextureAtlas ;
@@ -245,9 +246,9 @@ public:
static F32 sLastFrameTime;
// Global memory statistics
- static S32 sGlobalTextureMemoryInBytes; // Tracks main memory texmem
- static S32 sBoundTextureMemoryInBytes; // Tracks bound texmem for last completed frame
- static S32 sCurBoundTextureMemory; // Tracks bound texmem for current frame
+ static LLUnit::Bytes<S32> sGlobalTextureMemory; // Tracks main memory texmem
+ static LLUnit::Bytes<S32> sBoundTextureMemory; // Tracks bound texmem for last completed frame
+ static LLUnit::Bytes<S32> sCurBoundTextureMemory; // Tracks bound texmem for current frame
static U32 sBindCount; // Tracks number of texture binds for current frame
static U32 sUniqueCount; // Tracks number of unique texture binds for current frame
static BOOL sGlobalUseAnisotropic;