summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp12
-rw-r--r--indra/llrender/llimagegl.h7
2 files changed, 11 insertions, 8 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index cdf626e16f..d1efb119c6 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -54,8 +54,8 @@ LLGLuint LLImageGL::sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS] = { 0 };
U32 LLImageGL::sUniqueCount = 0;
U32 LLImageGL::sBindCount = 0;
-S32 LLImageGL::sGlobalTextureMemory = 0;
-S32 LLImageGL::sBoundTextureMemory = 0;
+S32 LLImageGL::sGlobalTextureMemoryInBytes = 0;
+S32 LLImageGL::sBoundTextureMemoryInBytes = 0;
S32 LLImageGL::sCurBoundTextureMemory = 0;
S32 LLImageGL::sCount = 0;
@@ -174,7 +174,7 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat)
void LLImageGL::updateStats(F32 current_time)
{
sLastFrameTime = current_time;
- sBoundTextureMemory = sCurBoundTextureMemory;
+ sBoundTextureMemoryInBytes = sCurBoundTextureMemory;
sCurBoundTextureMemory = 0;
}
@@ -1013,13 +1013,13 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
if (old_name != 0)
{
- sGlobalTextureMemory -= mTextureMemory;
+ sGlobalTextureMemoryInBytes -= mTextureMemory;
LLImageGL::deleteTextures(1, &old_name);
stop_glerror();
}
mTextureMemory = getMipBytes(discard_level);
- sGlobalTextureMemory += mTextureMemory;
+ sGlobalTextureMemoryInBytes += mTextureMemory;
setActive() ;
// mark this as bound at this point, so we don't throw it out immediately
@@ -1220,7 +1220,7 @@ void LLImageGL::destroyGLTexture()
}
}
- sGlobalTextureMemory -= mTextureMemory;
+ sGlobalTextureMemoryInBytes -= mTextureMemory;
mTextureMemory = 0;
LLImageGL::deleteTextures(1, &mTexName);
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index 4f737bcaae..2f08a5a2cc 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -42,6 +42,9 @@
#include "llrender.h"
+#define BYTES_TO_MEGA_BYTES(x) ((x) >> 20)
+#define MEGA_BYTES_TO_BYTES(x) ((x) << 20)
+
//============================================================================
class LLImageGL : public LLRefCount
@@ -238,8 +241,8 @@ public:
static LLGLuint sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS]; // Currently bound texture ID
// Global memory statistics
- static S32 sGlobalTextureMemory; // Tracks main memory texmem
- static S32 sBoundTextureMemory; // Tracks bound texmem for last completed frame
+ 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 U32 sBindCount; // Tracks number of texture binds for current frame
static U32 sUniqueCount; // Tracks number of unique texture binds for current frame