diff options
author | Oz Linden <oz@lindenlab.com> | 2011-11-24 06:56:57 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2011-11-24 06:56:57 -0500 |
commit | b69be18d7b41b639d3c62354ca7ab6e3bc32f1cb (patch) | |
tree | 355347be68e29f59ad5299abd9b42423359eb60e /indra/newview/llviewertexturelist.cpp | |
parent | fb605a047aa1c6b293b9546a06ac800c53d109ba (diff) | |
parent | 8c86a08e72708e96dcf67830518187a00478bbfd (diff) |
merge changes for vmrg-193
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 66 |
1 files changed, 44 insertions, 22 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index a48572f792..cddf7dcfea 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -588,6 +588,11 @@ void LLViewerTextureList::dirtyImage(LLViewerFetchedTexture *image) //////////////////////////////////////////////////////////////////////////// static LLFastTimer::DeclareTimer FTM_IMAGE_MARK_DIRTY("Dirty Images"); +static LLFastTimer::DeclareTimer FTM_IMAGE_UPDATE_PRIORITIES("Prioritize"); +static LLFastTimer::DeclareTimer FTM_IMAGE_CALLBACKS("Callbacks"); +static LLFastTimer::DeclareTimer FTM_IMAGE_FETCH("Fetch"); +static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create"); +static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats"); void LLViewerTextureList::updateImages(F32 max_time) { @@ -599,14 +604,25 @@ void LLViewerTextureList::updateImages(F32 max_time) LLViewerStats::getInstance()->mGLBoundMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageGL::sBoundTextureMemoryInBytes)); LLViewerStats::getInstance()->mRawMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageRaw::sGlobalRawMemory)); LLViewerStats::getInstance()->mFormattedMemStat.addValue((F32)BYTES_TO_MEGA_BYTES(LLImageFormatted::sGlobalFormattedMemory)); - - updateImagesDecodePriorities(); + + + { + LLFastTimer t(FTM_IMAGE_UPDATE_PRIORITIES); + updateImagesDecodePriorities(); + } F32 total_max_time = max_time; - max_time -= updateImagesFetchTextures(max_time); + + { + LLFastTimer t(FTM_IMAGE_FETCH); + max_time -= updateImagesFetchTextures(max_time); + } - max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time - max_time -= updateImagesCreateTextures(max_time); + { + LLFastTimer t(FTM_IMAGE_CREATE); + max_time = llmax(max_time, total_max_time*.50f); // at least 50% of max_time + max_time -= updateImagesCreateTextures(max_time); + } if (!mDirtyTextureList.empty()) { @@ -614,24 +630,32 @@ void LLViewerTextureList::updateImages(F32 max_time) gPipeline.dirtyPoolObjectTextures(mDirtyTextureList); mDirtyTextureList.clear(); } - bool didone = false; - for (image_list_t::iterator iter = mCallbackList.begin(); - iter != mCallbackList.end(); ) + { - //trigger loaded callbacks on local textures immediately - LLViewerFetchedTexture* image = *iter++; - if (!image->getUrl().empty()) + LLFastTimer t(FTM_IMAGE_CALLBACKS); + bool didone = false; + for (image_list_t::iterator iter = mCallbackList.begin(); + iter != mCallbackList.end(); ) { - // Do stuff to handle callbacks, update priorities, etc. - didone = image->doLoadedCallbacks(); - } - else if (!didone) - { - // Do stuff to handle callbacks, update priorities, etc. - didone = image->doLoadedCallbacks(); + //trigger loaded callbacks on local textures immediately + LLViewerFetchedTexture* image = *iter++; + if (!image->getUrl().empty()) + { + // Do stuff to handle callbacks, update priorities, etc. + didone = image->doLoadedCallbacks(); + } + else if (!didone) + { + // Do stuff to handle callbacks, update priorities, etc. + didone = image->doLoadedCallbacks(); + } } } - updateImagesUpdateStats(); + + { + LLFastTimer t(FTM_IMAGE_STATS); + updateImagesUpdateStats(); + } } void LLViewerTextureList::updateImagesDecodePriorities() @@ -749,7 +773,6 @@ void LLViewerTextureList::updateImagesDecodePriorities() return type_from_host; } */ -static LLFastTimer::DeclareTimer FTM_IMAGE_CREATE("Create Images"); F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) { @@ -759,8 +782,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) // Create GL textures for all textures that need them (images which have been // decoded, but haven't been pushed into GL). // - LLFastTimer t(FTM_IMAGE_CREATE); - + LLTimer create_timer; image_list_t::iterator enditer = mCreateTextureList.begin(); for (image_list_t::iterator iter = mCreateTextureList.begin(); |