Enable texture auditing categories, also fixed potential buffer underread related to auditing.

This commit is contained in:
Shyotl
2012-07-21 03:27:43 -05:00
parent 95abf3dca3
commit 3710ea903e

View File

@@ -2001,7 +2001,6 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
void LLImageGL::setCategory(S32 category) void LLImageGL::setCategory(S32 category)
{ {
#if 0 //turn this off temporarily because it is not in use now.
if(!gAuditTexture) if(!gAuditTexture)
{ {
return ; return ;
@@ -2022,7 +2021,6 @@ void LLImageGL::setCategory(S32 category)
mCategory = -1 ; mCategory = -1 ;
} }
} }
#endif
} }
//for debug use //for debug use
@@ -2053,14 +2051,16 @@ S32 LLImageGL::getTextureCounterIndex(U32 val)
void LLImageGL::incTextureCounter(U32 val, S32 ncomponents, S32 category) void LLImageGL::incTextureCounter(U32 val, S32 ncomponents, S32 category)
{ {
sTextureLoadedCounter[getTextureCounterIndex(val)]++ ; sTextureLoadedCounter[getTextureCounterIndex(val)]++ ;
sTextureMemByCategory[category] += (S32)val * ncomponents ; if(category > -1)
sTextureMemByCategory[category] += (S32)val * ncomponents ;
} }
//static //static
void LLImageGL::decTextureCounter(U32 val, S32 ncomponents, S32 category) void LLImageGL::decTextureCounter(U32 val, S32 ncomponents, S32 category)
{ {
sTextureLoadedCounter[getTextureCounterIndex(val)]-- ; sTextureLoadedCounter[getTextureCounterIndex(val)]-- ;
sTextureMemByCategory[category] += (S32)val * ncomponents ; if(category > -1)
sTextureMemByCategory[category] -= (S32)val * ncomponents ;
} }
void LLImageGL::setCurTexSizebar(S32 index, BOOL set_pick_size) void LLImageGL::setCurTexSizebar(S32 index, BOOL set_pick_size)