From a0e9ee475758c1825ba4a0957f4047e1dc24c8a3 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 16 Feb 2016 20:44:53 +0200 Subject: MAINT-2199 separating UI elements from in-world textures. --- indra/newview/lltexturefetch.cpp | 103 +++++++++++++++++++++++++-------------- 1 file changed, 66 insertions(+), 37 deletions(-) (limited to 'indra/newview/lltexturefetch.cpp') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 17b273f316..f845ecc455 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2066,11 +2066,18 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe if (log_texture_traffic && data_size > 0) { - LLViewerTexture* tex = LLViewerTextureManager::findTexture(mID); - if (tex) - { - gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size ; - } + // one worker per multiple textures + std::vector textures; + LLViewerTextureManager::findTextures(mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerTexture* tex = *iter++; + if (tex) + { + gTotalTextureBytesPerBoostLevel[tex->getBoostLevel()] += data_size; + } + } } mFetcher->removeFromHTTPQueue(mID, data_size); @@ -4326,26 +4333,33 @@ bool LLTextureFetchDebugger::processStartDebug(F32 max_time) fetched_textures.insert(mFetchingHistory[i].mID); in_list = false; } - - LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(mFetchingHistory[i].mID); - if(tex && tex->isJustBound()) //visible - { - if(!in_list) - { - mNumVisibleFetchedTextures++; - } - mNumVisibleFetchingRequests++; - - mVisibleFetchedData += mFetchingHistory[i].mFetchedSize; - mVisibleDecodedData += mFetchingHistory[i].mDecodedSize; - - if(tex->getDiscardLevel() >= mFetchingHistory[i].mDecodedLevel) - { - mRenderedData += mFetchingHistory[i].mFetchedSize; - mRenderedDecodedData += mFetchingHistory[i].mDecodedSize; - mRenderedPixels += tex->getWidth() * tex->getHeight(); - } - } + + std::vector textures; + LLViewerTextureManager::findFetchedTextures(mFetchingHistory[i].mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerFetchedTexture* tex = *iter++; + // fetched data will be counted for both ui and regular elements + if (tex && tex->isJustBound()) //visible + { + if (!in_list) + { + mNumVisibleFetchedTextures++; + } + mNumVisibleFetchingRequests++; + + mVisibleFetchedData += mFetchingHistory[i].mFetchedSize; + mVisibleDecodedData += mFetchingHistory[i].mDecodedSize; + + if (tex->getDiscardLevel() >= mFetchingHistory[i].mDecodedLevel) + { + mRenderedData += mFetchingHistory[i].mFetchedSize; + mRenderedDecodedData += mFetchingHistory[i].mDecodedSize; + mRenderedPixels += tex->getWidth() * tex->getHeight(); + } + } + } } mNumFetchedTextures = fetched_textures.size(); @@ -4445,7 +4459,8 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) mRefetchedAllPixels += worker->mRawImage->getWidth() * worker->mRawImage->getHeight(); mRefetchedAllData += worker->mFormattedImage->getDataSize(); - LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID); + // refetch list only requests/creates normal images, so requesting ui='false' + LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, false); if(tex && mRefetchList[tex].begin() != mRefetchList[tex].end()) { if(worker->mDecodedDiscard == mFetchingHistory[mRefetchList[tex][0]].mDecodedLevel) @@ -4672,12 +4687,18 @@ void LLTextureFetchDebugger::debugGLTextureCreation() { if(mFetchingHistory[i].mRawImage.notNull()) { - LLViewerFetchedTexture* tex = gTextureList.findImage(mFetchingHistory[i].mID) ; - if(tex && !tex->isForSculptOnly()) - { - tex->destroyGLTexture() ; - mTempTexList.push_back(tex); - } + std::vector textures; + gTextureList.findTexturesByID(mFetchingHistory[i].mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerFetchedTexture* tex = *iter++; + if (tex && !tex->isForSculptOnly()) + { + tex->destroyGLTexture(); + mTempTexList.push_back(tex); + } + } } } @@ -4732,11 +4753,17 @@ void LLTextureFetchDebugger::clearTextures() S32 size = mFetchingHistory.size(); for(S32 i = 0 ; i < size ; i++) { - LLViewerFetchedTexture* tex = gTextureList.findImage(mFetchingHistory[i].mID) ; - if(tex) - { - tex->clearFetchedResults() ; - } + std::vector textures; + gTextureList.findTexturesByID(mFetchingHistory[i].mID, textures); + std::vector::iterator iter = textures.begin(); + while (iter != textures.end()) + { + LLViewerFetchedTexture* tex = *iter++; + if (tex) + { + tex->clearFetchedResults(); + } + } } } @@ -4752,6 +4779,8 @@ void LLTextureFetchDebugger::makeRefetchList() continue; //the texture fetch pipeline will take care of visible textures. } + // todo: Will attempt to refetch icons and ui elements as normal images (boost_none) + // thus will create unnesesary LLViewerFetchedTexture, consider supporting separate UI textures mRefetchList[tex].push_back(i); } } -- cgit v1.2.3 From 10e2bd56c1722526d14656aa6870a23b86f51333 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 18 Feb 2016 17:35:43 +0200 Subject: MAINT-2199 In some rare cases priorities can change, it shouldn't affect texture list. --- indra/newview/lltexturefetch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/lltexturefetch.cpp') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f845ecc455..27d754bed2 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -4460,7 +4460,7 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) mRefetchedAllData += worker->mFormattedImage->getDataSize(); // refetch list only requests/creates normal images, so requesting ui='false' - LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, false); + LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_DISCARD); if(tex && mRefetchList[tex].begin() != mRefetchList[tex].end()) { if(worker->mDecodedDiscard == mFetchingHistory[mRefetchList[tex][0]].mDecodedLevel) @@ -4780,7 +4780,7 @@ void LLTextureFetchDebugger::makeRefetchList() } // todo: Will attempt to refetch icons and ui elements as normal images (boost_none) - // thus will create unnesesary LLViewerFetchedTexture, consider supporting separate UI textures + // thus will create unnecessary LLViewerFetchedTexture, consider supporting separate UI textures mRefetchList[tex].push_back(i); } } -- cgit v1.2.3 From b3e7fff9ae296a128a036e1e9a5b1767248002b8 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Sat, 27 Feb 2016 16:06:54 +0200 Subject: MAINT-2199 restored original UI mechanics, removed icons from UI list --- indra/newview/lltexturefetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltexturefetch.cpp') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 27d754bed2..bb93597651 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -4460,7 +4460,7 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) mRefetchedAllData += worker->mFormattedImage->getDataSize(); // refetch list only requests/creates normal images, so requesting ui='false' - LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_DISCARD); + LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_STANDARD); if(tex && mRefetchList[tex].begin() != mRefetchList[tex].end()) { if(worker->mDecodedDiscard == mFetchingHistory[mRefetchList[tex][0]].mDecodedLevel) -- cgit v1.2.3 From 30f9287645c789b4ad5e9523e520896fe71ed65b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 3 Mar 2016 00:15:33 +0200 Subject: MAINT-2199 reverted previous change, refixed missing cloud and ban line --- indra/newview/lltexturefetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/lltexturefetch.cpp') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index bb93597651..27d754bed2 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -4460,7 +4460,7 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) mRefetchedAllData += worker->mFormattedImage->getDataSize(); // refetch list only requests/creates normal images, so requesting ui='false' - LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_STANDARD); + LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(worker->mID, TEX_LIST_DISCARD); if(tex && mRefetchList[tex].begin() != mRefetchList[tex].end()) { if(worker->mDecodedDiscard == mFetchingHistory[mRefetchList[tex][0]].mDecodedLevel) -- cgit v1.2.3