diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/app_settings/settings.xml | 11 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llpaneloutfitsinventory.cpp | 3 | ||||
-rwxr-xr-x | indra/newview/lltexturefetch.cpp | 28 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/lltexturefetch.h | 2 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llviewertexture.cpp | 75 | ||||
-rwxr-xr-x[-rw-r--r--] | indra/newview/llviewertexture.h | 9 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 10 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.h | 2 | ||||
-rwxr-xr-x | indra/newview/llvoavatarself.cpp | 2 |
9 files changed, 100 insertions, 42 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f66d8fca5b..0b7f99ebc1 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11130,6 +11130,17 @@ <key>Value</key> <integer>0</integer> </map> + <key>TextureFetchFakeFailures</key> + <map> + <key>Comment</key> + <string>Simulate HTTP fetch failures for some server bake textures.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>TextureFetchSource</key> <map> <key>Comment</key> diff --git a/indra/newview/llpaneloutfitsinventory.cpp b/indra/newview/llpaneloutfitsinventory.cpp index f90236f6f2..d6c927ab58 100644..100755 --- a/indra/newview/llpaneloutfitsinventory.cpp +++ b/indra/newview/llpaneloutfitsinventory.cpp @@ -76,7 +76,8 @@ BOOL LLPanelOutfitsInventory::postBuild() // Fetch your outfits folder so that the links are in memory. // ( This is only necessary if we want to show a warning if a user deletes an item that has a // a link in an outfit, see "ConfirmItemDeleteHasLinks". ) - const LLUUID &outfits_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTFIT, false); + + const LLUUID &outfits_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS, false); if (outfits_cat.notNull()) { LLInventoryModelBackgroundFetch::instance().start(outfits_cat); diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index cc6dc64626..2e6fb160d5 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -388,10 +388,12 @@ public: // Threads: Ttf virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); + void setFakeFailure(bool fake_failure) { mFakeFailure = fake_failure; } + protected: LLTextureFetchWorker(LLTextureFetch* fetcher, FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, - F32 priority, S32 discard, S32 size); + F32 priority, S32 discard, S32 size, bool fake_failure); private: @@ -547,6 +549,7 @@ private: S32 mActiveCount; LLCore::HttpStatus mGetStatus; std::string mGetReason; + bool mFakeFailure; // Work Data LLMutex mWorkMutex; @@ -836,7 +839,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, const LLHost& host, // Simulator host F32 priority, // Priority S32 discard, // Desired discard - S32 size) // Desired size + S32 size, // Desired size + bool fake_failure) // For testing, simulate http failure if true. : LLWorkerClass(fetcher, "TextureFetch"), LLCore::HttpHandler(), mState(INIT), @@ -889,7 +893,8 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mHttpHasResource(false), mCacheReadCount(0U), mCacheWriteCount(0U), - mResourceWaitCount(0U) + mResourceWaitCount(0U), + mFakeFailure(fake_failure) { mCanUseNET = mUrl.empty() ; @@ -1519,15 +1524,16 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (http_not_found == mGetStatus) { + llwarns << "Texture missing from server (404): " << mUrl << llendl; + if(mWriteToCacheState == NOT_WRITE) //map tiles { setState(DONE); releaseHttpSemaphore(); - LL_DEBUGS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; + LL_WARNS("Texture") << mID << " abort: WAIT_HTTP_REQ not found" << llendl; return true; // failed, means no map tile on the empty region. } - llwarns << "Texture missing from server (404): " << mUrl << llendl; // roll back to try UDP if (mCanUseNET) @@ -1891,6 +1897,11 @@ void LLTextureFetchWorker::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRe mFetcher->mTextureInfo.setRequestCompleteTimeAndLog(mID, timeNow); } + if (mFakeFailure) + { + llwarns << "For debugging, setting fake failure status for texture " << mID << llendl; + response->setStatus(LLCore::HttpStatus(404)); + } bool success = true; bool partial = false; LLCore::HttpStatus status(response->getStatus()); @@ -2455,7 +2466,7 @@ LLTextureFetch::~LLTextureFetch() } bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, - S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http) + S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http, bool fake_failure) { if(mFetcherLocked) { @@ -2523,7 +2534,8 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const worker->mNeedsAux = needs_aux; worker->setImagePriority(priority); worker->setDesiredDiscard(desired_discard, desired_size); - worker->setCanUseHTTP(can_use_http) ; + worker->setCanUseHTTP(can_use_http); + worker->setFakeFailure(fake_failure); if (!worker->haveWork()) { worker->setState(LLTextureFetchWorker::INIT); @@ -2538,7 +2550,7 @@ bool LLTextureFetch::createRequest(FTType f_type, const std::string& url, const } else { - worker = new LLTextureFetchWorker(this, f_type, url, id, host, priority, desired_discard, desired_size); + worker = new LLTextureFetchWorker(this, f_type, url, id, host, priority, desired_discard, desired_size, fake_failure); lockQueue(); // +Mfq mRequestMap[id] = worker; unlockQueue(); // -Mfq diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 902a3d7a25..b99480d18e 100644..100755 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -78,7 +78,7 @@ public: // Threads: T* (but Tmain mostly) bool createRequest(FTType f_type, 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); + S32 w, S32 h, S32 c, S32 discard, bool needs_aux, bool can_use_http, bool fake_failure); // Requests that a fetch operation be deleted from the queue. // If @cancel is true, also stops any I/O operations pending. diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index eb6c453e76..a157600cc9 100644..100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -962,6 +962,8 @@ void LLViewerFetchedTexture::init(bool firstinit) // does not contain this image. mIsMissingAsset = FALSE; + mFetchFailureCount = 0; + mLoadedCallbackDesiredDiscardLevel = S8_MAX; mPauseLoadedCallBacks = FALSE ; @@ -1823,12 +1825,18 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority - << " mRawDiscardLevel " << mRawDiscardLevel - << " current_discard " << current_discard - << llendl; - setIsMissingAsset(); - desired_discard = -1; + const S32 MAX_FETCH_FAILURE = 1; + mFetchFailureCount++; + llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount << llendl; + if (getFTType() != FTT_SERVER_BAKE || mFetchFailureCount >= MAX_FETCH_FAILURE) + { + llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority + << " mRawDiscardLevel " << mRawDiscardLevel + << " current_discard " << current_discard + << llendl; + setIsMissingAsset(); + desired_discard = -1; + } } else { @@ -1942,8 +1950,14 @@ bool LLViewerFetchedTexture::updateFetch() // bypass texturefetch directly by pulling from LLTextureCache bool fetch_request_created = false; + bool fake_failure = false; + const bool debug_setting_fake_failures = gSavedSettings.getBOOL("TextureFetchFakeFailures"); + if (getFTType() == FTT_SERVER_BAKE && mFetchFailureCount == 0 && debug_setting_fake_failures) + { + fake_failure = true; + } fetch_request_created = LLAppViewer::getTextureFetch()->createRequest(mFTType, mUrl, getID(), getTargetHost(), decode_priority, - w, h, c, desired_discard, needsAux(), mCanUseHTTP); + w, h, c, desired_discard, needsAux(), mCanUseHTTP, fake_failure); if (fetch_request_created) { @@ -2005,29 +2019,44 @@ void LLViewerFetchedTexture::forceToDeleteRequest() mDesiredDiscardLevel = getMaxDiscardLevel() + 1; } -void LLViewerFetchedTexture::setIsMissingAsset() +void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) { - if (mUrl.empty()) + if (is_missing == mIsMissingAsset) { - llwarns << mID << ": Marking image as missing" << llendl; + return; } - else + if (is_missing) { - // This may or may not be an error - it is normal to have no - // map tile on an empty region, but bad if we're failing on a - // server bake texture. - llwarns << mUrl << ": Marking image as missing" << llendl; + if (mUrl.empty()) + { + llwarns << mID << ": Marking image as missing" << llendl; + } + else + { + // This may or may not be an error - it is normal to have no + // map tile on an empty region, but bad if we're failing on a + // server bake texture. + if (getFTType() != FTT_MAP_TILE) + { + llwarns << mUrl << ": Marking image as missing" << llendl; + } + } + if (mHasFetcher) + { + LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); + mHasFetcher = FALSE; + mIsFetching = FALSE; + mLastPacketTimer.reset(); + mFetchState = 0; + mFetchPriority = 0; + } } - if (mHasFetcher) + else { - LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); - mHasFetcher = FALSE; - mIsFetching = FALSE; - mLastPacketTimer.reset(); - mFetchState = 0; - mFetchPriority = 0; + llinfos << mID << ": un-flagging missing asset" << llendl; + mFetchFailureCount = 0; } - mIsMissingAsset = TRUE; + mIsMissingAsset = is_missing; } void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_callback, diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index f2e1a90713..320e6f8630 100644..100755 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -120,7 +120,7 @@ public: LLViewerTexture(const U32 width, const U32 height, const U8 components, BOOL usemipmaps) ; virtual S8 getType() const; - virtual BOOL isMissingAsset()const ; + virtual BOOL isMissingAsset() const ; virtual void dump(); // debug info to llinfos /*virtual*/ bool bindDefaultImage(const S32 stage = 0) ; @@ -338,8 +338,8 @@ public: // more data. /*virtual*/ void setKnownDrawSize(S32 width, S32 height); - void setIsMissingAsset(); - /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } + void setIsMissingAsset(BOOL is_missing = true); + /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } // returns dimensions of original image for local files (before power of two scaling) // and returns 0 for all asset system images @@ -449,7 +449,8 @@ protected: bool mCanUseHTTP ; //This texture can be fetched through http if true. FTType mFTType; // What category of image is this - map tile, server bake, etc? - mutable S8 mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. + mutable BOOL mIsMissingAsset; // True if we know that there is no image asset with this image id in the database. + S32 mFetchFailureCount; // How many times has a fetch failed in a way that suggests the asset is missing? typedef std::list<LLLoadedCallbackEntry*> callback_list_t; S8 mLoadedCallbackDesiredDiscardLevel; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 0475e9fc89..cf4cc64ac3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1884,6 +1884,10 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU LL_DEBUGS("Avatar") << avString() << "from URL " << url << llendl; result = LLViewerTextureManager::getFetchedTextureFromUrl( url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); + if (result->isMissingAsset()) + { + result->setIsMissingAsset(false); + } } else { @@ -4408,7 +4412,7 @@ void LLVOAvatar::addLocalTextureStats( ETextureIndex idx, LLViewerFetchedTexture } const S32 MAX_TEXTURE_UPDATE_INTERVAL = 64 ; //need to call updateTextures() at least every 32 frames. -const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL = S32_MAX ; //frames +const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL = S32_MAX ; //frames void LLVOAvatar::checkTextureLoading() { static const F32 MAX_INVISIBLE_WAITING_TIME = 15.f ; //seconds @@ -4471,11 +4475,11 @@ const F32 ADDITIONAL_PRI = 0.5f; void LLVOAvatar::addBakedTextureStats( LLViewerFetchedTexture* imagep, F32 pixel_area, F32 texel_area_ratio, S32 boost_level) { //Note: - //if this function is not called for the last MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL frames, + //if this function is not called for the last MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL frames, //the texture pipeline will stop fetching this texture. imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL); imagep->resetMaxVirtualSizeResetCounter() ; mMaxPixelArea = llmax(pixel_area, mMaxPixelArea); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 85f6f25009..98e8491cb1 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -991,7 +991,7 @@ protected: // Shared with LLVOAvatarSelf }; // LLVOAvatar extern const F32 SELF_ADDITIONAL_PRI; -extern const S32 MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL; +extern const S32 MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL; std::string get_sequential_numbered_file_name(const std::string& prefix, const std::string& suffix); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f89a72bc56..52c44e6e1b 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2587,7 +2587,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe imagep->setBoostLevel(getAvatarBoostLevel()); imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTUAL_SIZE_RESET_INTERVAL); imagep->addTextureStats( desired_pixels / texel_area_ratio ); imagep->forceUpdateBindStats() ; if (imagep->getDiscardLevel() < 0) |