summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerdisplay.cpp
diff options
context:
space:
mode:
authorBrad Linden <46733234+brad-linden@users.noreply.github.com>2024-10-30 10:16:17 -0700
committerGitHub <noreply@github.com>2024-10-30 10:16:17 -0700
commit1f9911a1f06c728f3b432f049eaa929ba62f1b97 (patch)
tree195a27cc669b457508a8c5aa1cf154a12824950a /indra/newview/llviewerdisplay.cpp
parenta2c86616360fe51e8d766796bed80e73444823d5 (diff)
parent74b0c86e48387e2154cb2acf03f626ca11229bce (diff)
Merge pull request #2864 from secondlife/brad/2549-downrez-controls
Provide affordances to disable automatic downrezing of textures when SL is in background
Diffstat (limited to 'indra/newview/llviewerdisplay.cpp')
-rw-r--r--indra/newview/llviewerdisplay.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index f722d0bd1d..6b90fea707 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -474,6 +474,35 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
// true = minimized, do not show/update the TP screen. HB
update_tp_display(true);
}
+
+ // Run texture subsystem to discard memory while backgrounded
+ if (!gNonInteractive)
+ {
+ LL_PROFILE_ZONE_NAMED("Update Images");
+
+ {
+ LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Class");
+ LLViewerTexture::updateClass();
+ }
+
+ {
+ LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("Image Update Bump");
+ gBumpImageList.updateImages(); // must be called before gTextureList version so that it's textures are thrown out first.
+ }
+
+ {
+ LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("List");
+ F32 max_image_decode_time = 0.050f * gFrameIntervalSeconds.value(); // 50 ms/second decode time
+ max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f); // min 2ms/frame, max 5ms/frame)
+ gTextureList.updateImages(max_image_decode_time);
+ }
+
+ {
+ LL_PROFILE_ZONE_NAMED_CATEGORY_DISPLAY("GLTF Materials Cleanup");
+ // remove dead gltf materials
+ gGLTFMaterialList.flushMaterials();
+ }
+ }
return;
}