summaryrefslogtreecommitdiff
path: root/indra/newview/llviewertexturelist.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-03-02 00:46:10 +0200
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-03-02 00:46:10 +0200
commit0aaf5284dced4ec41924c771a382d12ddc5f3d1b (patch)
tree448ad9399feee611f992ceeb667cd4e47e9ab594 /indra/newview/llviewertexturelist.cpp
parent882600de2afa366729be870355767282247be0ef (diff)
parent6ca09a94554ec01f5c94ec60fffd01d7e33f3546 (diff)
Merge branch 'master' into DRTVWR-539
# Conflicts: # autobuild.xml # doc/contributions.txt # indra/cmake/GLOD.cmake # indra/llcommon/tests/llprocess_test.cpp # indra/newview/VIEWER_VERSION.txt # indra/newview/lldrawpoolavatar.cpp # indra/newview/llfloatermodelpreview.cpp # indra/newview/llmodelpreview.cpp # indra/newview/llviewertexturelist.cpp # indra/newview/llvovolume.cpp # indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llviewertexturelist.cpp')
-rw-r--r--indra/newview/llviewertexturelist.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index dd18cdc9e8..f9fd0f85e3 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -204,6 +204,9 @@ static std::string get_texture_list_name()
void LLViewerTextureList::doPrefetchImages()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
+ gTextureTimer.start();
+ gTextureTimer.pause();
+
if (LLAppViewer::instance()->getPurgeCache())
{
// cache was purged, no point
@@ -1401,6 +1404,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)