From 8a527d676e54f90794705f7e9476ae07752892e5 Mon Sep 17 00:00:00 2001 From: minerjr Date: Fri, 21 Feb 2025 09:45:34 -0400 Subject: [PATCH] Add restore to mBoostLevel (mPrevBoostLevel) for BOOST_SELECTED interactions Added to the llgltexture a second boost level which will be used to properly restore the boost level after an object is right clicked on as the BOOST_SELECTED code does not restore the value the previous value. This does now and on all the child objects assigned to the object. Also fixed up the lltextureview.cpp as it had some merge issues from a long time ago and was missed. --- indra/llrender/llgltexture.cpp | 16 ++++++++++++++++ indra/llrender/llgltexture.h | 8 ++++++++ indra/newview/lltextureview.cpp | 14 ++++++++------ indra/newview/llviewerobject.cpp | 20 +++++++++++++++++++- indra/newview/llviewertexture.cpp | 5 ++++- 5 files changed, 55 insertions(+), 8 deletions(-) diff --git a/indra/llrender/llgltexture.cpp b/indra/llrender/llgltexture.cpp index 87e7400a24..89f2a75002 100644 --- a/indra/llrender/llgltexture.cpp +++ b/indra/llrender/llgltexture.cpp @@ -63,6 +63,10 @@ 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; @@ -107,6 +111,18 @@ void LLGLTexture::setBoostLevel(S32 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 48132fa956..3cf97d5c6b 100644 --- a/indra/llrender/llgltexture.h +++ b/indra/llrender/llgltexture.h @@ -101,6 +101,10 @@ public: void setBoostLevel(S32 level); S32 getBoostLevel() { return mBoostLevel; } + // + void restoreBoostLevel(); // Now restores the mBoostLevel with the mPrevBoostLevel + void storeBoostLevel(); // Stores the current mBoostLevel in mPrevBoostLevel + // S32 getFullWidth() const { return mFullWidth; } S32 getFullHeight() const { return mFullHeight; } @@ -183,6 +187,10 @@ public: protected: S32 mBoostLevel; // enum describing priority level + // + // Added previous value to allow for restoring of BOOST_SELECTED overriding current state + S32 mPrevBoostLevel; // enum describing priority level (Previous Value for BOOST_SELECTION restore) + // U32 mFullWidth; U32 mFullHeight; bool mUseMipMaps; diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 47e5cd1053..26627e6ce4 100644 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -711,19 +711,21 @@ 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 ", // + // Fixed up the missing variables and converted 64bit size_t's to S32's to allow proper numbers to appear gTextureList.getNumImages(), LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(), + LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount, LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(), - LLLFSThread::sLocal->getPending(), - LLImageRaw::sRawImageCount, + (S32)LLLFSThread::sLocal->getPending(), + (S32)LLImageRaw::sRawImageCount, LLAppViewer::getTextureFetch()->getNumHTTPRequests(), - LLAppViewer::getImageDecodeThread()->getPending(), + (S32)LLAppViewer::getImageDecodeThread()->getPending(), // Fast cache stats //gTextureList.mCreateTextureList.size()); - gTextureList.mCreateTextureList.size(), - gTextureList.mFastCacheList.size()); + (S32)gTextureList.mCreateTextureList.size(), + (S32)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 38b3c5d31e..5f2f5569db 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -4192,6 +4192,14 @@ void LLViewerObject::boostTexturePriority(bool boost_children /* = true */) S32 tex_count = getNumTEs(); for (i = 0; i < tex_count; i++) { + // + // 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); } @@ -4199,7 +4207,17 @@ void LLViewerObject::boostTexturePriority(bool boost_children /* = true */) { LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT); LLUUID sculpt_id = sculpt_params->getSculptTexture(); - LLViewerTextureManager::getFetchedTexture(sculpt_id, FTT_DEFAULT, true, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE)->setBoostLevel(LLGLTexture::BOOST_SELECTED); + // + //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); } if (boost_children) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 58daf580bc..22f872ec3f 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -3134,7 +3134,10 @@ void LLViewerLODTexture::processTextureStats() // unset it immediately after we consume it if (getBoostLevel() == BOOST_SELECTED) { - setBoostLevel(BOOST_NONE); + // + //setBoostLevel(BOOST_NONE); + restoreBoostLevel(); + // } }