summaryrefslogtreecommitdiff
path: root/indra/llrender/llimagegl.cpp
diff options
context:
space:
mode:
authorRichard Linden <none@none>2013-03-22 00:44:59 -0700
committerRichard Linden <none@none>2013-03-22 00:44:59 -0700
commit68f9f656cd22332e46959a90347e38f79c19a66c (patch)
tree531d87287b69f500c5901f785e60483555b415f9 /indra/llrender/llimagegl.cpp
parente87000ba0750e55d9d6b55feccc4124f5d2b4b74 (diff)
parent368dd542bec7c31e14673b83d3342c35717d2920 (diff)
merge with viewer-release
Diffstat (limited to 'indra/llrender/llimagegl.cpp')
-rw-r--r--indra/llrender/llimagegl.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index a4d7872ec2..751309af20 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -32,6 +32,7 @@
#include "llimagegl.h"
#include "llerror.h"
+#include "llfasttimer.h"
#include "llimage.h"
#include "llmath.h"
@@ -50,9 +51,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<LLUnits::Bytes, S32> LLImageGL::sGlobalTextureMemory = 0;
+LLUnit<LLUnits::Bytes, S32> LLImageGL::sBoundTextureMemory = 0;
+LLUnit<LLUnits::Bytes, S32> LLImageGL::sCurBoundTextureMemory = 0;
S32 LLImageGL::sCount = 0;
LLImageGL::dead_texturelist_t LLImageGL::sDeadTextureList[LLTexUnit::TT_NONE];
U32 LLImageGL::sCurTexName = 1;
@@ -243,7 +244,7 @@ void LLImageGL::updateStats(F32 current_time)
{
LLFastTimer t(FTM_IMAGE_UPDATE_STATS);
sLastFrameTime = current_time;
- sBoundTextureMemoryInBytes = sCurBoundTextureMemory;
+ sBoundTextureMemory = sCurBoundTextureMemory;
sCurBoundTextureMemory = 0;
}
@@ -251,7 +252,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 +1396,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 +1404,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 +1563,7 @@ void LLImageGL::destroyGLTexture()
{
if(mTextureMemory)
{
- sGlobalTextureMemoryInBytes -= mTextureMemory;
+ sGlobalTextureMemory -= mTextureMemory;
mTextureMemory = 0;
}