diff options
author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-02-03 15:13:37 +0200 |
---|---|---|
committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-02-03 15:13:37 +0200 |
commit | a52ef7ad60c8821fcb412988d838b58c0414ac8f (patch) | |
tree | a6fe2e267b2e7bf70d4a8d8227e1bc1f1152574d /indra/newview/llvoavatar.cpp | |
parent | bc496f5f17a446af27b47cbe227e7e85089bab8d (diff) | |
parent | 712164210cf57cfde3b17c3162dc4129d52e2780 (diff) |
Merge branch 'DRTVWR-499' into DRTVWR-500
Diffstat (limited to 'indra/newview/llvoavatar.cpp')
-rw-r--r-- | indra/newview/llvoavatar.cpp | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index af4d1a28b5..8f6733886a 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -197,6 +197,8 @@ const F32 NAMETAG_VERT_OFFSET_WEIGHT = 0.17f; const U32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; const F64 HUD_OVERSIZED_TEXTURE_DATA_SIZE = 1024 * 1024; +const F32 MAX_TEXTURE_WAIT_TIME_SEC = 60; + enum ERenderName { RENDER_NAME_NEVER, @@ -663,6 +665,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mFullyLoadedInitialized(FALSE), mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mLoadedCallbacksPaused(FALSE), + mLoadedCallbackTextures(0), mRenderUnloadedAvatar(LLCachedControl<bool>(gSavedSettings, "RenderUnloadedAvatar", false)), mLastRezzedStatus(-1), mIsEditingAppearance(FALSE), @@ -5336,6 +5339,7 @@ void LLVOAvatar::checkTextureLoading() if(mCallbackTextureList.empty()) //when is self or no callbacks. Note: this list for self is always empty. { mLoadedCallbacksPaused = pause ; + mLoadedCallbackTextures = 0; return ; //nothing to check. } @@ -5343,7 +5347,9 @@ void LLVOAvatar::checkTextureLoading() { return ; //have not been invisible for enough time. } - + + mLoadedCallbackTextures = pause ? mCallbackTextureList.size() : 0; + for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin(); iter != mCallbackTextureList.end(); ++iter) { @@ -5364,9 +5370,14 @@ void LLVOAvatar::checkTextureLoading() tex->unpauseLoadedCallbacks(&mCallbackTextureList) ; tex->addTextureStats(START_AREA); //jump start the fetching again + + if (tex->isFullyLoaded()) + { + mLoadedCallbackTextures++; // consider it loaded + } } - } - } + } + } if(!pause) { @@ -7808,9 +7819,17 @@ BOOL LLVOAvatar::updateIsFullyLoaded() { S32 rez_status = getRezzedStatus(); bool loading = getIsCloud(); - if (mFirstFullyVisible && !mIsControlAvatar && rez_status < 3) - { - loading = ((rez_status < 2) || !isFullyBaked()); + if (mFirstFullyVisible && !mIsControlAvatar) + { + loading = ((rez_status < 2) + // Wait at least 60s for unfinished textures to finish on first load, + // don't wait forever, it might fail. Even if it will eventually load by + // itself and update mLoadedCallbackTextures (or fail and clean the list), + // avatars are more time-sensitive than textures and can't wait that long. + || (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC) + || !mPendingAttachment.empty() + || (rez_status < 3 && !isFullyBaked()) + ); } updateRezzedStatusTimers(rez_status); updateRuthTimer(loading); @@ -8194,6 +8213,14 @@ void LLVOAvatar::updateMeshTextures() } baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); + if (!baked_img->isFullyLoaded() && !paused) + { + mLastTexCallbackAddedTime.reset(); + } + else + { + mLoadedCallbackTextures++; // consider it loaded + } // this could add paused texture callbacks mLoadedCallbacksPaused |= paused; @@ -8587,7 +8614,14 @@ void LLVOAvatar::onFirstTEMessageReceived() LL_DEBUGS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL; image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); - + if (!image->isFullyLoaded() && !paused) + { + mLastTexCallbackAddedTime.reset(); + } + else + { + mLoadedCallbackTextures++; // consider it loaded + } // this could add paused texture callbacks mLoadedCallbacksPaused |= paused; } @@ -10360,7 +10394,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() // Diagnostic list of all textures on our avatar static std::set<LLUUID> all_textures; - if (mVisualComplexityStale) + if (mVisualComplexityStale) { U32 cost = VISUAL_COMPLEXITY_UNKNOWN; LLVOVolume::texture_cost_t textures; |