diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2012-05-29 18:02:11 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2012-05-29 18:02:11 -0600 |
commit | 957bfcd5d90b4ae0dfccd7a934364461059f8402 (patch) | |
tree | 52a99be02d47cc168663a275070ae2e791aaec0e /indra | |
parent | 3a63d88e7b48397cbfd508c05632453653e678e3 (diff) |
fo SH-3074: clear ghost and stale texture fetching requests in time.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llappviewer.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llface.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llface.h | 1 | ||||
-rwxr-xr-x | indra/newview/lltexturefetch.cpp | 41 | ||||
-rw-r--r-- | indra/newview/lltexturefetch.h | 1 | ||||
-rw-r--r-- | indra/newview/llviewertexture.cpp | 24 | ||||
-rw-r--r-- | indra/newview/llviewertexturelist.cpp | 18 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 2 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 25 | ||||
-rw-r--r-- | indra/newview/pipeline.h | 1 |
11 files changed, 96 insertions, 31 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 178b96e42e..4fb0a7628c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4270,6 +4270,10 @@ void LLAppViewer::idle() { return; } + if (gTeleportDisplay) + { + return; + } gViewerWindow->updateUI(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index cfb4147e71..cb445d6117 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1951,6 +1951,12 @@ BOOL LLFace::hasMedia() const const F32 LEAST_IMPORTANCE = 0.05f ; const F32 LEAST_IMPORTANCE_FOR_LARGE_IMAGE = 0.3f ; +void LLFace::resetVirtualSize() +{ + setVirtualSize(0.f); + mImportanceToCamera = 0.f; +} + F32 LLFace::getTextureVirtualSize() { F32 radius; diff --git a/indra/newview/llface.h b/indra/newview/llface.h index 82e4ab61b7..8c2e229a81 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -204,6 +204,7 @@ public: F32 getTextureVirtualSize() ; F32 getImportanceToCamera()const {return mImportanceToCamera ;} + void resetVirtualSize(); void setHasMedia(bool has_media) { mHasMedia = has_media ;} BOOL hasMedia() const ; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e307de329b..8657fce093 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -2075,27 +2075,18 @@ void LLTextureFetch::deleteRequest(const LLUUID& id, bool cancel) { lockQueue() ; LLTextureFetchWorker* worker = getWorkerAfterLock(id); - if (worker) - { - size_t erased_1 = mRequestMap.erase(worker->mID); - unlockQueue() ; - - llassert_always(erased_1 > 0) ; - - removeFromNetworkQueue(worker, cancel); - llassert_always(!(worker->getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) ; + unlockQueue() ; - worker->removeFromHTTPQueue(); - worker->scheduleDelete(); - } - else - { - unlockQueue() ; - } + removeRequest(worker, cancel); } void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel) { + if(!worker) + { + return; + } + lockQueue() ; size_t erased_1 = mRequestMap.erase(worker->mID); unlockQueue() ; @@ -2108,6 +2099,24 @@ void LLTextureFetch::removeRequest(LLTextureFetchWorker* worker, bool cancel) worker->scheduleDelete(); } +void LLTextureFetch::deleteAllRequests() +{ + while(1) + { + lockQueue(); + if(mRequestMap.empty()) + { + unlockQueue() ; + break; + } + + LLTextureFetchWorker* worker = mRequestMap.begin()->second; + unlockQueue() ; + + removeRequest(worker, true); + } +} + S32 LLTextureFetch::getNumRequests() { lockQueue() ; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index e04c9124a0..f5072a79f1 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -65,6 +65,7 @@ public: bool createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http); void deleteRequest(const LLUUID& id, bool cancel); + void deleteAllRequests(); bool getRequestFinished(const LLUUID& id, S32& discard_level, LLPointer<LLImageRaw>& raw, LLPointer<LLImageRaw>& aux); bool updateRequestPriority(const LLUUID& id, F32 priority); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 511fc13973..a6f4b10540 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1240,7 +1240,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mIsMissingAsset = FALSE; mLoadedCallbackDesiredDiscardLevel = S8_MAX; - mPauseLoadedCallBacks = TRUE ; + mPauseLoadedCallBacks = FALSE ; mNeedsCreateTexture = FALSE; @@ -2072,6 +2072,10 @@ bool LLViewerFetchedTexture::updateFetch() { make_request = false; } + else if(mDesiredDiscardLevel > getMaxDiscardLevel()) + { + make_request = false; + } else if (mNeedsCreateTexture || mIsMissingAsset) { make_request = false; @@ -2190,11 +2194,13 @@ void LLViewerFetchedTexture::forceToDeleteRequest() { if (mHasFetcher) { - LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); mHasFetcher = FALSE; mIsFetching = FALSE ; - resetTextureStats(); } + + resetTextureStats(); + + mDesiredDiscardLevel = getMaxDiscardLevel() + 1; } void LLViewerFetchedTexture::setIsMissingAsset() @@ -2237,10 +2243,18 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call mLoadedCallbackDesiredDiscardLevel = llmin(mLoadedCallbackDesiredDiscardLevel, (S8)discard_level) ; } - if(mPauseLoadedCallBacks && !pause) + if(mPauseLoadedCallBacks) { - unpauseLoadedCallbacks(src_callback_list) ; + if(!pause) + { + unpauseLoadedCallbacks(src_callback_list) ; + } } + else if(pause) + { + pauseLoadedCallbacks(src_callback_list) ; + } + LLLoadedCallbackEntry* entryp = new LLLoadedCallbackEntry(loaded_callback, discard_level, keep_imageraw, userdata, src_callback_list, this, pause); mLoadedCallbackList.push_back(entryp); diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index e3b633dc0e..d95a9cd13b 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -58,7 +58,7 @@ #include "pipeline.h" #include "llappviewer.h" #include "llxuiparser.h" -#include "llagent.h" +#include "llviewerdisplay.h" //////////////////////////////////////////////////////////////////////////// @@ -598,11 +598,15 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats"); void LLViewerTextureList::updateImages(F32 max_time) { - if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) + static BOOL cleared = FALSE; + if(gTeleportDisplay && !cleared) { clearFetchingRequests(); + gPipeline.clearRebuildGroups(); + cleared = TRUE; return; } + cleared = FALSE; LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec()); @@ -673,14 +677,13 @@ void LLViewerTextureList::clearFetchingRequests() return; } + LLAppViewer::getTextureFetch()->deleteAllRequests(); + for (image_priority_list_t::iterator iter = mImageList.begin(); iter != mImageList.end(); ++iter) { - LLViewerFetchedTexture* image = *iter; - if(image->hasFetcher()) - { - image->forceToDeleteRequest() ; - } + LLViewerFetchedTexture* imagep = *iter; + imagep->forceToDeleteRequest() ; } } @@ -703,6 +706,7 @@ void LLViewerTextureList::updateImagesDecodePriorities() if(imagep->isInDebug()) { + update_counter--; continue; //is in debug, ignore. } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ffe5837249..3c1f8cd71e 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6645,7 +6645,7 @@ void LLVOAvatar::updateMeshTextures() if(!isSelf()) { src_callback_list = &mCallbackTextureList ; - paused = mLoadedCallbacksPaused ; + paused = !isVisible(); } std::vector<BOOL> is_layer_baked; @@ -7190,7 +7190,7 @@ void LLVOAvatar::onFirstTEMessageReceived() if(!isSelf()) { src_callback_list = &mCallbackTextureList ; - paused = mLoadedCallbacksPaused ; + paused = !isVisible(); } for (U32 i = 0; i < mBakedTextureDatas.size(); i++) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 438d578ac5..aaa58a2914 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4178,7 +4178,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } llassert_always(vobj); - vobj->updateTextureVirtualSize(true); + vobj->updateTextureVirtualSize(); vobj->preRebuild(); drawablep->clearState(LLDrawable::HAS_ALPHA); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index a64655960f..a3292939a8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2439,6 +2439,31 @@ void LLPipeline::updateGL() } } +void LLPipeline::clearRebuildGroups() +{ + mGroupQ1Locked = true; + // Iterate through all drawables on the priority build queue, + for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin(); + iter != mGroupQ1.end(); ++iter) + { + LLSpatialGroup* group = *iter; + group->clearState(LLSpatialGroup::IN_BUILD_Q1); + } + mGroupQ1.clear(); + mGroupQ1Locked = false; + + mGroupQ2Locked = true; + for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); + iter != mGroupQ2.end(); ++iter) + { + LLSpatialGroup* group = *iter; + group->clearState(LLSpatialGroup::IN_BUILD_Q2); + } + + mGroupQ2.clear(); + mGroupQ2Locked = false; +} + void LLPipeline::rebuildPriorityGroups() { LLTimer update_timer; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 9ed38b1190..4d4da82460 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -220,6 +220,7 @@ public: void updateGL(); void rebuildPriorityGroups(); void rebuildGroups(); + void clearRebuildGroups(); //calculate pixel area of given box from vantage point of given camera static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); |