diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-04-29 17:38:15 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2021-04-29 17:38:15 +0300 |
commit | c8977fd904df10f225915ac5527d279440356257 (patch) | |
tree | 1701da8b3680bf6a65cab2dbe9edf6d620ff74be /indra/newview/llviewertexturelist.cpp | |
parent | 39503419163aff0cb1cd305de924f4edc68833b0 (diff) |
SL-15177 Fix the way of counting for gTextureTimer
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 561319ca5d..82973d3278 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -205,6 +205,9 @@ static std::string get_texture_list_name() void LLViewerTextureList::doPrefetchImages() { + gTextureTimer.start(); + gTextureTimer.pause(); + if (LLAppViewer::instance()->getPurgeCache()) { // cache was purged, no point @@ -1402,6 +1405,33 @@ S32Megabytes LLViewerTextureList::getMaxVideoRamSetting(bool get_recommended, fl return max_texmem; } +bool LLViewerTextureList::isPrioRequestsFetched() +{ + static LLCachedControl<F32> prio_threshold(gSavedSettings, "TextureFetchUpdatePriorityThreshold", 0.0f); + static LLCachedControl<F32> fetching_textures_threshold(gSavedSettings, "TextureListFetchingThreshold", 0.97f); + S32 fetching_tex_count = 0; + S32 tex_count_threshold = gTextureList.mImageList.size() * (1 - fetching_textures_threshold); + + for (LLViewerTextureList::image_priority_list_t::iterator iter = gTextureList.mImageList.begin(); + iter != gTextureList.mImageList.end(); ) + { + LLPointer<LLViewerFetchedTexture> imagep = *iter++; + if (imagep->getDecodePriority() > prio_threshold) + { + if (imagep->hasFetcher() || imagep->isFetching()) + { + fetching_tex_count++; + if (fetching_tex_count >= tex_count_threshold) + { + return false; + } + } + } + } + + return true; +} + const S32Megabytes VIDEO_CARD_FRAMEBUFFER_MEM(12); const S32Megabytes MIN_MEM_FOR_NON_TEXTURE(512); void LLViewerTextureList::updateMaxResidentTexMem(S32Megabytes mem) |