From 0924e3397cf86a3e7e986da9aeb29e98baace35c Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 19 May 2010 13:54:37 -0400 Subject: AVP-72 FIXED Debug settings for gathering Welcome Island Rez time statistics Added outfit baking notification. Cleaned up some code around notifications. Added some more clarity to notification message wording. --- indra/newview/llvoavatarself.cpp | 87 ++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 35 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 8bf082ad45..f329ec83b0 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -49,12 +49,14 @@ #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llinventoryfunctions.h" +#include "llnotificationsutil.h" #include "llselectmgr.h" #include "lltoolgrab.h" // for needsRenderBeam #include "lltoolmgr.h" // for needsRenderBeam #include "lltoolmorph.h" #include "lltrans.h" #include "llviewercamera.h" +#include "llviewercontrol.h" #include "llviewermenu.h" #include "llviewerobjectlist.h" #include "llviewerstats.h" @@ -149,7 +151,7 @@ void LLVOAvatarSelf::initInstance() LLVOAvatar::initInstance(); llinfos << "Self avatar object created. Starting timer." << llendl; - mSelfLoadTimer.reset(); + mDebugSelfLoadTimer.reset(); // clear all times to -1 for debugging for (U32 i =0; i < LLVOAvatarDefines::TEX_NUM_INDICES; ++i) { @@ -1396,6 +1398,7 @@ void LLVOAvatarSelf::invalidateAll() { invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, TRUE); } + mDebugSelfLoadTimer.reset(); } //----------------------------------------------------------------------------- @@ -1780,7 +1783,7 @@ if (index < 0 || index >= TEX_NUM_INDICES) if (discard_level >=0 && discard_level <= MAX_DISCARD_LEVEL) // ignore discard level -1, as it means we have no data. { - mTextureLoadTimes[(U32)index][(U32)discard_level] = mSelfLoadTimer.getElapsedTimeF32(); + mTextureLoadTimes[(U32)index][(U32)discard_level] = mDebugSelfLoadTimer.getElapsedTimeF32(); } if (final) { @@ -1795,7 +1798,7 @@ void LLVOAvatarSelf::bakedTextureUpload(EBakedTextureIndex index, BOOL finished) { done = 1; } - mBakedTextureTimes[index][done] = mSelfLoadTimer.getElapsedTimeF32(); + mBakedTextureTimes[index][done] = mDebugSelfLoadTimer.getElapsedTimeF32(); } const LLUUID& LLVOAvatarSelf::grabLocalTexture(ETextureIndex type, U32 index) const @@ -1969,42 +1972,56 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) if (!hasPendingBakedUploads()) { gAgent.sendAgentSetAppearance(); - F32 final_time = mSelfLoadTimer.getElapsedTimeF32(); - llinfos << "REZTIME: Myself rez stats:" << llendl; - llinfos << "\t Time from avatar creation to load wearables: " << (S32)mTimeWearablesLoaded << llendl; - llinfos << "\t Time from avatar creation to de-cloud: " << (S32)mTimeAvatarVisible << llendl; - llinfos << "\t Time from avatar creation to de-cloud for others: " << (S32)final_time << llendl; - llinfos << "\t Load time for each texture: " << llendl; - for (U32 i = 0; i < LLVOAvatarDefines::TEX_NUM_INDICES; ++i) - { - std::stringstream out; - out << "\t\t (" << i << ") "; - U32 j=0; - for (j=0; j <= MAX_DISCARD_LEVEL; j++) - { - out << "\t"; - S32 load_time = (S32)mTextureLoadTimes[i][j]; - if (load_time == -1) - { - out << "*"; - if (j == 0) - break; - } - else - { - out << load_time; - } - } - // Don't print out non-existent textures. - if (j != 0) - llinfos << out.str() << llendl; + if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + { + LLSD args; + args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); + args["TIME"] = (U32)mDebugSelfLoadTimer.getElapsedTimeF32(); + LLNotificationsUtil::add("AvatarRezSelfNotification",args); } - llinfos << "\t Time points for each upload (start / finish)" << llendl; - for (U32 i = 0; i < LLVOAvatarDefines::BAKED_NUM_INDICES; ++i) + + outputRezDiagnostics(); + } +} + +void LLVOAvatarSelf::outputRezDiagnostics() const +{ + const F32 final_time = mDebugSelfLoadTimer.getElapsedTimeF32(); + llinfos << "REZTIME: Myself rez stats:" << llendl; + llinfos << "\t Time from avatar creation to load wearables: " << (S32)mTimeWearablesLoaded << llendl; + llinfos << "\t Time from avatar creation to de-cloud: " << (S32)mTimeAvatarVisible << llendl; + llinfos << "\t Time from avatar creation to de-cloud for others: " << (S32)final_time << llendl; + llinfos << "\t Load time for each texture: " << llendl; + for (U32 i = 0; i < LLVOAvatarDefines::TEX_NUM_INDICES; ++i) + { + std::stringstream out; + out << "\t\t (" << i << ") "; + U32 j=0; + for (j=0; j <= MAX_DISCARD_LEVEL; j++) { - llinfos << "\t\t (" << i << ") \t" << (S32)mBakedTextureTimes[i][0] << " / " << (S32)mBakedTextureTimes[i][1] << llendl; + out << "\t"; + S32 load_time = (S32)mTextureLoadTimes[i][j]; + if (load_time == -1) + { + out << "*"; + if (j == 0) + break; + } + else + { + out << load_time; + } } + + // Don't print out non-existent textures. + if (j != 0) + llinfos << out.str() << llendl; + } + llinfos << "\t Time points for each upload (start / finish)" << llendl; + for (U32 i = 0; i < LLVOAvatarDefines::BAKED_NUM_INDICES; ++i) + { + llinfos << "\t\t (" << i << ") \t" << (S32)mBakedTextureTimes[i][0] << " / " << (S32)mBakedTextureTimes[i][1] << llendl; } } -- cgit v1.2.3 From d43ac77d1b6d1952fe3369079f6461b124466b38 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 19 May 2010 13:56:39 -0400 Subject: AVP-72 FIXED Debug settings for gathering Welcome Island Rez time statistics Fix for ambiguity around LLSD usage. --- indra/newview/llvoavatarself.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f329ec83b0..da99b212f0 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1977,7 +1977,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) { LLSD args; args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = (U32)mDebugSelfLoadTimer.getElapsedTimeF32(); + args["TIME"] = llformat("%d",(U32)mDebugSelfLoadTimer.getElapsedTimeF32()); LLNotificationsUtil::add("AvatarRezSelfNotification",args); } -- cgit v1.2.3 From 8487341b0f255e65044c3f7e3dc09461b4e2351e Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 19 May 2010 19:48:23 -0400 Subject: AVP-44 WIP Back-end support for multiwearables Changed a lot of areas of code that were not dealing with multiwearables properly. Little functionality changed, as the support mechanisms that were out of date were subtle, but getting closer to no further areas of code that don't properly support multi-wearables. Code reviewed by Vir. --- indra/newview/llvoavatarself.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 8bf082ad45..ac7adebb3a 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1798,21 +1798,31 @@ void LLVOAvatarSelf::bakedTextureUpload(EBakedTextureIndex index, BOOL finished) mBakedTextureTimes[index][done] = mSelfLoadTimer.getElapsedTimeF32(); } -const LLUUID& LLVOAvatarSelf::grabLocalTexture(ETextureIndex type, U32 index) const +const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const { - if (canGrabLocalTexture(type, index)) + if (canGrabBakedTexture(baked_index)) { - return getTEImage( type )->getID(); + ETextureIndex tex_index = LLVOAvatarDictionary::bakedToLocalTextureIndex(baked_index); + if (tex_index == TEX_NUM_INDICES) + { + return LLUUID::null; + } + return getTEImage( tex_index )->getID(); } return LLUUID::null; } -BOOL LLVOAvatarSelf::canGrabLocalTexture(ETextureIndex type, U32 index) const +BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const { + ETextureIndex tex_index = LLVOAvatarDictionary::bakedToLocalTextureIndex(baked_index); + if (tex_index == TEX_NUM_INDICES) + { + return FALSE; + } // Check if the texture hasn't been baked yet. - if (!isTextureDefined(type, index)) + if (!isTextureDefined(tex_index, 0)) { - lldebugs << "getTEImage( " << (U32) type << ", " << index << " )->getID() == IMG_DEFAULT_AVATAR" << llendl; + lldebugs << "getTEImage( " << (U32) tex_index << " )->getID() == IMG_DEFAULT_AVATAR" << llendl; return FALSE; } @@ -1822,13 +1832,7 @@ BOOL LLVOAvatarSelf::canGrabLocalTexture(ETextureIndex type, U32 index) const // Check permissions of textures that show up in the // baked texture. We don't want people copying people's // work via baked textures. - /* switch(type) - case TEX_EYES_BAKED: - textures.push_back(TEX_EYES_IRIS); */ - const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(type); - if (!texture_dict->mIsUsedByBakedTexture) return FALSE; - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index); for (texture_vec_t::const_iterator iter = baked_dict->mLocalTextures.begin(); iter != baked_dict->mLocalTextures.end(); -- cgit v1.2.3