summaryrefslogtreecommitdiff
path: root/indra/newview/llvlcomposition.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2026-05-12 20:23:44 -0400
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2026-05-12 20:23:44 -0400
commit82db4943e011fc65e9a0b87990abb49b898a7782 (patch)
treec7a16b81c6d681db2277cc95b875968206cb0509 /indra/newview/llvlcomposition.cpp
parent5d5c74c27f7354dba499acb3534c64a9a7fa3dc7 (diff)
Rework texture streaming and tracking.
This is a big one: - Reworks the discard signal almost entirely. Now has a normalized 0..1 discard signal: distance x size x channel exponent, floored by staleness and background app state. Shaped by VRAM pressure. - Textures can now scale down to the smallest GPU mip (1×1), independent of the codec's encoded mip count. - Terrain texture LOD now works. Useful for 2K textures and PBR on terrain. Based upon camera distance to nearest terrain patch. - New texture quality setting. Low/Medium/High/Ultra - Caps texture resolution on Low to 1024, and otherwise shifts the discard signal around. Makes distance based texture LOD work a lot more predictably. - We now track last bind state for textures, and discard accordingly. We progressively discard based upon last bind time. - Avatar textures get a residency boost to stay loaded in VRAM longer under pressure.
Diffstat (limited to 'indra/newview/llvlcomposition.cpp')
-rw-r--r--indra/newview/llvlcomposition.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/indra/newview/llvlcomposition.cpp b/indra/newview/llvlcomposition.cpp
index 3441e25c6a..eb0261b5e5 100644
--- a/indra/newview/llvlcomposition.cpp
+++ b/indra/newview/llvlcomposition.cpp
@@ -173,7 +173,10 @@ LLPointer<LLViewerFetchedTexture> fetch_terrain_texture(const LLUUID& id)
return nullptr;
}
- LLPointer<LLViewerFetchedTexture> tex = LLViewerTextureManager::getFetchedTexture(id);
+ // LOD_TEXTURE so streaming math runs (the base-class processTextureStats
+ // pins mDesiredDiscardLevel at 0).
+ LLPointer<LLViewerFetchedTexture> tex = LLViewerTextureManager::getFetchedTexture(
+ id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE);
return tex;
}
@@ -343,18 +346,9 @@ bool LLTerrainMaterials::makeTextureReady(LLPointer<LLViewerFetchedTexture>& tex
{
if (boost)
{
+ // Quality is driven by the streaming math via synthetic signals
+ // for BOOST_TERRAIN textures in updateImageDecodePriority.
boost_minimap_texture(tex, BASE_SIZE*BASE_SIZE);
-
- S32 width = tex->getFullWidth();
- S32 height = tex->getFullHeight();
- S32 min_dim = llmin(width, height);
- S32 ddiscard = 0;
- while (min_dim > BASE_SIZE && ddiscard < MAX_DISCARD_LEVEL)
- {
- ddiscard++;
- min_dim /= 2;
- }
- tex->setMinDiscardLevel(ddiscard);
}
return false;
}