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 c14a793166..750140245b 100755
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -2076,11 +2076,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);
@@ -4315,26 +4322,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();
@@ -4434,7 +4448,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)
@@ -4661,12 +4676,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);
+ }
+ }
}
}
@@ -4721,11 +4742,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();
+ }
+ }
}
}
@@ -4741,6 +4768,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);
}
}