From c85880aca971493ea5f7c80b8f152e0e8d00813c Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Mon, 13 Jan 2025 17:54:02 +0200 Subject: #3371 Texture resolution cap --- indra/newview/llviewertexture.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 271460f2cc..3f30a42b0e 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1694,6 +1694,16 @@ void LLViewerFetchedTexture::processTextureStats() static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes", false); + if (mBoostLevel < LLGLTexture::BOOST_HIGH) + { + // restrict texture resolution to download based on RenderMaxTextureResolution + static LLCachedControl max_texture_resolution(gSavedSettings, "RenderMaxTextureResolution", 2048); + // sanity clamp debug setting to avoid settings hack shenanigans + F32 tex_res = (F32)llclamp((S32)max_texture_resolution, 512, MAX_IMAGE_SIZE_DEFAULT); + tex_res *= tex_res; + mMaxVirtualSize = llmin(mMaxVirtualSize, tex_res); + } + if (textures_fullres) { mDesiredDiscardLevel = 0; @@ -2948,10 +2958,12 @@ void LLViewerLODTexture::processTextureStats() static LLCachedControl textures_fullres(gSavedSettings,"TextureLoadFullRes", false); - { // restrict texture resolution to download based on RenderMaxTextureResolution + if (mBoostLevel < LLGLTexture::BOOST_HIGH) + { + // restrict texture resolution to download based on RenderMaxTextureResolution static LLCachedControl max_texture_resolution(gSavedSettings, "RenderMaxTextureResolution", 2048); // sanity clamp debug setting to avoid settings hack shenanigans - F32 tex_res = (F32)llclamp((S32)max_texture_resolution, 512, 2048); + F32 tex_res = (F32)llclamp((S32)max_texture_resolution, 512, MAX_IMAGE_SIZE_DEFAULT); tex_res *= tex_res; mMaxVirtualSize = llmin(mMaxVirtualSize, tex_res); } -- cgit v1.2.3