for SH-3074: clear ghost and stale texture fetching requests in time
parent
3c0e4e4324
commit
0a42495906
|
|
@ -845,6 +845,8 @@ void LLTextureFetchWorker::startWork(S32 param)
|
|||
// Called from LLWorkerThread::processRequest()
|
||||
bool LLTextureFetchWorker::doWork(S32 param)
|
||||
{
|
||||
static const F32 FETCHING_TIMEOUT = 120.f;//seconds
|
||||
|
||||
LLMutexLock lock(&mWorkMutex);
|
||||
|
||||
if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED)))
|
||||
|
|
@ -1187,6 +1189,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
|||
bool res = false;
|
||||
if (!mUrl.empty())
|
||||
{
|
||||
mRequestedTimer.reset();
|
||||
|
||||
mLoaded = FALSE;
|
||||
mGetStatus = 0;
|
||||
mGetReason.clear();
|
||||
|
|
@ -1345,6 +1349,13 @@ bool LLTextureFetchWorker::doWork(S32 param)
|
|||
}
|
||||
else
|
||||
{
|
||||
if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32())
|
||||
{
|
||||
//timeout, abort.
|
||||
mState = DONE;
|
||||
return true;
|
||||
}
|
||||
|
||||
setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2129,6 +2129,17 @@ bool LLViewerFetchedTexture::updateFetch()
|
|||
return mIsFetching ? true : false;
|
||||
}
|
||||
|
||||
void LLViewerFetchedTexture::forceToDeleteRequest()
|
||||
{
|
||||
if (mHasFetcher)
|
||||
{
|
||||
LLAppViewer::getTextureFetch()->deleteRequest(getID(), true);
|
||||
mHasFetcher = FALSE;
|
||||
mIsFetching = FALSE ;
|
||||
resetTextureStats();
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerFetchedTexture::setIsMissingAsset()
|
||||
{
|
||||
if (mUrl.empty())
|
||||
|
|
|
|||
|
|
@ -490,6 +490,7 @@ public:
|
|||
BOOL hasFetcher() const { return mHasFetcher;}
|
||||
void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;}
|
||||
|
||||
void forceToDeleteRequest();
|
||||
protected:
|
||||
/*virtual*/ void switchToCachedImage();
|
||||
S32 getCurrentDiscardLevelForFetching() ;
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@
|
|||
#include "pipeline.h"
|
||||
#include "llappviewer.h"
|
||||
#include "llxuiparser.h"
|
||||
#include "llagent.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
@ -597,6 +598,12 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats");
|
|||
|
||||
void LLViewerTextureList::updateImages(F32 max_time)
|
||||
{
|
||||
if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE)
|
||||
{
|
||||
clearFetchingRequests();
|
||||
return;
|
||||
}
|
||||
|
||||
LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec());
|
||||
|
||||
LLViewerStats::getInstance()->mNumImagesStat.addValue(sNumImages);
|
||||
|
|
@ -659,6 +666,24 @@ void LLViewerTextureList::updateImages(F32 max_time)
|
|||
}
|
||||
}
|
||||
|
||||
void LLViewerTextureList::clearFetchingRequests()
|
||||
{
|
||||
if (LLAppViewer::getTextureFetch()->getNumRequests() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (image_priority_list_t::iterator iter = mImageList.begin();
|
||||
iter != mImageList.end(); ++iter)
|
||||
{
|
||||
LLViewerFetchedTexture* image = *iter;
|
||||
if(image->hasFetcher())
|
||||
{
|
||||
image->forceToDeleteRequest() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerTextureList::updateImagesDecodePriorities()
|
||||
{
|
||||
// Update the decode priority for N images each frame
|
||||
|
|
|
|||
|
|
@ -164,6 +164,8 @@ private:
|
|||
// Implemented in header in case someone changes default params above. JC
|
||||
LLViewerFetchedTexture* getImageFromHost(const LLUUID& image_id, LLHost host)
|
||||
{ return getImage(image_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); }
|
||||
|
||||
void clearFetchingRequests();
|
||||
|
||||
public:
|
||||
typedef std::set<LLPointer<LLViewerFetchedTexture> > image_list_t;
|
||||
|
|
|
|||
Loading…
Reference in New Issue