From d76e6507f8991a11c9e7e99550d1536af7895e05 Mon Sep 17 00:00:00 2001 From: minerjr Date: Fri, 21 Feb 2025 07:46:34 -0400 Subject: [PATCH] Revert "FIRE-35081 - Blurry prims not changing with graphics settings, not happening with SL Viewer" This reverts commit 1e31a5caf5bea21ba3cde149b2428968a8f0cdcc. --- indra/llrender/llgltexture.cpp | 23 ++----------- indra/llrender/llgltexture.h | 19 ++--------- indra/newview/lltextureview.cpp | 15 ++++----- indra/newview/llviewerobject.cpp | 20 +----------- indra/newview/llviewertexture.cpp | 47 ++++----------------------- indra/newview/llviewertexture.h | 20 ++---------- indra/newview/llviewertexturelist.cpp | 39 +++------------------- 7 files changed, 26 insertions(+), 157 deletions(-) diff --git a/indra/llrender/llgltexture.cpp b/indra/llrender/llgltexture.cpp index 7644779365..87e7400a24 100644 --- a/indra/llrender/llgltexture.cpp +++ b/indra/llrender/llgltexture.cpp @@ -63,10 +63,6 @@ LLGLTexture::~LLGLTexture() void LLGLTexture::init() { mBoostLevel = LLGLTexture::BOOST_NONE; - // - // Added a previous boost level to allow for restorign boost after BOOST_SELECTED is applied - mPrevBoostLevel = LLGLTexture::BOOST_NONE; - // mFullWidth = 0; mFullHeight = 0; @@ -95,11 +91,8 @@ void LLGLTexture::dump() mGLTexturep->dump(); } } -// -//void LLGLTexture::setBoostLevel(S32 level) -// Changed Changed from S32 to S8, to give up space and use the difference for a previous value -void LLGLTexture::setBoostLevel(S8 level) -// + +void LLGLTexture::setBoostLevel(S32 level) { if(mBoostLevel != level) { @@ -114,18 +107,6 @@ void LLGLTexture::setBoostLevel(S8 level) } } -// -// Changes the current boost level to the previous value -void LLGLTexture::restoreBoostLevel() -{ - mBoostLevel = mPrevBoostLevel; -} -// Stores the current boost level in a the previous boost. -void LLGLTexture::storeBoostLevel() -{ - mPrevBoostLevel = mBoostLevel; -} -// void LLGLTexture::forceActive() { mTextureState = ACTIVE ; diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h index c89a4a84e2..48132fa956 100644 --- a/indra/llrender/llgltexture.h +++ b/indra/llrender/llgltexture.h @@ -99,15 +99,8 @@ public: virtual const LLUUID& getID() const; - // - //void setBoostLevel(S32 level); - //S32 getBoostLevel() { return mBoostLevel; } - // Updated to fix issue with BOOST_SELECTION forceing textures to BOOST_NONE after de-selection - void setBoostLevel(S8 level); - void restoreBoostLevel(); // Now restores the mBoostLevel with the mPrevBoostLevel - void storeBoostLevel(); // Stores the current mBoostLevel in mPrevBoostLevel - S8 getBoostLevel() { return mBoostLevel; } - // + void setBoostLevel(S32 level); + S32 getBoostLevel() { return mBoostLevel; } S32 getFullWidth() const { return mFullWidth; } S32 getFullHeight() const { return mFullHeight; } @@ -189,13 +182,7 @@ public: /*virtual*/ LLImageGL* getGLTexture() const ; protected: - // - //S32 mBoostLevel; // enum describing priority level - // Modified to store the previous boost level, as well, boost only go up to 30, so a 32 bit int is a waste and the extra bits - // can be used to store a previous value to allow for restoring the boost value after the BOOST_SELECTED is undone. - S8 mBoostLevel; // enum describing priority level - S8 mPrevBoostLevel; // enum describing priority level (Previous Value for BOOST_SELECTION restore) - // + S32 mBoostLevel; // enum describing priority level U32 mFullWidth; U32 mFullHeight; bool mUseMipMaps; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 359df125a3..47e5cd1053 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -711,22 +711,19 @@ void LLGLTexMemBar::draw() //text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d ", text = llformat("Tex: %d Fetch: %d(%d) Pkts:%d(%d) CAC R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d FCA:%d ", // - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Fixed up the data alignment for 32bit/64bit values as well as re-added the packet count back gTextureList.getNumImages(), LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(), - LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount, LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(), - (S32)LLLFSThread::sLocal->getPending(), - (S32)LLImageRaw::sRawImageCount, + LLLFSThread::sLocal->getPending(), + LLImageRaw::sRawImageCount, LLAppViewer::getTextureFetch()->getNumHTTPRequests(), - (S32)LLAppViewer::getImageDecodeThread()->getPending(), + LLAppViewer::getImageDecodeThread()->getPending(), // Fast cache stats //gTextureList.mCreateTextureList.size()); - (S32)gTextureList.mCreateTextureList.size(), - (S32)gTextureList.mFastCacheList.size()); + gTextureList.mCreateTextureList.size(), + gTextureList.mFastCacheList.size()); // - // + x_right = 550.0f; LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0.f, (F32)(v_offset + line_height*3), text_color, LLFontGL::LEFT, LLFontGL::TOP, diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index baad001d0a..38b3c5d31e 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4192,14 +4192,6 @@ void LLViewerObject::boostTexturePriority(bool boost_children /* = true */) S32 tex_count = getNumTEs(); for (i = 0; i < tex_count; i++) { - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // This isused to fix the textures becoming blury when object interacted with by the user and unselected. - // If this is changing the boost level for the TEImage for the first time, store the boost level before modifying it. - if (getTEImage(i)->getBoostLevel() != LLGLTexture::BOOST_SELECTED) - { - getTEImage(i)->storeBoostLevel(); - } - // getTEImage(i)->setBoostLevel(LLGLTexture::BOOST_SELECTED); } @@ -4207,17 +4199,7 @@ void LLViewerObject::boostTexturePriority(bool boost_children /* = true */) { LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); LLUUID sculpt_id = sculpt_params->getSculptTexture(); - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - //LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED); - // This isused to fix the textures becoming blury when object interacted with by the user and unselected. - // If this is changing the boost level for the sculpted for the first time, store the boost level before modifying it. - LLViewerFetchedTexture* sculptedTexture = LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); - if (sculptedTexture->getBoostLevel() != LLGLTexture::BOOST_SELECTED) - { - sculptedTexture->storeBoostLevel(); - } - sculptedTexture->setBoostLevel(LLGLTexture::BOOST_SELECTED); - // + LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED); } if (boost_children) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 3791b7dc6d..363f62b5f2 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -90,9 +90,6 @@ S32 LLViewerTexture::sRawCount = 0; S32 LLViewerTexture::sAuxCount = 0; LLFrameTimer LLViewerTexture::sEvaluationTimer; F32 LLViewerTexture::sDesiredDiscardBias = 0.f; -// [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer -F32 LLViewerTexture::sPrevDesiredDiscardBias = 0.f; -// [FIRE-35081] S32 LLViewerTexture::sMaxSculptRez = 128; //max sculpt image size constexpr S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64; @@ -542,10 +539,6 @@ void LLViewerTexture::updateClass() static bool was_low = false; static bool was_sys_low = false; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Store the previous desired discard bias to control the bias recovery - sPrevDesiredDiscardBias = sDesiredDiscardBias; - // [FIRE-35081] if (is_low && !was_low) { // slam to 1.5 bias the moment we hit low memory (discards off screen textures immediately) @@ -583,17 +576,12 @@ void LLViewerTexture::updateClass() // don't execute above until the slam to 1.5 has a chance to take effect sEvaluationTimer.reset(); - // lower discard bias over time when at least 10% of budget is free - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - //if (sDesiredDiscardBias > 1.f && over_pct < 0.f) - const F32 FREE_PERCENTAGE_TRESHOLD = -0.1f; // Added code from Mainline LL for thier 'Fix' - if (sDesiredDiscardBias > 1.f && over_pct < FREE_PERCENTAGE_TRESHOLD) // Added code from Mainline LL for thier 'Fix' + // lower discard bias over time when free memory is available + if (sDesiredDiscardBias > 1.f && over_pct < 0.f) { static LLCachedControl high_mem_discard_decrement(gSavedSettings, "RenderHighMemMinDiscardDecrement", .1f); - //F32 decrement = high_mem_discard_decrement - llmin(over_pct, 0.1f); - F32 decrement = high_mem_discard_decrement - llmin(over_pct - FREE_PERCENTAGE_TRESHOLD, 0.f); // Added code from Mainline LL for thier 'Fix' - // [FIRE-35081] + F32 decrement = high_mem_discard_decrement - llmin(over_pct, 0.f); sDesiredDiscardBias -= decrement * gFrameIntervalSeconds; } } @@ -715,10 +703,6 @@ void LLViewerTexture::init(bool firstinit) mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval; mParcelMedia = NULL; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Added default value fro the boost as it seemed that there were some instances boost was not being initalized. - mBoostLevel = LLGLTexture::BOOST_NONE; - // memset(&mNumVolumes, 0, sizeof(U32)* LLRender::NUM_VOLUME_TEXTURE_CHANNELS); mVolumeList[LLRender::LIGHT_TEX].clear(); mVolumeList[LLRender::SCULPT_TEX].clear(); @@ -764,11 +748,7 @@ void LLViewerTexture::dump() << LL_ENDL; } -// [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer -//void LLViewerTexture::setBoostLevel(S32 level) -// Reduced the amount of data used for storing the boost level -void LLViewerTexture::setBoostLevel(S8 level) -// +void LLViewerTexture::setBoostLevel(S32 level) { if(mBoostLevel != level) { @@ -1192,10 +1172,6 @@ void LLViewerFetchedTexture::init(bool firstinit) mLastCallBackActiveTime = 0.f; mForceCallbackFetch = false; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Added default for boost level - mBoostLevel = LLGLTexture::BOOST_NONE; - // mFTType = FTT_UNKNOWN; } @@ -1840,13 +1816,6 @@ void LLViewerFetchedTexture::processTextureStats() mFullyLoaded = false; } } - - // selection manager will immediately reset BOOST_SELECTED but never unsets it - // unset it immediately after we consume it - if (getBoostLevel() == BOOST_SELECTED) - { - restoreBoostLevel(); - } } //============================================================================ @@ -1885,7 +1854,7 @@ bool LLViewerFetchedTexture::isActiveFetching() return mFetchState > 8 && mFetchState < 11 && monitor_enabled; //in state of WAIT_HTTP_REQ or DECODE_IMAGE. } -void LLViewerFetchedTexture::setBoostLevel(S8 level) +void LLViewerFetchedTexture::setBoostLevel(S32 level) { LLViewerTexture::setBoostLevel(level); @@ -3028,10 +2997,6 @@ void LLViewerLODTexture::init(bool firstinit) mTexelsPerImage = 64*64; mDiscardVirtualSize = 0.f; mCalculatedDiscardLevel = -1.f; - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - // Added default value fro the boost as it seemed that there were some instances boost was not being initalized. - mBoostLevel = LLGLTexture::BOOST_NONE; - // } //virtual @@ -3166,7 +3131,7 @@ void LLViewerLODTexture::processTextureStats() // unset it immediately after we consume it if (getBoostLevel() == BOOST_SELECTED) { - restoreBoostLevel(); + setBoostLevel(BOOST_NONE); } } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index a86e522ee9..bf890dbde7 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -137,13 +137,8 @@ public: /*virtual*/ bool isActiveFetching(); /*virtual*/ const LLUUID& getID() const { return mID; } - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - //virtual void setBoostLevel(S32 level); - //S32 getBoostLevel() { return mBoostLevel; } - // Updated to only use S8 instead of S32 to allow for extra S8 to store old boost level - virtual void setBoostLevel(S8 level); - S8 getBoostLevel() { return mBoostLevel; } - // [FIRE-35081] + virtual void setBoostLevel(S32 level); + S32 getBoostLevel() { return mBoostLevel; } void setTextureListType(S32 tex_type) { mTextureListType = tex_type; } S32 getTextureListType() { return mTextureListType; } @@ -231,11 +226,6 @@ public: static S32 sAuxCount; static LLFrameTimer sEvaluationTimer; static F32 sDesiredDiscardBias; - // - // Added a previous value for the desired discard value, as it can become stuck at a higher value and - // we wnat to reduce the nubmer of textures being processed at that state (IE steady state) - static F32 sPrevDesiredDiscardBias; - // [FIRE-35081] static S32 sMaxSculptRez ; static U32 sMinLargeImageSize ; static U32 sMaxSmallImageSize ; @@ -376,11 +366,7 @@ public: S32 getDesiredDiscardLevel() { return mDesiredDiscardLevel; } void setMinDiscardLevel(S32 discard) { mMinDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel,(S8)discard); } - // - //void setBoostLevel(S32 level) override; - // Updated to use only S8 value for boost level - void setBoostLevel(S8 level) override; - // [FIRE-35081] + void setBoostLevel(S32 level) override; bool updateFetch(); void clearFetchedResults(); //clear all fetched results, for debug use. diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 83006cf208..c15ef711d5 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -919,23 +919,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag // convert bias into a vsize scaler bias = (F32) llroundf(powf(4, bias - 1.f)); - // - // Added checks to not apply bias to non LOD textures - switch (imagep->getType()) - { - case LLViewerTexture::LOCAL_TEXTURE: - case LLViewerTexture::MEDIA_TEXTURE: - case LLViewerTexture::DYNAMIC_TEXTURE: - case LLViewerTexture::FETCHED_TEXTURE: - bias = 1.00f; - break; - } - // Also don't bias textures what are close to the screen or recently close to the screen. - if (imagep->getDontDiscard() || imagep->getDiscardLevel() == 0 || imagep->getDiscardLevel() == 1) - { - bias = 1.00f; - } - // [FIRE-35081] LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) { @@ -1003,12 +986,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag { // conditionally reset max virtual size for unboosted LOD_TEXTURES // this is an alternative to decaying mMaxVirtualSize over time // that keeps textures from continously downrezzing and uprezzing in the background - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - //if (LLViewerTexture::sDesiredDiscardBias > 1.5f || - // (!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f)) - if ((LLViewerTexture::sDesiredDiscardBias > 1.5f || (!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f)) - && !(imagep->getDontDiscard() || imagep->getDiscardLevel() == 0 || imagep->getDiscardLevel() == 1))// Added checks to not force scale down recently close to camera textures - // [FIRE-35081] + + if (LLViewerTexture::sDesiredDiscardBias > 1.5f || + (!on_screen && LLViewerTexture::sDesiredDiscardBias > 1.f)) { imagep->mMaxVirtualSize = 0.f; } @@ -1114,12 +1094,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time) imagep->mCreatePending = false; mCreateTextureList.pop(); - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - //if (imagep->hasGLTexture() && imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel()) - // Added checks to only downscale LOD_TEXTUREs that are not boost_high to match the Decode Priority - // This saves a bunch of texture size contension. - if (imagep->hasGLTexture() && imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel() - && imagep->getType() == LLViewerTexture::LOD_TEXTURE && imagep->getBoostLevel() < LLViewerTexture::BOOST_HIGH) + if (imagep->hasGLTexture() && imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel()) { // NOTE: this may happen if the desired discard reduces while a decode is in progress and does not // necessarily indicate a problem, but if log occurrences excede that of dsiplay_stats: FPS, @@ -1239,11 +1214,7 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time) //update MIN_UPDATE_COUNT or 5% of other textures, whichever is greater update_count = llmax((U32) MIN_UPDATE_COUNT, (U32) mUUIDMap.size()/20); - // [FIRE-35081] Blurry prims not changing with graphics settings, not happening with SL Viewer - //if (LLViewerTexture::sDesiredDiscardBias > 1.f) - // Prevent the steady state of the high discard from keep using a high number of textures to process - if (LLViewerTexture::sDesiredDiscardBias > 1.f && LLViewerTexture::sDesiredDiscardBias > LLViewerTexture::sPrevDesiredDiscardBias) - // [FIRE-35081] + if (LLViewerTexture::sDesiredDiscardBias > 1.f) { // we are over memory target, update more agresively update_count = (S32)(update_count * LLViewerTexture::sDesiredDiscardBias);