summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Payne (Vir Linden) <vir@lindenlab.com>2012-12-20 10:27:18 -0500
committerBrad Payne (Vir Linden) <vir@lindenlab.com>2012-12-20 10:27:18 -0500
commitcbf24c55d511b2390fdc4c12698682531f26f41b (patch)
treea78771e2c383507bdccd58ceed5bc82220a3b4c8
parent42496cd672436cc4d32f5546fd04294931b8f0b6 (diff)
SH-3344 WIP - additional debugging output for avatar local textures
-rw-r--r--indra/llrender/llgltexture.h19
-rwxr-xr-xindra/newview/llviewertexture.cpp1
-rwxr-xr-xindra/newview/llviewertexture.h2
-rwxr-xr-xindra/newview/llvoavatar.cpp4
-rwxr-xr-xindra/newview/llvoavatarself.cpp85
-rwxr-xr-xindra/newview/llvoavatarself.h1
6 files changed, 103 insertions, 9 deletions
diff --git a/indra/llrender/llgltexture.h b/indra/llrender/llgltexture.h
index b1efe77519..e69b322d60 100644
--- a/indra/llrender/llgltexture.h
+++ b/indra/llrender/llgltexture.h
@@ -79,6 +79,15 @@ public:
MAX_GL_IMAGE_CATEGORY
};
+ typedef enum
+ {
+ DELETED = 0, //removed from memory
+ DELETION_CANDIDATE, //ready to be removed from memory
+ INACTIVE, //not be used for the last certain period (i.e., 30 seconds).
+ ACTIVE, //just being used, can become inactive if not being used for a certain time (10 seconds).
+ NO_DELETE = 99 //stay in memory, can not be removed.
+ } LLGLTextureState;
+
static S32 getTotalNumOfCategories() ;
static S32 getIndexFromCategory(S32 category) ;
static S32 getCategoryFromIndex(S32 index) ;
@@ -143,6 +152,8 @@ public:
U32 getTexelsInGLTexture() const ;
BOOL isGLTextureCreated() const ;
S32 getDiscardLevelInAtlas() const ;
+ LLGLTextureState getTextureState() const { return mTextureState; }
+
//---------------------------------------------------------------------------------------------
//end of functions to access LLImageGL
//---------------------------------------------------------------------------------------------
@@ -179,14 +190,6 @@ protected:
S8 mDontDiscard; // Keep full res version of this image (for UI, etc)
protected:
- typedef enum
- {
- DELETED = 0, //removed from memory
- DELETION_CANDIDATE, //ready to be removed from memory
- INACTIVE, //not be used for the last certain period (i.e., 30 seconds).
- ACTIVE, //just being used, can become inactive if not being used for a certain time (10 seconds).
- NO_DELETE = 99 //stay in memory, can not be removed.
- } LLGLTextureState;
LLGLTextureState mTextureState ;
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 846216211e..a673862882 100755
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -616,6 +616,7 @@ LLViewerTexture::LLViewerTexture(const LLImageRaw* raw, BOOL usemipmaps) :
LLViewerTexture::~LLViewerTexture()
{
+ // LL_DEBUGS("Avatar") << mID << llendl;
cleanup();
sImageCount--;
}
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 3df942d922..ba6beec883 100755
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -134,6 +134,7 @@ public:
void resetTextureStats();
void setMaxVirtualSizeResetInterval(S32 interval)const {mMaxVirtualSizeResetInterval = interval;}
void resetMaxVirtualSizeResetCounter()const {mMaxVirtualSizeResetCounter = mMaxVirtualSizeResetInterval;}
+ S32 getMaxVirtualSizeResetCounter() const { return mMaxVirtualSizeResetCounter; }
virtual F32 getMaxVirtualSize() ;
@@ -306,6 +307,7 @@ public:
// the priority list, and cause horrible things to happen.
void setDecodePriority(F32 priority = -1.0f);
F32 getDecodePriority() const { return mDecodePriority; };
+ F32 getAdditionalDecodePriority() const { return mAdditionalDecodePriority; };
void setAdditionalDecodePriority(F32 priority) ;
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 117f28cc36..086e4306f8 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5811,6 +5811,7 @@ void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
// virtual
void LLVOAvatar::updateMeshTextures()
{
+ static S32 update_counter = 0;
mBakedTextureDebugText.clear();
// if user has never specified a texture, assign the default
@@ -5840,7 +5841,8 @@ void LLVOAvatar::updateMeshTextures()
std::vector<BOOL> use_lkg_baked_layer; // lkg = "last known good"
use_lkg_baked_layer.resize(mBakedTextureDatas.size(), false);
- mBakedTextureDebugText += "indx layerset linvld ltda ilb ulkg ltid\n";
+ mBakedTextureDebugText += llformat("%06d\n",update_counter++);
+ mBakedTextureDebugText += "indx layerset linvld ltda ilb ulkg ltid\n";
for (U32 i=0; i < mBakedTextureDatas.size(); i++)
{
is_layer_baked[i] = isTextureDefined(mBakedTextureDatas[i].mTextureIndex);
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 77deb5e3bc..674988d94b 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -176,6 +176,17 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id,
lldebugs << "Marking avatar as self " << id << llendl;
}
+// Called periodically for diagnostics, return true when done.
+bool output_texture_diagnostics()
+{
+ if (!isAgentAvatarValid())
+ return true; // done checking
+
+ gAgentAvatarp->outputRezDiagnostics();
+
+ return false;
+}
+
void LLVOAvatarSelf::initInstance()
{
BOOL status = TRUE;
@@ -209,6 +220,8 @@ void LLVOAvatarSelf::initInstance()
llerrs << "Unable to load user's avatar" << llendl;
return;
}
+
+ //doPeriodically(output_texture_diagnostics, 30.0);
}
// virtual
@@ -2008,6 +2021,64 @@ void LLVOAvatarSelf::debugBakedTextureUpload(EBakedTextureIndex index, BOOL fini
mDebugBakedTextureTimes[index][done] = mDebugSelfLoadTimer.getElapsedTimeF32();
}
+const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const
+{
+ std::ostringstream outbuf;
+ for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter =
+ LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
+ baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
+ ++baked_iter)
+ {
+ const EBakedTextureIndex baked_index = baked_iter->first;
+ if (layerset == mBakedTextureDatas[baked_index].mTexLayerSet)
+ {
+ outbuf << "baked_index: " << baked_index << "\n";
+ const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second;
+ for (texture_vec_t::const_iterator local_tex_iter = baked_dict->mLocalTextures.begin();
+ local_tex_iter != baked_dict->mLocalTextures.end();
+ ++local_tex_iter)
+ {
+ const ETextureIndex tex_index = *local_tex_iter;
+ outbuf << " tex_index " << (S32) tex_index << "\n";
+ const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(tex_index);
+ const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type);
+ if (wearable_count > 0)
+ {
+ for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++)
+ {
+ outbuf << " " << LLWearableType::getTypeName(wearable_type) << " " << wearable_index << "\n";
+ const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(tex_index, wearable_index);
+ if (local_tex_obj)
+ {
+ LLViewerFetchedTexture* image = dynamic_cast<LLViewerFetchedTexture*>( local_tex_obj->getImage() );
+ if (tex_index >= 0
+ && local_tex_obj->getID() != IMG_DEFAULT_AVATAR
+ && !image->isMissingAsset())
+ {
+ outbuf << " id: " << image->getID()
+ << " refs: " << image->getNumRefs()
+ << " glocdisc: " << getLocalDiscardLevel(tex_index, wearable_index)
+ << " discard: " << image->getDiscardLevel()
+ << " desired: " << image->getDesiredDiscardLevel()
+ << " decode: " << image->getDecodePriority()
+ << " addl: " << image->getAdditionalDecodePriority()
+ << " ts: " << image->getTextureState()
+ << " bl: " << image->getBoostLevel()
+ << " fl: " << image->isFullyLoaded() // this is not an accessor for mFullyLoaded - see comment there.
+ << " mvs: " << image->getMaxVirtualSize()
+ << " mvsc: " << image->getMaxVirtualSizeResetCounter()
+ << "\n";
+ }
+ }
+ }
+ }
+ }
+ break;
+ }
+ }
+ return outbuf.str();
+}
+
const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const
{
std::string text="";
@@ -2282,6 +2353,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe
F32 desired_pixels;
desired_pixels = llmin(mPixelArea, (F32)getTexImageArea());
+ // DRANO what priority should wearable-based textures have?
if (isUsingLocalAppearance())
{
imagep->setBoostLevel(getAvatarBoostLevel());
@@ -2466,6 +2538,19 @@ void LLVOAvatarSelf::outputRezDiagnostics() const
if (!layerset_buffer) continue;
LL_DEBUGS("Avatar") << layerset_buffer->dumpTextureInfo() << llendl;
}
+ std::string vd_text = "Local textures per baked index and wearable:\n";
+ for (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin();
+ baked_iter != LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end();
+ ++baked_iter)
+ {
+ const LLAvatarAppearanceDefines::EBakedTextureIndex baked_index = baked_iter->first;
+ const LLViewerTexLayerSet *layerset = debugGetLayerSet(baked_index);
+ if (!layerset) continue;
+ const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite();
+ if (!layerset_buffer) continue;
+ vd_text += verboseDebugDumpLocalTextureDataInfo(layerset);
+ }
+ LL_DEBUGS("Avatar") << vd_text << llendl;
}
void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index eeac5ddaeb..02612b83da 100755
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -390,6 +390,7 @@ public:
BOOL isAllLocalTextureDataFinal() const;
const LLViewerTexLayerSet* debugGetLayerSet(LLAvatarAppearanceDefines::EBakedTextureIndex index) const { return (LLViewerTexLayerSet*)(mBakedTextureDatas[index].mTexLayerSet); }
+ const std::string verboseDebugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer
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
LLSD metricsData();