summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturefetch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lltexturefetch.cpp')
-rwxr-xr-xindra/newview/lltexturefetch.cpp103
1 files changed, 66 insertions, 37 deletions
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 17b273f316..27d754bed2 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<LLViewerTexture*> textures;
+ LLViewerTextureManager::findTextures(mID, textures);
+ std::vector<LLViewerTexture*>::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<LLViewerFetchedTexture*> textures;
+ LLViewerTextureManager::findFetchedTextures(mFetchingHistory[i].mID, textures);
+ std::vector<LLViewerFetchedTexture*>::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, TEX_LIST_DISCARD);
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<LLViewerFetchedTexture*> textures;
+ gTextureList.findTexturesByID(mFetchingHistory[i].mID, textures);
+ std::vector<LLViewerFetchedTexture*>::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<LLViewerFetchedTexture*> textures;
+ gTextureList.findTexturesByID(mFetchingHistory[i].mID, textures);
+ std::vector<LLViewerFetchedTexture*>::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 unnecessary LLViewerFetchedTexture, consider supporting separate UI textures
mRefetchList[tex].push_back(i);
}
}