summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llagent.cpp17
-rwxr-xr-xindra/newview/llagentwearables.cpp1
-rwxr-xr-xindra/newview/llappearancemgr.cpp1
-rwxr-xr-xindra/newview/llviewerstats.cpp2
-rwxr-xr-xindra/newview/llvoavatar.cpp65
-rwxr-xr-xindra/newview/llvoavatar.h20
-rwxr-xr-xindra/newview/llvoavatarself.cpp81
-rwxr-xr-xindra/newview/llvoavatarself.h5
8 files changed, 120 insertions, 72 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index c86b75791d..e15c1a5104 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -812,6 +812,8 @@ void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id)
{
llinfos << "called" << llendl;
+
+ // Old-style appearance entering a server-bake region.
if (isAgentAvatarValid() &&
!gAgentAvatarp->isUsingServerBakes() &&
(mRegionp->getCentralBakeVersion()>0))
@@ -819,6 +821,14 @@ void LLAgent::handleServerBakeRegionTransition(const LLUUID& region_id)
llinfos << "update requested due to region transition" << llendl;
LLAppearanceMgr::instance().requestServerAppearanceUpdate();
}
+ // new-style appearance entering a non-bake region,
+ // need to check for existence of the baking service.
+ else if (isAgentAvatarValid() &&
+ gAgentAvatarp->isUsingServerBakes() &&
+ mRegionp->getCentralBakeVersion()==0)
+ {
+ gAgentAvatarp->checkForUnsupportedServerBakeAppearance();
+ }
}
//-----------------------------------------------------------------------------
@@ -4335,13 +4345,6 @@ void LLAgent::sendAgentSetAppearance()
return;
}
- if (!gAgentWearables.changeInProgress())
- {
- // Change is fully resolved, can close some open phases.
- gAgentAvatarp->stopPhase("process_initial_wearables_update");
- gAgentAvatarp->stopPhase("wear_inventory_category");
- }
-
if (!isAgentAvatarValid() || (getRegion() && getRegion()->getCentralBakeVersion())) return;
// At this point we have a complete appearance to send and are in a non-baking region.
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp
index 0c79ac0ba3..ba04991a02 100755
--- a/indra/newview/llagentwearables.cpp
+++ b/indra/newview/llagentwearables.cpp
@@ -796,7 +796,6 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs
if (isAgentAvatarValid())
{
- //gAgentAvatarp->clearPhases(); // reset phase timers for outfit loading.
gAgentAvatarp->startPhase("process_initial_wearables_update");
gAgentAvatarp->outputRezTiming("Received initial wearables update");
}
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index ecbb922adc..10523ca998 100755
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2008,6 +2008,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering)
}
BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF);
+ selfStartPhase("update_appearance_from_cof");
LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL;
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 65cae9b338..17bb03b889 100755
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -763,7 +763,7 @@ void LLViewerStats::PhaseMap::stopPhase(const std::string& phase_name)
{
if (iter->second.getStarted())
{
- // Going from started to paused state - record stats.
+ // Going from started to stopped state - record stats.
iter->second.stop();
}
}
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 346c55e589..5b4d57986b 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -4456,6 +4456,7 @@ void LLVOAvatar::setTexEntry(const U8 index, const LLTextureEntry &te)
const std::string LLVOAvatar::getImageURL(const U8 te, const LLUUID &uuid)
{
+ llassert(isIndexBakedTexture(ETextureIndex(te)));
std::string url = "";
if (isUsingServerBakes())
{
@@ -5872,43 +5873,15 @@ BOOL LLVOAvatar::getIsCloud() const
void LLVOAvatar::updateRezzedStatusTimers()
{
- // State machine for rezzed status. Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = textured, 3 = textured_and_downloaded.
- // Purpose is to collect time data for each period of cloud or cloud+gray.
+ // State machine for rezzed status. Statuses are -1 on startup, 0
+ // = cloud, 1 = gray, 2 = textured, 3 = textured_and_downloaded.
+ // Purpose is to collect time data for each it takes avatar to reach
+ // various loading landmarks: gray, textured (partial), textured fully.
S32 rez_status = getRezzedStatus();
if (rez_status != mLastRezzedStatus)
{
LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL;
-#if 0
- bool is_cloud_or_gray = (rez_status==0 || rez_status==1);
- bool was_cloud_or_gray = (mLastRezzedStatus==0 || mLastRezzedStatus==1);
- bool is_cloud = (rez_status==0);
- bool was_cloud = (mLastRezzedStatus==0);
-
- // Non-cloud to cloud
- if (is_cloud && !was_cloud)
- {
- // start cloud timer.
- startPhase("cloud");
- }
- else if (was_cloud && !is_cloud)
- {
- // stop cloud timer, which will capture stats.
- stopPhase("cloud");
- }
-
- // Non-cloud-or-gray to cloud-or-gray
- if (is_cloud_or_gray && !was_cloud_or_gray)
- {
- // start cloud-or-gray timer.
- startPhase("cloud-or-gray");
- }
- else if (was_cloud_or_gray && !is_cloud_or_gray)
- {
- // stop cloud-or-gray timer, which will capture stats.
- stopPhase("cloud-or-gray");
- }
-#endif
if (mLastRezzedStatus == -1 && rez_status != -1)
{
@@ -5933,6 +5906,13 @@ void LLVOAvatar::updateRezzedStatusTimers()
{
stopPhase("load_" + LLVOAvatar::rezStatusToString(i));
}
+ if (rez_status == 3)
+ {
+ // "fully loaded", mark any pending appearance change complete.
+ selfStopPhase("update_appearance_from_cof");
+ selfStopPhase("wear_inventory_category", false);
+ selfStopPhase("process_initial_wearables_update", false);
+ }
}
mLastRezzedStatus = rez_status;
@@ -5952,7 +5932,7 @@ void LLVOAvatar::startPhase(const std::string& phase_name)
{
if (!completed)
{
- LL_DEBUGS("Avatar") << "start when started already for " << phase_name << llendl;
+ LL_DEBUGS("Avatar") << "no-op, start when started already for " << phase_name << llendl;
return;
}
}
@@ -5960,7 +5940,7 @@ void LLVOAvatar::startPhase(const std::string& phase_name)
getPhases().startPhase(phase_name);
}
-void LLVOAvatar::stopPhase(const std::string& phase_name)
+void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
{
F32 elapsed;
bool completed;
@@ -5968,19 +5948,25 @@ void LLVOAvatar::stopPhase(const std::string& phase_name)
{
if (!completed)
{
- LL_DEBUGS("Avatar") << "stopped phase " << phase_name << llendl;
getPhases().stopPhase(phase_name);
completed = true;
logMetricsTimerRecord(phase_name, elapsed, completed);
+ LL_DEBUGS("Avatar") << "stopped phase " << phase_name << " elapsed " << elapsed << llendl;
}
else
{
- LL_DEBUGS("Avatar") << "stop when stopped already for " << phase_name << llendl;
+ if (err_check)
+ {
+ LL_DEBUGS("Avatar") << "no-op, stop when stopped already for " << phase_name << llendl;
+ }
}
}
else
{
- LL_DEBUGS("Avatar") << "stop when not started for " << phase_name << llendl;
+ if (err_check)
+ {
+ LL_DEBUGS("Avatar") << "no-op, stop when not started for " << phase_name << llendl;
+ }
}
}
@@ -6037,9 +6023,11 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse
record["is_self"] = isSelf();
+#if 0 // verbose logging
std::ostringstream ostr;
ostr << LLSDNotationStreamer(record);
LL_DEBUGS("Avatar") << "record\n" << ostr.str() << llendl;
+#endif
if (isAgentAvatarValid())
{
@@ -6258,7 +6246,8 @@ void LLVOAvatar::updateMeshTextures()
#ifndef LL_RELEASE_FOR_DOWNLOAD
LLViewerFetchedTexture* existing_baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID);
#endif
- const std::string url = getImageURL(i, mBakedTextureDatas[i].mLastTextureID);
+ ETextureIndex te = ETextureIndex(mBakedTextureDatas[i].mTextureIndex);
+ const std::string url = getImageURL(te, mBakedTextureDatas[i].mLastTextureID);
if (!url.empty())
{
baked_img = LLViewerTextureManager::getFetchedTextureFromUrl(url, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, mBakedTextureDatas[i].mLastTextureID);
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index c8915383ca..c989673cdf 100755
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -294,7 +294,7 @@ public:
void startPhase(const std::string& phase_name);
- void stopPhase(const std::string& phase_name);
+ void stopPhase(const std::string& phase_name, bool err_check = true);
void clearPhases();
void logPendingPhases();
static void logPendingPhasesAllAvatars();
@@ -316,24 +316,6 @@ private:
LLFrameTimer mFullyLoadedTimer;
LLFrameTimer mRuthTimer;
-public:
- class ScopedPhaseSetter
- {
- public:
- ScopedPhaseSetter(LLVOAvatar *avatarp, std::string phase_name):
- mAvatar(avatarp), mPhaseName(phase_name)
- {
- if (mAvatar) { mAvatar->getPhases().startPhase(mPhaseName); }
- }
- ~ScopedPhaseSetter()
- {
- if (mAvatar) { mAvatar->getPhases().stopPhase(mPhaseName); }
- }
- private:
- std::string mPhaseName;
- LLVOAvatar* mAvatar;
- };
-
private:
LLViewerStats::PhaseMap mPhases;
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index e30d62869f..2775c9442a 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -86,11 +86,11 @@ void selfStartPhase(const std::string& phase_name)
}
}
-void selfStopPhase(const std::string& phase_name)
+void selfStopPhase(const std::string& phase_name, bool err_check)
{
if (isAgentAvatarValid())
{
- gAgentAvatarp->stopPhase(phase_name);
+ gAgentAvatarp->stopPhase(phase_name, err_check);
}
}
@@ -179,6 +179,24 @@ bool output_self_av_texture_diagnostics()
return false;
}
+bool update_avatar_rez_metrics()
+{
+ if (!isAgentAvatarValid())
+ return true;
+
+ gAgentAvatarp->updateAvatarRezMetrics(false);
+ return false;
+}
+
+bool check_for_unsupported_baked_appearance()
+{
+ if (!isAgentAvatarValid())
+ return true;
+
+ gAgentAvatarp->checkForUnsupportedServerBakeAppearance();
+ return false;
+}
+
void LLVOAvatarSelf::initInstance()
{
BOOL status = TRUE;
@@ -214,7 +232,8 @@ void LLVOAvatarSelf::initInstance()
}
//doPeriodically(output_self_av_texture_diagnostics, 30.0);
- doPeriodically(boost::bind(&LLVOAvatarSelf::updateAvatarRezMetrics, this, false), 5.0);
+ doPeriodically(update_avatar_rez_metrics, 5.0);
+ doPeriodically(check_for_unsupported_baked_appearance, 120.0);
}
// virtual
@@ -2371,6 +2390,62 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics()
}
}
+class CheckAgentAppearanceServiceResponder: public LLHTTPClient::Responder
+{
+public:
+ CheckAgentAppearanceServiceResponder()
+ {
+ }
+
+ virtual ~CheckAgentAppearanceServiceResponder()
+ {
+ }
+
+ /* virtual */ void result(const LLSD& content)
+ {
+ LL_DEBUGS("Avatar") << "status OK" << llendl;
+ }
+
+ // Error
+ /*virtual*/ void error(U32 status, const std::string& reason)
+ {
+ if (isAgentAvatarValid())
+ {
+ LL_DEBUGS("Avatar") << "failed, will rebake" << llendl;
+ forceAppearanceUpdate();
+ }
+ }
+
+ static void forceAppearanceUpdate()
+ {
+ // Trying to rebake immediately after crossing region boundary
+ // seems to be failure prone; adding a delay factor. Yes, this
+ // fix is ad-hoc and not guaranteed to work in all cases.
+ doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures,
+ gAgentAvatarp.get(), true), 5.0);
+ }
+};
+
+void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance()
+{
+ // Need to check only if we have a server baked appearance and are
+ // in a non-baking region.
+ if (!gAgentAvatarp->isUsingServerBakes())
+ return;
+ if (!gAgent.getRegion() || gAgent.getRegion()->getCentralBakeVersion()!=0)
+ return;
+
+ // if baked image service is unknown, need to refresh.
+ if (gSavedSettings.getString("AgentAppearanceServiceURL").empty())
+ {
+ CheckAgentAppearanceServiceResponder::forceAppearanceUpdate();
+ }
+ // query baked image service to check status.
+ std::string image_url = gAgentAvatarp->getImageURL(TEX_HEAD_BAKED,
+ getTE(TEX_HEAD_BAKED)->getID());
+ LLHTTPClient::head(image_url, new CheckAgentAppearanceServiceResponder);
+}
+
const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const
{
if (canGrabBakedTexture(baked_index))
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 04b0fb760c..78728cff20 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -402,6 +402,7 @@ public:
const std::string debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer
const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD
void sendViewerAppearanceChangeMetrics(); // send data associated with completing a change.
+ void checkForUnsupportedServerBakeAppearance();
private:
LLFrameTimer mDebugSelfLoadTimer;
F32 mDebugTimeWearablesLoaded;
@@ -421,9 +422,7 @@ extern LLPointer<LLVOAvatarSelf> gAgentAvatarp;
BOOL isAgentAvatarValid();
void selfStartPhase(const std::string& phase_name);
-void selfStopPhase(const std::string& phase_name);
+void selfStopPhase(const std::string& phase_name, bool err_check = true);
void selfClearPhases();
-void update_avatar_rez_metrics(bool force_send);
-
#endif // LL_VO_AVATARSELF_H