aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llrender')
-rw-r--r--linden/indra/llrender/llimagegl.cpp12
-rw-r--r--linden/indra/llrender/llimagegl.h7
2 files changed, 11 insertions, 8 deletions
diff --git a/linden/indra/llrender/llimagegl.cpp b/linden/indra/llrender/llimagegl.cpp
index cdf626e..d1efb11 100644
--- a/linden/indra/llrender/llimagegl.cpp
+++ b/linden/indra/llrender/llimagegl.cpp
@@ -54,8 +54,8 @@ LLGLuint LLImageGL::sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS] = { 0 };
54 54
55U32 LLImageGL::sUniqueCount = 0; 55U32 LLImageGL::sUniqueCount = 0;
56U32 LLImageGL::sBindCount = 0; 56U32 LLImageGL::sBindCount = 0;
57S32 LLImageGL::sGlobalTextureMemory = 0; 57S32 LLImageGL::sGlobalTextureMemoryInBytes = 0;
58S32 LLImageGL::sBoundTextureMemory = 0; 58S32 LLImageGL::sBoundTextureMemoryInBytes = 0;
59S32 LLImageGL::sCurBoundTextureMemory = 0; 59S32 LLImageGL::sCurBoundTextureMemory = 0;
60S32 LLImageGL::sCount = 0; 60S32 LLImageGL::sCount = 0;
61 61
@@ -174,7 +174,7 @@ S32 LLImageGL::dataFormatComponents(S32 dataformat)
174void LLImageGL::updateStats(F32 current_time) 174void LLImageGL::updateStats(F32 current_time)
175{ 175{
176 sLastFrameTime = current_time; 176 sLastFrameTime = current_time;
177 sBoundTextureMemory = sCurBoundTextureMemory; 177 sBoundTextureMemoryInBytes = sCurBoundTextureMemory;
178 sCurBoundTextureMemory = 0; 178 sCurBoundTextureMemory = 0;
179} 179}
180 180
@@ -1013,13 +1013,13 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_
1013 1013
1014 if (old_name != 0) 1014 if (old_name != 0)
1015 { 1015 {
1016 sGlobalTextureMemory -= mTextureMemory; 1016 sGlobalTextureMemoryInBytes -= mTextureMemory;
1017 LLImageGL::deleteTextures(1, &old_name); 1017 LLImageGL::deleteTextures(1, &old_name);
1018 stop_glerror(); 1018 stop_glerror();
1019 } 1019 }
1020 1020
1021 mTextureMemory = getMipBytes(discard_level); 1021 mTextureMemory = getMipBytes(discard_level);
1022 sGlobalTextureMemory += mTextureMemory; 1022 sGlobalTextureMemoryInBytes += mTextureMemory;
1023 setActive() ; 1023 setActive() ;
1024 1024
1025 // mark this as bound at this point, so we don't throw it out immediately 1025 // mark this as bound at this point, so we don't throw it out immediately
@@ -1220,7 +1220,7 @@ void LLImageGL::destroyGLTexture()
1220 } 1220 }
1221 } 1221 }
1222 1222
1223 sGlobalTextureMemory -= mTextureMemory; 1223 sGlobalTextureMemoryInBytes -= mTextureMemory;
1224 mTextureMemory = 0; 1224 mTextureMemory = 0;
1225 1225
1226 LLImageGL::deleteTextures(1, &mTexName); 1226 LLImageGL::deleteTextures(1, &mTexName);
diff --git a/linden/indra/llrender/llimagegl.h b/linden/indra/llrender/llimagegl.h
index 4f737bc..2f08a5a 100644
--- a/linden/indra/llrender/llimagegl.h
+++ b/linden/indra/llrender/llimagegl.h
@@ -42,6 +42,9 @@
42 42
43#include "llrender.h" 43#include "llrender.h"
44 44
45#define BYTES_TO_MEGA_BYTES(x) ((x) >> 20)
46#define MEGA_BYTES_TO_BYTES(x) ((x) << 20)
47
45//============================================================================ 48//============================================================================
46 49
47class LLImageGL : public LLRefCount 50class LLImageGL : public LLRefCount
@@ -238,8 +241,8 @@ public:
238 static LLGLuint sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS]; // Currently bound texture ID 241 static LLGLuint sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS]; // Currently bound texture ID
239 242
240 // Global memory statistics 243 // Global memory statistics
241 static S32 sGlobalTextureMemory; // Tracks main memory texmem 244 static S32 sGlobalTextureMemoryInBytes; // Tracks main memory texmem
242 static S32 sBoundTextureMemory; // Tracks bound texmem for last completed frame 245 static S32 sBoundTextureMemoryInBytes; // Tracks bound texmem for last completed frame
243 static S32 sCurBoundTextureMemory; // Tracks bound texmem for current frame 246 static S32 sCurBoundTextureMemory; // Tracks bound texmem for current frame
244 static U32 sBindCount; // Tracks number of texture binds for current frame 247 static U32 sBindCount; // Tracks number of texture binds for current frame
245 static U32 sUniqueCount; // Tracks number of unique texture binds for current frame 248 static U32 sUniqueCount; // Tracks number of unique texture binds for current frame