@@ -108,12 +108,6 @@ LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTextur
108
108
109
109
const F64 log_2 = log(2.0 );
110
110
111
- #if ADDRESS_SIZE == 32
112
- const U32 DESIRED_NORMAL_TEXTURE_SIZE = (U32)LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT / 2 ;
113
- #else
114
- const U32 DESIRED_NORMAL_TEXTURE_SIZE = (U32)LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT;
115
- #endif
116
-
117
111
// ----------------------------------------------------------------------------------------------
118
112
// namespace: LLViewerTextureAccess
119
113
// ----------------------------------------------------------------------------------------------
@@ -1694,14 +1688,14 @@ void LLViewerFetchedTexture::processTextureStats()
1694
1688
1695
1689
static LLCachedControl<bool > textures_fullres (gSavedSettings ," TextureLoadFullRes" , false );
1696
1690
1691
+ U32 max_tex_res = MAX_IMAGE_SIZE_DEFAULT;
1697
1692
if (mBoostLevel < LLGLTexture::BOOST_HIGH)
1698
1693
{
1699
1694
// restrict texture resolution to download based on RenderMaxTextureResolution
1700
1695
static LLCachedControl<U32> max_texture_resolution (gSavedSettings , " RenderMaxTextureResolution" , 2048 );
1701
1696
// sanity clamp debug setting to avoid settings hack shenanigans
1702
- F32 tex_res = (F32)llclamp ((S32)max_texture_resolution, 512 , MAX_IMAGE_SIZE_DEFAULT);
1703
- tex_res *= tex_res;
1704
- mMaxVirtualSize = llmin (mMaxVirtualSize , tex_res);
1697
+ max_tex_res = (U32)llclamp ((U32)max_texture_resolution, 512 , MAX_IMAGE_SIZE_DEFAULT);
1698
+ mMaxVirtualSize = llmin (mMaxVirtualSize , (F32)(max_tex_res * max_tex_res));
1705
1699
}
1706
1700
1707
1701
if (textures_fullres)
@@ -1725,10 +1719,9 @@ void LLViewerFetchedTexture::processTextureStats()
1725
1719
}
1726
1720
else
1727
1721
{
1728
- U32 desired_size = MAX_IMAGE_SIZE_DEFAULT; // MAX_IMAGE_SIZE_DEFAULT = 2048 and max size ever is 4096
1729
1722
if (!mKnownDrawWidth || !mKnownDrawHeight || (S32)mFullWidth <= mKnownDrawWidth || (S32)mFullHeight <= mKnownDrawHeight )
1730
1723
{
1731
- if (mFullWidth > desired_size || mFullHeight > desired_size )
1724
+ if (mFullWidth > max_tex_res || mFullHeight > max_tex_res )
1732
1725
{
1733
1726
mDesiredDiscardLevel = 1 ;
1734
1727
}
@@ -2958,14 +2951,14 @@ void LLViewerLODTexture::processTextureStats()
2958
2951
2959
2952
static LLCachedControl<bool > textures_fullres (gSavedSettings ," TextureLoadFullRes" , false );
2960
2953
2954
+ F32 max_tex_res = MAX_IMAGE_SIZE_DEFAULT;
2961
2955
if (mBoostLevel < LLGLTexture::BOOST_HIGH)
2962
2956
{
2963
2957
// restrict texture resolution to download based on RenderMaxTextureResolution
2964
2958
static LLCachedControl<U32> max_texture_resolution (gSavedSettings , " RenderMaxTextureResolution" , 2048 );
2965
2959
// sanity clamp debug setting to avoid settings hack shenanigans
2966
- F32 tex_res = (F32)llclamp ((S32)max_texture_resolution, 512 , MAX_IMAGE_SIZE_DEFAULT);
2967
- tex_res *= tex_res;
2968
- mMaxVirtualSize = llmin (mMaxVirtualSize , tex_res);
2960
+ max_tex_res = (F32)llclamp ((S32)max_texture_resolution, 512 , MAX_IMAGE_SIZE_DEFAULT);
2961
+ mMaxVirtualSize = llmin (mMaxVirtualSize , max_tex_res * max_tex_res);
2969
2962
}
2970
2963
2971
2964
if (textures_fullres)
@@ -3021,12 +3014,7 @@ void LLViewerLODTexture::processTextureStats()
3021
3014
discard_level = floorf (discard_level);
3022
3015
3023
3016
F32 min_discard = 0 .f ;
3024
- U32 desired_size = MAX_IMAGE_SIZE_DEFAULT; // MAX_IMAGE_SIZE_DEFAULT = 2048 and max size ever is 4096
3025
- if (mBoostLevel <= LLGLTexture::BOOST_SCULPTED)
3026
- {
3027
- desired_size = DESIRED_NORMAL_TEXTURE_SIZE;
3028
- }
3029
- if (mFullWidth > desired_size || mFullHeight > desired_size)
3017
+ if (mFullWidth > max_tex_res || mFullHeight > max_tex_res)
3030
3018
min_discard = 1 .f ;
3031
3019
3032
3020
discard_level = llclamp (discard_level, min_discard, (F32)MAX_DISCARD_LEVEL);
0 commit comments