diff options
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index f174e16624..7e14c621ad 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -921,6 +921,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag bool on_screen = false; U32 face_count = 0; + U32 max_faces_to_check = 1024; // get adjusted bias based on image resolution LLImageGL* img = imagep->getGLTexture(); @@ -933,13 +934,15 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) { - for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi) + face_count += imagep->getNumFaces(i); + S32 faces_to_check = (face_count > max_faces_to_check) ? 0 : imagep->getNumFaces(i); + + for (S32 fi = 0; fi < faces_to_check; ++fi) { LLFace* face = (*(imagep->getFaceList(i)))[fi]; if (face && face->getViewerObject()) { - ++face_count; F32 radius; F32 cos_angle_to_view_dir; @@ -1002,11 +1005,10 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag } } - if (face_count > 1024) + if (face_count > max_faces_to_check) { // this texture is used in so many places we should just boost it and not bother checking its vsize // this is especially important because the above is not time sliced and can hit multiple ms for a single texture - imagep->setBoostLevel(LLViewerFetchedTexture::BOOST_HIGH); - // Do we ever remove it? This also sets texture nodelete! + max_vsize = MAX_IMAGE_AREA; } if (imagep->getType() == LLViewerTexture::LOD_TEXTURE && imagep->getBoostLevel() == LLViewerTexture::BOOST_NONE) @@ -1205,6 +1207,8 @@ F32 LLViewerTextureList::updateImagesLoadingFastCache(F32 max_time) enditer = iter; LLViewerFetchedTexture *imagep = *curiter; imagep->loadFromFastCache(); + if (timer.getElapsedTimeF32() > max_time) + break; } mFastCacheList.erase(mFastCacheList.begin(), enditer); return timer.getElapsedTimeF32(); @@ -1316,7 +1320,7 @@ void LLViewerTextureList::decodeAllImages(F32 max_time) LLTimer timer; //loading from fast cache - updateImagesLoadingFastCache(max_time); + max_time -= updateImagesLoadingFastCache(max_time); // Update texture stats and priorities std::vector<LLPointer<LLViewerFetchedTexture> > image_list; |