diff options
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/lltexturefetch.cpp | 26 | ||||
| -rw-r--r-- | indra/newview/llviewertexture.cpp | 20 | ||||
| -rw-r--r-- | indra/newview/llviewertexture.h | 3 | ||||
| -rw-r--r-- | indra/newview/llviewertexturelist.cpp | 11 | 
4 files changed, 43 insertions, 17 deletions
| diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 5eeecb33f2..0451bae3c9 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1071,7 +1071,7 @@ void LLTextureFetchWorker::setDesiredDiscard(S32 discard, S32 size)  // Locks:  Mw  void LLTextureFetchWorker::setImagePriority(F32 priority)  { -	mImagePriority = priority; //should map to max virtual size +	mImagePriority = priority; //should map to max virtual size, abort if zero  }  // Locks:  Mw @@ -1397,7 +1397,7 @@ bool LLTextureFetchWorker::doWork(S32 param)  		else  		{  			// Shouldn't need to do anything here -			llassert(mFetcher->mNetworkQueue.find(mID) != mFetcher->mNetworkQueue.end()); +			//llassert(mFetcher->mNetworkQueue.find(mID) != mFetcher->mNetworkQueue.end());  			return false;  		}  	} @@ -3016,16 +3016,18 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level,  bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority)  {      LL_PROFILE_ZONE_SCOPED; -	bool res = false; -	LLTextureFetchWorker* worker = getWorker(id); -	if (worker) -	{ -		worker->lockWorkMutex();										// +Mw -		worker->setImagePriority(priority); -		worker->unlockWorkMutex();										// -Mw -		res = true; -	} -	return res; +    mRequestQueue.tryPost([=]() +        { +            LLTextureFetchWorker* worker = getWorker(id); +            if (worker) +            { +                worker->lockWorkMutex();										// +Mw +                worker->setImagePriority(priority); +                worker->unlockWorkMutex();										// -Mw +            } +        }); +	 +	return true;  }  // Replicates and expands upon the base class's diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1deb4b5ca1..16b07159ba 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -653,6 +653,11 @@ void LLViewerTexture::cleanup()  {  	notifyAboutMissingAsset(); +    if (LLAppViewer::getTextureFetch()) +    { +        LLAppViewer::getTextureFetch()->updateRequestPriority(mID, 0.f); +    } +  	mFaceList[LLRender::DIFFUSE_MAP].clear();  	mFaceList[LLRender::NORMAL_MAP].clear();  	mFaceList[LLRender::SPECULAR_MAP].clear(); @@ -1884,6 +1889,16 @@ bool LLViewerFetchedTexture::isActiveFetching()  	return mFetchState > 7 && mFetchState < 10 && monitor_enabled; //in state of WAIT_HTTP_REQ or DECODE_IMAGE.  } +void LLViewerFetchedTexture::setBoostLevel(S32 level) +{ +    LLViewerTexture::setBoostLevel(level); + +    if (level >= LLViewerTexture::BOOST_HIGH) +    { +        mDesiredDiscardLevel = 0; +    } +} +  bool LLViewerFetchedTexture::updateFetch()  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; @@ -1931,6 +1946,11 @@ bool LLViewerFetchedTexture::updateFetch()          LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - in fast cache");  		return false;  	} +    if (mGLTexturep.isNull()) +    { // fix for crash inside getCurrentDiscardLevelForFetching (shouldn't happen but appears to be happening) +        llassert(false); +        return false; +    }  	S32 current_discard = getCurrentDiscardLevelForFetching();  	S32 desired_discard = getDesiredDiscardLevel(); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index a5e5c37c22..f3bc9061a2 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -134,7 +134,7 @@ public:  	/*virtual*/ bool isActiveFetching();  	/*virtual*/ const LLUUID& getID() const { return mID; } -	void setBoostLevel(S32 level); +	virtual void setBoostLevel(S32 level);  	S32  getBoostLevel() { return mBoostLevel; }  	void setTextureListType(S32 tex_type) { mTextureListType = tex_type; }  	S32 getTextureListType() { return mTextureListType; } @@ -343,6 +343,7 @@ public:  	S32  getDesiredDiscardLevel()			 { return mDesiredDiscardLevel; }  	void setMinDiscardLevel(S32 discard) 	{ mMinDesiredDiscardLevel = llmin(mMinDesiredDiscardLevel,(S8)discard); } +    void setBoostLevel(S32 level) override;  	bool updateFetch();  	bool setDebugFetching(S32 debug_level);  	bool isInDebug() const { return mInDebug; } diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index ac036bce31..8faeb70553 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1025,7 +1025,7 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time)      LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;      LLTimer image_op_timer; -    typedef std::vector<LLViewerFetchedTexture*> entries_list_t; +    typedef std::vector<LLPointer<LLViewerFetchedTexture> > entries_list_t;      entries_list_t entries;      // update N textures at beginning of mImageList @@ -1057,10 +1057,13 @@ F32 LLViewerTextureList::updateImagesFetchTextures(F32 max_time)          }      } -    for (auto* imagep : entries) +    for (auto& imagep : entries)      { -        updateImageDecodePriority(imagep); -        imagep->updateFetch(); +        if (imagep->getNumRefs() > 1) // make sure this image hasn't been deleted before attempting to update (may happen as a side effect of some other image updating) +        { +            updateImageDecodePriority(imagep); +            imagep->updateFetch(); +        }      }      if (entries.size() > 0) | 
