Sunshine catchup.
This commit is contained in:
@@ -1119,6 +1119,9 @@ LLVOAvatar::~LLVOAvatar()
|
||||
debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding");
|
||||
}
|
||||
}
|
||||
|
||||
logPendingPhases();
|
||||
|
||||
lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl;
|
||||
|
||||
std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer());
|
||||
@@ -1217,6 +1220,7 @@ BOOL LLVOAvatar::hasGray() const
|
||||
S32 LLVOAvatar::getRezzedStatus() const
|
||||
{
|
||||
if (getIsCloud()) return 0;
|
||||
if (isFullyTextured() && allBakedTexturesCompletelyDownloaded()) return 3;
|
||||
if (isFullyTextured()) return 2;
|
||||
llassert(hasGray());
|
||||
return 1; // gray
|
||||
@@ -1272,7 +1276,7 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
|
||||
void LLVOAvatar::getNearbyRezzedStats(std::vector<S32>& counts)
|
||||
{
|
||||
counts.clear();
|
||||
counts.resize(3);
|
||||
counts.resize(4);
|
||||
for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin();
|
||||
iter != LLCharacter::sInstances.end(); ++iter)
|
||||
{
|
||||
@@ -1290,6 +1294,7 @@ std::string LLVOAvatar::rezStatusToString(S32 rez_status)
|
||||
if (rez_status==0) return "cloud";
|
||||
if (rez_status==1) return "gray";
|
||||
if (rez_status==2) return "textured";
|
||||
if (rez_status==3) return "textured_and_downloaded";
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
@@ -2212,13 +2217,13 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU
|
||||
const std::string url = getImageURL(te,uuid);
|
||||
if (!url.empty())
|
||||
{
|
||||
llinfos << "texture URL " << url << llendl;
|
||||
LL_DEBUGS("Avatar") << avString() << "from URL " << url << llendl;
|
||||
result = LLViewerTextureManager::getFetchedTextureFromUrl(
|
||||
url, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid);
|
||||
}
|
||||
else
|
||||
{
|
||||
llinfos << "get texture from host " << uuid << llendl;
|
||||
LL_DEBUGS("Avatar") << avString() << "from host " << uuid << llendl;
|
||||
LLHost host = getObjectHost();
|
||||
result = LLViewerTextureManager::getFetchedTexture(
|
||||
uuid, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host);
|
||||
@@ -2232,10 +2237,7 @@ S32 LLVOAvatar::setTETexture(const U8 te, const LLUUID& uuid)
|
||||
{
|
||||
if (!isIndexBakedTexture((ETextureIndex)te))
|
||||
{
|
||||
if (!uuid.isNull())
|
||||
{
|
||||
llinfos << "ignoring texture " << uuid << " in non-baked slot " << (S32)te << " - will use null " << llendl;
|
||||
}
|
||||
// Sim still sends some uuids for non-baked slots sometimes - ignore.
|
||||
return LLViewerObject::setTETexture(te, LLUUID::null);
|
||||
}
|
||||
|
||||
@@ -3567,7 +3569,7 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
|
||||
bool all_baked_downloaded = allBakedTexturesCompletelyDownloaded();
|
||||
bool all_local_downloaded = allLocalTexturesCompletelyDownloaded();
|
||||
std::string debug_line = llformat("%s%s - mLocal: %d, mEdit: %d, mUSB: %d, CBV: %d",
|
||||
all_local_downloaded ? "L" : "l",
|
||||
isSelf() ? (all_local_downloaded ? "L" : "l") : "-",
|
||||
all_baked_downloaded ? "B" : "b",
|
||||
mUseLocalAppearance, mIsEditingAppearance,
|
||||
mUseServerBakes, central_bake_version);
|
||||
@@ -4718,7 +4720,7 @@ U32 LLVOAvatar::renderImpostor(LLColor4U color, S32 diffuse_channel)
|
||||
return 6;
|
||||
}
|
||||
|
||||
bool LLVOAvatar::allTexturesCompletelyDownloaded(std::set<LLUUID>& ids)
|
||||
bool LLVOAvatar::allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const
|
||||
{
|
||||
for (std::set<LLUUID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
|
||||
{
|
||||
@@ -4731,14 +4733,14 @@ bool LLVOAvatar::allTexturesCompletelyDownloaded(std::set<LLUUID>& ids)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool LLVOAvatar::allLocalTexturesCompletelyDownloaded()
|
||||
bool LLVOAvatar::allLocalTexturesCompletelyDownloaded() const
|
||||
{
|
||||
std::set<LLUUID> local_ids;
|
||||
collectLocalTextureUUIDs(local_ids);
|
||||
return allTexturesCompletelyDownloaded(local_ids);
|
||||
}
|
||||
|
||||
bool LLVOAvatar::allBakedTexturesCompletelyDownloaded()
|
||||
bool LLVOAvatar::allBakedTexturesCompletelyDownloaded() const
|
||||
{
|
||||
std::set<LLUUID> baked_ids;
|
||||
collectBakedTextureUUIDs(baked_ids);
|
||||
@@ -4813,7 +4815,7 @@ S32 LLVOAvatar::totalTextureMemForUUIDS(std::set<LLUUID>& ids)
|
||||
return result;
|
||||
}
|
||||
|
||||
void LLVOAvatar::collectLocalTextureUUIDs(std::set<LLUUID>& ids)
|
||||
void LLVOAvatar::collectLocalTextureUUIDs(std::set<LLUUID>& ids) const
|
||||
{
|
||||
for (U32 texture_index = 0; texture_index < getNumTEs(); texture_index++)
|
||||
{
|
||||
@@ -4839,7 +4841,7 @@ void LLVOAvatar::collectLocalTextureUUIDs(std::set<LLUUID>& ids)
|
||||
ids.erase(IMG_INVISIBLE);
|
||||
}
|
||||
|
||||
void LLVOAvatar::collectBakedTextureUUIDs(std::set<LLUUID>& ids)
|
||||
void LLVOAvatar::collectBakedTextureUUIDs(std::set<LLUUID>& ids) const
|
||||
{
|
||||
for (U32 texture_index = 0; texture_index < getNumTEs(); texture_index++)
|
||||
{
|
||||
@@ -4875,15 +4877,15 @@ void LLVOAvatar::releaseOldTextures()
|
||||
|
||||
std::set<LLUUID> local_texture_ids;
|
||||
collectLocalTextureUUIDs(local_texture_ids);
|
||||
S32 new_local_mem = totalTextureMemForUUIDS(local_texture_ids);
|
||||
//S32 new_local_mem = totalTextureMemForUUIDS(local_texture_ids);
|
||||
|
||||
std::set<LLUUID> new_texture_ids;
|
||||
new_texture_ids.insert(baked_texture_ids.begin(),baked_texture_ids.end());
|
||||
new_texture_ids.insert(local_texture_ids.begin(),local_texture_ids.end());
|
||||
S32 new_total_mem = totalTextureMemForUUIDS(new_texture_ids);
|
||||
|
||||
S32 old_total_mem = totalTextureMemForUUIDS(mTextureIDs);
|
||||
LL_DEBUGS("Avatar") << getFullname() << " old_total_mem: " << old_total_mem << " new_total_mem (L/B): " << new_total_mem << " (" << new_local_mem <<", " << new_baked_mem << ")" << llendl;
|
||||
//S32 old_total_mem = totalTextureMemForUUIDS(mTextureIDs);
|
||||
//LL_DEBUGS("Avatar") << getFullname() << " old_total_mem: " << old_total_mem << " new_total_mem (L/B): " << new_total_mem << " (" << new_local_mem <<", " << new_baked_mem << ")" << llendl;
|
||||
if (!isSelf() && new_total_mem > new_baked_mem)
|
||||
{
|
||||
llwarns << "extra local textures stored for non-self av" << llendl;
|
||||
@@ -5165,6 +5167,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())
|
||||
{
|
||||
@@ -6836,41 +6839,48 @@ BOOL LLVOAvatar::getIsCloud() const
|
||||
|
||||
void LLVOAvatar::updateRezzedStatusTimers()
|
||||
{
|
||||
// State machine for rezzed status. Statuses are 0 = cloud, 1 = gray, 2 = textured.
|
||||
// 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;
|
||||
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)
|
||||
if (mLastRezzedStatus == -1 && rez_status != -1)
|
||||
{
|
||||
// start cloud timer.
|
||||
startPhase("cloud");
|
||||
// First time initialization, start all timers.
|
||||
for (S32 i = 1; i < 4; i++)
|
||||
{
|
||||
startPhase("load_" + LLVOAvatar::rezStatusToString(i));
|
||||
}
|
||||
}
|
||||
else if (was_cloud && !is_cloud)
|
||||
if (rez_status < mLastRezzedStatus)
|
||||
{
|
||||
// stop cloud timer, which will capture stats.
|
||||
stopPhase("cloud");
|
||||
// load level has decreased. start phase timers for higher load levels.
|
||||
for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++)
|
||||
{
|
||||
startPhase("load_" + LLVOAvatar::rezStatusToString(i));
|
||||
}
|
||||
}
|
||||
else if (rez_status > mLastRezzedStatus)
|
||||
{
|
||||
// load level has increased. stop phase timers for lower and equal load levels.
|
||||
for (S32 i = llmax(mLastRezzedStatus+1,1); i <= rez_status; i++)
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// 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");
|
||||
}
|
||||
|
||||
mLastRezzedStatus = rez_status;
|
||||
}
|
||||
}
|
||||
@@ -6882,9 +6892,50 @@ void LLVOAvatar::clearPhases()
|
||||
|
||||
void LLVOAvatar::startPhase(const std::string& phase_name)
|
||||
{
|
||||
F32 elapsed;
|
||||
bool completed;
|
||||
if (getPhases().getPhaseValues(phase_name, elapsed, completed))
|
||||
{
|
||||
if (!completed)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << avString() << "no-op, start when started already for " << phase_name << llendl;
|
||||
return;
|
||||
}
|
||||
}
|
||||
LL_DEBUGS("Avatar") << "started phase " << phase_name << llendl;
|
||||
getPhases().startPhase(phase_name);
|
||||
}
|
||||
|
||||
void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check)
|
||||
{
|
||||
F32 elapsed;
|
||||
bool completed;
|
||||
if (getPhases().getPhaseValues(phase_name, elapsed, completed))
|
||||
{
|
||||
if (!completed)
|
||||
{
|
||||
getPhases().stopPhase(phase_name);
|
||||
completed = true;
|
||||
logMetricsTimerRecord(phase_name, elapsed, completed);
|
||||
LL_DEBUGS("Avatar") << avString() << "stopped phase " << phase_name << " elapsed " << elapsed << llendl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (err_check)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "no-op, stop when stopped already for " << phase_name << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (err_check)
|
||||
{
|
||||
LL_DEBUGS("Avatar") << "no-op, stop when not started for " << phase_name << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLVOAvatar::logPendingPhases()
|
||||
{
|
||||
for (LLViewerStats::phase_map_t::iterator it = getPhases().begin();
|
||||
@@ -6900,10 +6951,6 @@ void LLVOAvatar::logPendingPhases()
|
||||
{
|
||||
logMetricsTimerRecord(phase_name, elapsed, completed);
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "ignoring " << phase_name << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6927,7 +6974,6 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse
|
||||
{
|
||||
LLSD record;
|
||||
record["timer_name"] = phase_name;
|
||||
record["agent_id"] = gAgent.getID();
|
||||
record["avatar_id"] = getID();
|
||||
record["elapsed"] = elapsed;
|
||||
record["completed"] = completed;
|
||||
@@ -6943,9 +6989,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())
|
||||
{
|
||||
@@ -6953,30 +7001,6 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse
|
||||
}
|
||||
}
|
||||
|
||||
void LLVOAvatar::stopPhase(const std::string& phase_name)
|
||||
{
|
||||
F32 elapsed;
|
||||
bool completed;
|
||||
if (getPhases().getPhaseValues(phase_name, elapsed, completed))
|
||||
{
|
||||
if (!completed)
|
||||
{
|
||||
getPhases().stopPhase(phase_name);
|
||||
completed = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "stop when stopped already for " << phase_name << llendl;
|
||||
}
|
||||
logMetricsTimerRecord(phase_name, elapsed, completed);
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "stop when not started for " << phase_name << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
// call periodically to keep isFullyLoaded up to date.
|
||||
// returns true if the value has changed.
|
||||
BOOL LLVOAvatar::updateIsFullyLoaded()
|
||||
@@ -7199,7 +7223,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);
|
||||
|
||||
Reference in New Issue
Block a user