summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2020-01-29 18:09:19 +0200
committerandreykproductengine <andreykproductengine@lindenlab.com>2020-01-29 20:42:32 +0200
commit66a831dcf94edb7e391c270ccb79a8f023219e09 (patch)
tree1beff87c3f777b85754f8a9fe6d30a8413151ccc /indra
parenta8437a7636c065ae06e53281db1be94dd4ae9e88 (diff)
SL-4354 Mesh avatars look broken while loading.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llvoavatar.cpp37
-rw-r--r--indra/newview/llvoavatar.h2
2 files changed, 31 insertions, 8 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 887456dcfb..f4f91a4009 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),
@@ -5327,6 +5330,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.
}
@@ -5334,7 +5338,9 @@ void LLVOAvatar::checkTextureLoading()
{
return ; //have not been invisible for enough time.
}
-
+
+ mLoadedCallbackTextures = 0;
+
for(LLLoadedCallbackEntry::source_callback_list_t::iterator iter = mCallbackTextureList.begin();
iter != mCallbackTextureList.end(); ++iter)
{
@@ -5356,8 +5362,12 @@ void LLVOAvatar::checkTextureLoading()
tex->unpauseLoadedCallbacks(&mCallbackTextureList) ;
tex->addTextureStats(START_AREA); //jump start the fetching again
}
- }
- }
+ }
+ if (tex->isFullyLoaded())
+ {
+ mLoadedCallbackTextures++;
+ }
+ }
if(!pause)
{
@@ -7799,9 +7809,19 @@ 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)
+ || mMeshTexturesDirty
+ || mVisualComplexityStale //complexity just updated
+ // 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);
@@ -8185,6 +8205,7 @@ void LLVOAvatar::updateMeshTextures()
}
baked_img->setLoadedCallback(onBakedTextureLoaded, SWITCH_TO_BAKED_DISCARD, FALSE, FALSE, new LLUUID( mID ),
src_callback_list, paused );
+ mLastTexCallbackAddedTime.reset();
// this could add paused texture callbacks
mLoadedCallbacksPaused |= paused;
@@ -8578,7 +8599,7 @@ 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 );
-
+ mLastTexCallbackAddedTime.reset();
// this could add paused texture callbacks
mLoadedCallbacksPaused |= paused;
}
@@ -10351,7 +10372,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;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index e352a6c1fa..3526142ff5 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -629,6 +629,8 @@ protected:
LLLoadedCallbackEntry::source_callback_list_t mCallbackTextureList ;
BOOL mLoadedCallbacksPaused;
+ S32 mLoadedCallbackTextures; // count of fully loaded textures filled from mCallbackTextureList
+ LLFrameTimer mLastTexCallbackAddedTime;
std::set<LLUUID> mTextureIDs;
//--------------------------------------------------------------------
// Local Textures