new fasttimers, including ui.

This commit is contained in:
Shyotl
2012-01-23 18:30:54 -06:00
parent 7d4c2aa54f
commit 6374f012de
93 changed files with 3566 additions and 1620 deletions

View File

@@ -440,9 +440,20 @@ const S32 min_non_tex_system_mem = (128<<20); // 128 MB
F32 texmem_lower_bound_scale = 0.85f;
F32 texmem_middle_bound_scale = 0.925f;
static LLFastTimer::DeclareTimer FTM_TEXTURE_MEMORY_CHECK("Memory Check");
//static
bool LLViewerTexture::isMemoryForTextureLow()
{
const F32 WAIT_TIME = 1.0f ; //second
static LLFrameTimer timer ;
if(timer.getElapsedTimeF32() < WAIT_TIME) //call this once per second.
{
return false;
}
timer.reset() ;
LLFastTimer t(FTM_TEXTURE_MEMORY_CHECK);
const static S32 MIN_FREE_TEXTURE_MEMORY = 5 ; //MB
const static S32 MIN_FREE_MAIN_MEMORy = 100 ; //MB
@@ -456,6 +467,15 @@ bool LLViewerTexture::isMemoryForTextureLow()
{
low_mem = true ;
}
if(!low_mem) //check main memory, only works for windows.
{
LLMemory::updateMemoryInfo() ;
if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy)
{
low_mem = true ;
}
}
}
#if 0 //ignore nVidia cards
else if (gGLManager.mHasNVXMemInfo)
@@ -470,18 +490,15 @@ bool LLViewerTexture::isMemoryForTextureLow()
}
#endif
if(!low_mem) //check main memory, only works for windows.
{
LLMemory::updateMemoryInfo() ;
if(LLMemory::getAvailableMemKB() / 1024 < MIN_FREE_MAIN_MEMORy)
{
low_mem = true ;
}
}
return low_mem ;
}
#if NEW_MEDIA_TEXTURE
static LLFastTimer::DeclareTimer FTM_TEXTURE_UPDATE_MEDIA("Media");
#endif //NEW_MEDIA_TEXTURE
#if 0
static LLFastTimer::DeclareTimer FTM_TEXTURE_UPDATE_TEST("Test");
#endif
//static
void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity)
{
@@ -491,11 +508,15 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity
LLTexturePipelineTester* tester = (LLTexturePipelineTester*)LLMetricPerformanceTesterBasic::getTester(sTesterName);
if (tester)
{
LLFastTimer t(FTM_TEXTURE_UPDATE_TEST);
tester->update() ;
}
#endif
#if NEW_MEDIA_TEXTURE
LLViewerMediaTexture::updateClass() ;
{
LLFastTimer t(FTM_TEXTURE_UPDATE_MEDIA);
LLViewerMediaTexture::updateClass() ;
}
#endif //NEW_MEDIA_TEXTURE
sBoundTextureMemoryInBytes = LLImageGL::sBoundTextureMemoryInBytes;//in bytes