From 0a6a5f63b45bf3d97c7926b8d415b0b3885f64a1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 5 Apr 2013 13:44:33 -0400 Subject: SH-4061 WIP - spelling fix, allow un-set of missing asset flag for textures --- indra/newview/llviewertexture.cpp | 44 ++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 17 deletions(-) mode change 100644 => 100755 indra/newview/llviewertexture.cpp (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp old mode 100644 new mode 100755 index eb6c453e76..500a6c8869 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2005,29 +2005,39 @@ void LLViewerFetchedTexture::forceToDeleteRequest() mDesiredDiscardLevel = getMaxDiscardLevel() + 1; } -void LLViewerFetchedTexture::setIsMissingAsset() +void LLViewerFetchedTexture::setIsMissingAsset(bool is_missing) { - if (mUrl.empty()) + if (is_missing) { - llwarns << mID << ": 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; + } } 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. - llwarns << mUrl << ": Marking image as missing" << llendl; - } - if (mHasFetcher) - { - LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); - mHasFetcher = FALSE; - mIsFetching = FALSE; - mLastPacketTimer.reset(); - mFetchState = 0; - mFetchPriority = 0; + llinfos << mID << ": un-flagging missing asset" << llendl; } - mIsMissingAsset = TRUE; + mIsMissingAsset = is_missing; } void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_callback, -- cgit v1.2.3 From e16435c37cb7410f3ea4596e30fd232ac558bc71 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 8 Apr 2013 13:26:05 -0400 Subject: SH-4061 WIP - added ability to un-set missing asset, do this in the case of FTT_SERVER_BAKE images. This is needed because 'missing' is not necessarily permanent for such images. --- indra/newview/llviewertexture.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 500a6c8869..9cca8a244e 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2005,8 +2005,12 @@ void LLViewerFetchedTexture::forceToDeleteRequest() mDesiredDiscardLevel = getMaxDiscardLevel() + 1; } -void LLViewerFetchedTexture::setIsMissingAsset(bool is_missing) +void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) { + if (is_missing == mIsMissingAsset) + { + return; + } if (is_missing) { if (mUrl.empty()) -- cgit v1.2.3 From 4bbcd26941c3be6b83214d0dc45c70f99e474dda Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 8 Apr 2013 18:16:58 -0400 Subject: SH-4061 FIX - texture fetch failures added retry logic and fault injection for testing --- indra/newview/llviewertexture.cpp | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 9cca8a244e..a157600cc9 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) { @@ -2040,6 +2054,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) else { llinfos << mID << ": un-flagging missing asset" << llendl; + mFetchFailureCount = 0; } mIsMissingAsset = is_missing; } -- cgit v1.2.3 From f78da987913de659367b24e3aa0add2c570f8e1f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 10 Apr 2013 11:43:48 -0400 Subject: SH-4061 WIP - capture http status codes from requests, restrict SB fetch retries to 5xx errors --- indra/newview/llviewertexture.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a157600cc9..7a1afb1238 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1760,7 +1760,8 @@ bool LLViewerFetchedTexture::updateFetch() if (mRawImage.notNull()) sRawCount--; if (mAuxRawImage.notNull()) sAuxCount--; - bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage); + bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage, + mLastHttpGetStatus); if (mRawImage.notNull()) sRawCount++; if (mAuxRawImage.notNull()) sAuxCount++; if (finished) @@ -1825,14 +1826,25 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - const S32 MAX_FETCH_FAILURE = 1; + const S32 MAX_FETCH_FAILURE = 3; mFetchFailureCount++; - llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount << llendl; - if (getFTType() != FTT_SERVER_BAKE || mFetchFailureCount >= MAX_FETCH_FAILURE) + llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount + << " status " << mLastHttpGetStatus.toHex() << llendl; + // Will retry server-bake textures under a limited set of circumstances. + if (getFTType() == FTT_SERVER_BAKE && + mLastHttpGetStatus.isHttpStatus() && + mLastHttpGetStatus.mType >= 500 && + mLastHttpGetStatus.mType <= 599 && // Only retry 5xx failures. + mFetchFailureCount < MAX_FETCH_FAILURE) + { + llwarns << "Will retry fetch" << llendl; + } + else // Otherwise, assume the image is missing. { llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority << " mRawDiscardLevel " << mRawDiscardLevel << " current_discard " << current_discard + << " stats " << mLastHttpGetStatus.toHex() << llendl; setIsMissingAsset(); desired_discard = -1; -- cgit v1.2.3 From 34e2478388341a1add33bf88cac43031e351340e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 10 Apr 2013 11:57:22 -0400 Subject: SH-4061 WIP - less log spamming for (expected and normal) map tile failures. --- indra/newview/llviewertexture.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7a1afb1238..5f4c66a04c 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1828,8 +1828,11 @@ bool LLViewerFetchedTexture::updateFetch() { const S32 MAX_FETCH_FAILURE = 3; mFetchFailureCount++; - llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount - << " status " << mLastHttpGetStatus.toHex() << llendl; + if (getFTType() != FTT_MAP_TILE) + { + llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount + << " status " << mLastHttpGetStatus.toHex() << llendl; + } // Will retry server-bake textures under a limited set of circumstances. if (getFTType() == FTT_SERVER_BAKE && mLastHttpGetStatus.isHttpStatus() && @@ -1841,11 +1844,14 @@ bool LLViewerFetchedTexture::updateFetch() } else // Otherwise, assume the image is missing. { - llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority - << " mRawDiscardLevel " << mRawDiscardLevel - << " current_discard " << current_discard - << " stats " << mLastHttpGetStatus.toHex() - << llendl; + if (getFTType() != FTT_MAP_TILE) + { + llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority + << " mRawDiscardLevel " << mRawDiscardLevel + << " current_discard " << current_discard + << " stats " << mLastHttpGetStatus.toHex() + << llendl; + } setIsMissingAsset(); desired_discard = -1; } -- cgit v1.2.3 From 5976dc144e774ae363cbf774337ccf663015cc6d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 15 Apr 2013 15:12:22 -0400 Subject: SH-4061 WIP - simulated failures/image fetch retries --- indra/newview/llviewertexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5f4c66a04c..8f7c8e40b7 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1826,7 +1826,7 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - const S32 MAX_FETCH_FAILURE = 3; + const S32 MAX_FETCH_FAILURE = 1; mFetchFailureCount++; if (getFTType() != FTT_MAP_TILE) { -- cgit v1.2.3 From 7182203ebf4ba914c3a49f9593b1ed831fa6c1e9 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 15 Apr 2013 17:46:28 -0400 Subject: SH-4061 WIP - moved all retry logic into lltexturefetch, some cleanup. Debug setting now defines a fake failure rate. --- indra/newview/llviewertexture.cpp | 45 ++++++++------------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 8f7c8e40b7..45b402f0f6 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -962,8 +962,6 @@ void LLViewerFetchedTexture::init(bool firstinit) // does not contain this image. mIsMissingAsset = FALSE; - mFetchFailureCount = 0; - mLoadedCallbackDesiredDiscardLevel = S8_MAX; mPauseLoadedCallBacks = FALSE ; @@ -1826,35 +1824,17 @@ bool LLViewerFetchedTexture::updateFetch() // We finished but received no data if (current_discard < 0) { - const S32 MAX_FETCH_FAILURE = 1; - mFetchFailureCount++; if (getFTType() != FTT_MAP_TILE) { - llwarns << "Fetch failure for " << mID << " failure count " << mFetchFailureCount - << " status " << mLastHttpGetStatus.toHex() << llendl; - } - // Will retry server-bake textures under a limited set of circumstances. - if (getFTType() == FTT_SERVER_BAKE && - mLastHttpGetStatus.isHttpStatus() && - mLastHttpGetStatus.mType >= 500 && - mLastHttpGetStatus.mType <= 599 && // Only retry 5xx failures. - mFetchFailureCount < MAX_FETCH_FAILURE) - { - llwarns << "Will retry fetch" << llendl; - } - else // Otherwise, assume the image is missing. - { - if (getFTType() != FTT_MAP_TILE) - { - llwarns << "!mIsFetching, setting as missing, decode_priority " << decode_priority - << " mRawDiscardLevel " << mRawDiscardLevel - << " current_discard " << current_discard - << " stats " << mLastHttpGetStatus.toHex() - << llendl; - } - setIsMissingAsset(); - desired_discard = -1; + llwarns << mID + << " Fetch failure, setting as missing, decode_priority " << decode_priority + << " mRawDiscardLevel " << mRawDiscardLevel + << " current_discard " << current_discard + << " stats " << mLastHttpGetStatus.toHex() + << llendl; } + setIsMissingAsset(); + desired_discard = -1; } else { @@ -1968,14 +1948,8 @@ 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, fake_failure); + w, h, c, desired_discard, needsAux(), mCanUseHTTP); if (fetch_request_created) { @@ -2072,7 +2046,6 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) else { llinfos << mID << ": un-flagging missing asset" << llendl; - mFetchFailureCount = 0; } mIsMissingAsset = is_missing; } -- cgit v1.2.3 From 56cf4297f3c603b8c39880ee20ce0fd6fb3341e5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 13 Jun 2013 16:07:02 -0400 Subject: SH-4250 WIP - logging tweaks and cleanup --- indra/newview/llviewertexture.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 45b402f0f6..4c9ca8b1d7 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -901,6 +901,27 @@ void LLViewerTexture::updateBindStatsForTester() //end of LLViewerTexture //---------------------------------------------------------------------------------------------- +const std::string& fttype_to_string(const FTType& fttype) +{ + static const std::string ftt_unknown("FTT_UNKNOWN"); + static const std::string ftt_default("FTT_DEFAULT"); + static const std::string ftt_server_bake("FTT_SERVER_BAKE"); + static const std::string ftt_host_bake("FTT_HOST_BAKE"); + static const std::string ftt_map_tile("FTT_MAP_TILE"); + static const std::string ftt_local_file("FTT_LOCAL_FILE"); + static const std::string ftt_error("FTT_ERROR"); + switch(fttype) + { + case FTT_UNKNOWN: return ftt_unknown; break; + case FTT_DEFAULT: return ftt_default; break; + case FTT_SERVER_BAKE: return ftt_server_bake; break; + case FTT_HOST_BAKE: return ftt_host_bake; break; + case FTT_MAP_TILE: return ftt_map_tile; break; + case FTT_LOCAL_FILE: return ftt_local_file; break; + } + return ftt_error; +} + //---------------------------------------------------------------------------------------------- //start of LLViewerFetchedTexture //---------------------------------------------------------------------------------------------- -- cgit v1.2.3 From 36bb33b12ab090e2acbc7e00039cdff682882fa4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 18 Sep 2013 17:03:34 -0400 Subject: sunshine cleanup annotations --- indra/newview/llviewertexture.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7e35af7e63..80f25b7d4c 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -964,6 +964,8 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { + // SUNSHINE CLEANUP + llassert(false); mCanUseHTTP = false; } generateGLTexture() ; -- cgit v1.2.3 From da398cb12f05f32441e4ca843448ea8f4e2acc95 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 23 Sep 2013 18:15:25 -0400 Subject: SH-3455 WIP - post-SSA cleanup --- indra/newview/llviewertexture.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 80f25b7d4c..18cfa82421 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -964,9 +964,7 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { - // SUNSHINE CLEANUP - llassert(false); - mCanUseHTTP = false; + llwarns << "Unsupported fetch type " << mFTType << llendl; } generateGLTexture() ; } -- cgit v1.2.3 From 259394b541b43c6f4fcba2417009dd0447a17def Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 23 Sep 2013 17:03:19 -0600 Subject: fix the bug that texture aux channel data can not be reloaded. --- indra/newview/llviewertexture.cpp | 46 +++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 7e35af7e63..831551a0a7 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -989,6 +989,7 @@ void LLViewerFetchedTexture::init(bool firstinit) { mOrigWidth = 0; mOrigHeight = 0; + mHasAux = FALSE; mNeedsAux = FALSE; mRequestedDiscardLevel = -1; mRequestedDownloadPriority = 0.f; @@ -1823,7 +1824,11 @@ bool LLViewerFetchedTexture::updateFetch() bool finished = LLAppViewer::getTextureFetch()->getRequestFinished(getID(), fetch_discard, mRawImage, mAuxRawImage, mLastHttpGetStatus); if (mRawImage.notNull()) sRawCount++; - if (mAuxRawImage.notNull()) sAuxCount++; + if (mAuxRawImage.notNull()) + { + mHasAux = TRUE; + sAuxCount++; + } if (finished) { mIsFetching = FALSE; @@ -2152,8 +2157,16 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call } if (mNeedsAux && mAuxRawImage.isNull() && getDiscardLevel() >= 0) { - // We need aux data, but we've already loaded the image, and it didn't have any - llwarns << "No aux data available for callback for image:" << getID() << llendl; + if(mHasAux) + { + //trigger a refetch + forceToRefetchTexture(); + } + else + { + // We need aux data, but we've already loaded the image, and it didn't have any + llwarns << "No aux data available for callback for image:" << getID() << llendl; + } } mLastCallBackActiveTime = sCurrentTime ; } @@ -2604,7 +2617,7 @@ bool LLViewerFetchedTexture::needsToSaveRawImage() void LLViewerFetchedTexture::destroyRawImage() { - if (mAuxRawImage.notNull()) + if (mAuxRawImage.notNull() && !needsToSaveRawImage()) { sAuxCount--; mAuxRawImage = NULL; @@ -2760,6 +2773,25 @@ void LLViewerFetchedTexture::saveRawImage() mLastReferencedSavedRawImageTime = sCurrentTime ; } +//force to refetch the texture to the discard level +void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard) +{ + F32 kept_time = 60.0; //seconds + if(mForceToSaveRawImage) + { + desired_discard = llmin(desired_discard, mDesiredSavedRawDiscardLevel); + kept_time = llmax(kept_time, mKeptSavedRawImageTime); + } + + //trigger a new fetch. + mForceToSaveRawImage = TRUE ; + mDesiredSavedRawDiscardLevel = desired_discard ; + mKeptSavedRawImageTime = kept_time ; + mLastReferencedSavedRawImageTime = sCurrentTime ; + mSavedRawImage = NULL ; + mSavedRawDiscardLevel = -1 ; +} + void LLViewerFetchedTexture::forceToSaveRawImage(S32 desired_discard, F32 kept_time) { mKeptSavedRawImageTime = kept_time ; @@ -2807,6 +2839,12 @@ void LLViewerFetchedTexture::destroySavedRawImage() mDesiredSavedRawDiscardLevel = -1 ; mLastReferencedSavedRawImageTime = 0.0f ; mKeptSavedRawImageTime = 0.f ; + + if(mAuxRawImage.notNull()) + { + sAuxCount--; + mAuxRawImage = NULL; + } } LLImageRaw* LLViewerFetchedTexture::getSavedRawImage() -- cgit v1.2.3 From f20fadeafab79b940da7addecd21de2f0962ced5 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 8 Oct 2013 15:23:47 -0600 Subject: fix a texture issue that unpaused callbacks never get fired. --- indra/newview/llviewertexture.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 831551a0a7..5330c4da86 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1046,7 +1046,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mLastReferencedSavedRawImageTime = 0.0f ; mKeptSavedRawImageTime = 0.f ; mLastCallBackActiveTime = 0.f; - + mForceCallbackFetch = FALSE; mInDebug = FALSE; mFTType = FTT_UNKNOWN; @@ -2281,6 +2281,7 @@ void LLViewerFetchedTexture::unpauseLoadedCallbacks(const LLLoadedCallbackEntry: } mPauseLoadedCallBacks = FALSE ; mLastCallBackActiveTime = sCurrentTime ; + mForceCallbackFetch = TRUE; if(need_raw) { mSaveRawImage = TRUE ; @@ -2321,6 +2322,7 @@ void LLViewerFetchedTexture::pauseLoadedCallbacks(const LLLoadedCallbackEntry::s bool LLViewerFetchedTexture::doLoadedCallbacks() { static const F32 MAX_INACTIVE_TIME = 900.f ; //seconds + static const F32 MAX_IDLE_WAIT_TIME = 5.f ; //seconds if (mNeedsCreateTexture) { @@ -2525,6 +2527,9 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() } } + // Done with any raw image data at this point (will be re-created if we still have callbacks) + destroyRawImage(); + // // If we have no callbacks, take us off of the image callback list. // @@ -2532,10 +2537,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() { gTextureList.mCallbackList.erase(this); } + else if(!res && mForceCallbackFetch && sCurrentTime - mLastCallBackActiveTime > MAX_IDLE_WAIT_TIME && !mIsFetching) + { + //wait for long enough but no fetching request issued, force one. + forceToRefetchTexture(mLoadedCallbackDesiredDiscardLevel, 5.f); + mForceCallbackFetch = FALSE; //fire once. + } - // Done with any raw image data at this point (will be re-created if we still have callbacks) - destroyRawImage(); - return res; } @@ -2774,9 +2782,8 @@ void LLViewerFetchedTexture::saveRawImage() } //force to refetch the texture to the discard level -void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard) +void LLViewerFetchedTexture::forceToRefetchTexture(S32 desired_discard, F32 kept_time) { - F32 kept_time = 60.0; //seconds if(mForceToSaveRawImage) { desired_discard = llmin(desired_discard, mDesiredSavedRawDiscardLevel); -- cgit v1.2.3 From b486f6a72c94468f4667d364636d56ea545be188 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 11 Oct 2013 16:52:45 -0400 Subject: SH-4458 SH-3652 FIX Pants flare does not load properly upon an avatar returning Viewer added a new callback when the avatar returned without resetting the timer for last reference to the saved raw image. This created a time window in which new callbacks could get cleared out due to the raw image getting destroyed. Since the callback was removed, pants flare was not properly applied. Appears to be working now. --- indra/newview/llviewertexture.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 5330c4da86..5ab628ab2c 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2169,6 +2169,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call } } mLastCallBackActiveTime = sCurrentTime ; + mLastReferencedSavedRawImageTime = sCurrentTime; } void LLViewerFetchedTexture::clearCallbackEntryList() -- cgit v1.2.3 From 854aec1231ff3bd579ae6aec2302c8f9e1d7d958 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 28 Oct 2013 11:02:33 -0600 Subject: a try to fix the blurry texture problem. --- indra/newview/llviewertexture.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1f42590884..f22074a8d6 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1889,7 +1889,7 @@ bool LLViewerFetchedTexture::updateFetch() if ((decode_priority > 0) && (mRawDiscardLevel < 0 || mRawDiscardLevel == INVALID_DISCARD_LEVEL)) { // We finished but received no data - if (current_discard < 0) + if (getDiscardLevel() < 0) { if (getFTType() != FTT_MAP_TILE) { @@ -1906,8 +1906,17 @@ bool LLViewerFetchedTexture::updateFetch() else { //llwarns << mID << ": Setting min discard to " << current_discard << llendl; - mMinDiscardLevel = current_discard; - desired_discard = current_discard; + if(current_discard >= 0) + { + mMinDiscardLevel = current_discard; + desired_discard = current_discard; + } + else + { + S32 dis_level = getDiscardLevel(); + mMinDiscardLevel = dis_level; + desired_discard = dis_level; + } } destroyRawImage(); } -- cgit v1.2.3 From 5fc3066bdb3921203dfdb085b2690fd2d79cf350 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 7 Nov 2013 15:36:45 -0700 Subject: add some debug code for possible gray baked avatar textures --- indra/newview/llviewertexture.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f22074a8d6..fdbf2b015d 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2345,6 +2345,15 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() } if(sCurrentTime - mLastCallBackActiveTime > MAX_INACTIVE_TIME && !mIsFetching) { + if (mFTType == FTT_SERVER_BAKE) + { + //output some debug info + llinfos << "baked texture: " << mID << "clears all call backs due to inactivity." << llendl; + llinfos << mUrl << llendl; + llinfos << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << + " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << llendl; + } + clearCallbackEntryList() ; //remove all callbacks. return false ; } @@ -2353,6 +2362,13 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (isMissingAsset()) { + if (mFTType == FTT_SERVER_BAKE) + { + //output some debug info + llinfos << "baked texture: " << mID << "is missing." << llendl; + llinfos << mUrl << llendl; + } + for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); iter != mLoadedCallbackList.end(); ) { -- cgit v1.2.3 From 487ca1bad37883be0325b564ab557a8f77575388 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 May 2014 17:50:59 -0400 Subject: v-r -> s-e merge WIP --- indra/newview/llviewertexture.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llviewertexture.cpp') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 28b07feef7..ba89aafc84 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -994,7 +994,7 @@ LLViewerFetchedTexture::LLViewerFetchedTexture(const LLUUID& id, FTType f_type, mFTType = f_type; if (mFTType == FTT_HOST_BAKE) { - llwarns << "Unsupported fetch type " << mFTType << llendl; + LL_WARNS() << "Unsupported fetch type " << mFTType << LL_ENDL; } generateGLTexture(); } @@ -1930,19 +1930,19 @@ bool LLViewerFetchedTexture::updateFetch() { if (getFTType() != FTT_MAP_TILE) { - llwarns << mID + LL_WARNS() << mID << " Fetch failure, setting as missing, decode_priority " << decode_priority << " mRawDiscardLevel " << mRawDiscardLevel << " current_discard " << current_discard << " stats " << mLastHttpGetStatus.toHex() - << llendl; + << LL_ENDL; } setIsMissingAsset(); desired_discard = -1; } else { - //llwarns << mID << ": Setting min discard to " << current_discard << llendl; + //LL_WARNS() << mID << ": Setting min discard to " << current_discard << LL_ENDL; if(current_discard >= 0) { mMinDiscardLevel = current_discard; @@ -2134,7 +2134,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) { if (mUrl.empty()) { - llwarns << mID << ": Marking image as missing" << llendl; + LL_WARNS() << mID << ": Marking image as missing" << LL_ENDL; } else { @@ -2143,7 +2143,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) // server bake texture. if (getFTType() != FTT_MAP_TILE) { - llwarns << mUrl << ": Marking image as missing" << llendl; + LL_WARNS() << mUrl << ": Marking image as missing" << LL_ENDL; } } if (mHasFetcher) @@ -2158,7 +2158,7 @@ void LLViewerFetchedTexture::setIsMissingAsset(BOOL is_missing) } else { - llinfos << mID << ": un-flagging missing asset" << llendl; + LL_INFOS() << mID << ": un-flagging missing asset" << LL_ENDL; } mIsMissingAsset = is_missing; } @@ -2211,7 +2211,7 @@ void LLViewerFetchedTexture::setLoadedCallback( loaded_callback_func loaded_call else { // We need aux data, but we've already loaded the image, and it didn't have any - llwarns << "No aux data available for callback for image:" << getID() << llendl; + LL_WARNS() << "No aux data available for callback for image:" << getID() << LL_ENDL; } } mLastCallBackActiveTime = sCurrentTime ; @@ -2385,10 +2385,10 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mFTType == FTT_SERVER_BAKE) { //output some debug info - llinfos << "baked texture: " << mID << "clears all call backs due to inactivity." << llendl; - llinfos << mUrl << llendl; - llinfos << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << - " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << llendl; + LL_INFOS() << "baked texture: " << mID << "clears all call backs due to inactivity." << LL_ENDL; + LL_INFOS() << mUrl << LL_ENDL; + LL_INFOS() << "current discard: " << getDiscardLevel() << " current discard for fetch: " << getCurrentDiscardLevelForFetching() << + " Desired discard: " << getDesiredDiscardLevel() << "decode Pri: " << getDecodePriority() << LL_ENDL; } clearCallbackEntryList() ; //remove all callbacks. @@ -2402,8 +2402,8 @@ bool LLViewerFetchedTexture::doLoadedCallbacks() if (mFTType == FTT_SERVER_BAKE) { //output some debug info - llinfos << "baked texture: " << mID << "is missing." << llendl; - llinfos << mUrl << llendl; + LL_INFOS() << "baked texture: " << mID << "is missing." << LL_ENDL; + LL_INFOS() << mUrl << LL_ENDL; } for(callback_list_t::iterator iter = mLoadedCallbackList.begin(); -- cgit v1.2.3