diff options
author | Adam Moss <moss@lindenlab.com> | 2009-06-20 09:17:56 +0000 |
---|---|---|
committer | Adam Moss <moss@lindenlab.com> | 2009-06-20 09:17:56 +0000 |
commit | 8ed056fde9fe5fc9755158013a5cb8be73066e2c (patch) | |
tree | d7f5f6de35c99ca645e48dc8817d908cc6d2f348 /indra/llrender | |
parent | 351ebe9fcb76f3b99c2957004bb8493a904869ee (diff) |
svn merge -r124872:124873
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.threefour-merge-1a
QAR-1592 Merge of changes between 1.23 RC2 and 1.23 Final to trunk
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 12 | ||||
-rw-r--r-- | indra/llrender/llimagegl.h | 7 |
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 |