summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-05-25 14:56:45 -0400
committerLoren Shih <seraph@lindenlab.com>2010-05-25 14:56:45 -0400
commit00d534d7a7a21798d50be047de62e9f2e7b6092a (patch)
treeb28e5bc53bd8d6b935b704c98b41672d88441307 /indra
parenta781dd767c095470897049b5ae1a91523214b39a (diff)
EXT-7480 Add debuga bility to set texture discard levels
Added TextureDiscardLevel override for specifying texture discard levels. Aesthetic change to add debug- flag to all avatar debug reporting metrics.
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/llappearancemgr.cpp4
-rw-r--r--indra/newview/lltexlayer.cpp2
-rw-r--r--indra/newview/llviewertexture.cpp6
-rw-r--r--indra/newview/llvoavatarself.cpp34
-rw-r--r--indra/newview/llvoavatarself.h18
-rw-r--r--indra/newview/llwearable.cpp2
7 files changed, 48 insertions, 29 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 1d27d00451..4dc4bec478 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9053,6 +9053,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>TextureDiscardLevel</key>
+ <map>
+ <key>Comment</key>
+ <string>Specify texture resolution (0 = highest, 5 = lowest)</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>U32</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>TextureLoadFullRes</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index dcef86a5fc..e481611ace 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -526,7 +526,7 @@ bool LLWearableHoldingPattern::pollMissingWearables()
if (done)
{
- gAgentAvatarp->wearablesLoaded();
+ gAgentAvatarp->debugWearablesLoaded();
clearCOFLinksForMissingWearables();
onAllComplete();
}
@@ -1667,7 +1667,7 @@ void LLAppearanceMgr::autopopulateOutfits()
// Handler for anything that's deferred until avatar de-clouds.
void LLAppearanceMgr::onFirstFullyVisible()
{
- gAgentAvatarp->avatarVisible();
+ gAgentAvatarp->debugAvatarVisible();
autopopulateOutfits();
}
diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp
index 337627cc79..4be03596f8 100644
--- a/indra/newview/lltexlayer.cpp
+++ b/indra/newview/lltexlayer.cpp
@@ -237,7 +237,7 @@ BOOL LLTexLayerSetBuffer::render()
{
if (mTexLayerSet->isVisible())
{
- mTexLayerSet->getAvatar()->bakedTextureUpload(mTexLayerSet->getBakedTexIndex(), FALSE); // FALSE for start of upload, TRUE for finish.
+ mTexLayerSet->getAvatar()->debugBakedTextureUpload(mTexLayerSet->getBakedTexIndex(), FALSE); // FALSE for start of upload, TRUE for finish.
readBackAndUpload();
}
else
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index d925ab0d90..d8a9ce9374 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1893,6 +1893,12 @@ bool LLViewerFetchedTexture::updateFetch()
h = mGLTexturep->getHeight(0);
c = mComponents;
}
+
+ const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
+ if (override_tex_discard_level != 0)
+ {
+ desired_discard = override_tex_discard_level;
+ }
// bypass texturefetch directly by pulling from LLTextureCache
bool fetch_request_created = false;
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index c82de73f25..cf3fb01b5a 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -157,14 +157,14 @@ void LLVOAvatarSelf::initInstance()
{
for (U32 j = 0; j <= MAX_DISCARD_LEVEL; ++j)
{
- mTextureLoadTimes[i][j] = -1.0f;
+ mDebugTextureLoadTimes[i][j] = -1.0f;
}
}
for (U32 i =0; i < LLVOAvatarDefines::BAKED_NUM_INDICES; ++i)
{
- mBakedTextureTimes[i][0] = -1.0f;
- mBakedTextureTimes[i][1] = -1.0f;
+ mDebugBakedTextureTimes[i][0] = -1.0f;
+ mDebugBakedTextureTimes[i][1] = -1.0f;
}
status &= buildMenus();
@@ -1271,6 +1271,8 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLTexLayerSet* layerset)
//-----------------------------------------------------------------------------
BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLTexLayerSet* layerset) const
{
+ const U32 override_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel");
+
for (U32 i = 0; i < mBakedTextureDatas.size(); i++)
{
if (layerset == mBakedTextureDatas[i].mTexLayerSet)
@@ -1285,7 +1287,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLTexLayerSet* layerset) cons
const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type);
for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++)
{
- if (getLocalDiscardLevel(*local_tex_iter, wearable_index) != 0)
+ if (getLocalDiscardLevel(*local_tex_iter, wearable_index) > (S32)(override_tex_discard_level))
{
return FALSE;
}
@@ -1761,12 +1763,12 @@ BOOL LLVOAvatarSelf::getIsCloud()
}
/*static*/
-void LLVOAvatarSelf::onTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
+void LLVOAvatarSelf::debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
- gAgentAvatarp->timingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
+ gAgentAvatarp->debugTimingLocalTexLoaded(success, src_vi, src, aux_src, discard_level, final, userdata);
}
-void LLVOAvatarSelf::timingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
+void LLVOAvatarSelf::debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata)
{
LLAvatarTexData *data = (LLAvatarTexData *)userdata;
if (!data)
@@ -1776,14 +1778,14 @@ void LLVOAvatarSelf::timingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *
ETextureIndex index = data->mIndex;
-if (index < 0 || index >= TEX_NUM_INDICES)
+ if (index < 0 || index >= TEX_NUM_INDICES)
{
return;
}
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] = mDebugSelfLoadTimer.getElapsedTimeF32();
+ mDebugTextureLoadTimes[(U32)index][(U32)discard_level] = mDebugSelfLoadTimer.getElapsedTimeF32();
}
if (final)
{
@@ -1791,14 +1793,14 @@ if (index < 0 || index >= TEX_NUM_INDICES)
}
}
-void LLVOAvatarSelf::bakedTextureUpload(EBakedTextureIndex index, BOOL finished)
+void LLVOAvatarSelf::debugBakedTextureUpload(EBakedTextureIndex index, BOOL finished)
{
U32 done = 0;
if (finished)
{
done = 1;
}
- mBakedTextureTimes[index][done] = mDebugSelfLoadTimer.getElapsedTimeF32();
+ mDebugBakedTextureTimes[index][done] = mDebugSelfLoadTimer.getElapsedTimeF32();
}
const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const
@@ -1963,7 +1965,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid )
const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(te);
if (texture_dict->mIsBakedTexture)
{
- bakedTextureUpload(texture_dict->mBakedTextureIndex, TRUE); // FALSE for start of upload, TRUE for finish.
+ debugBakedTextureUpload(texture_dict->mBakedTextureIndex, TRUE); // FALSE for start of upload, TRUE for finish.
llinfos << "New baked texture: " << texture_dict->mName << " UUID: " << uuid <<llendl;
}
else
@@ -1993,8 +1995,8 @@ 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 load wearables: " << (S32)mDebugTimeWearablesLoaded << llendl;
+ llinfos << "\t Time from avatar creation to de-cloud: " << (S32)mDebugTimeAvatarVisible << 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)
@@ -2005,7 +2007,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const
for (j=0; j <= MAX_DISCARD_LEVEL; j++)
{
out << "\t";
- S32 load_time = (S32)mTextureLoadTimes[i][j];
+ S32 load_time = (S32)mDebugTextureLoadTimes[i][j];
if (load_time == -1)
{
out << "*";
@@ -2025,7 +2027,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const
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;
+ llinfos << "\t\t (" << i << ") \t" << (S32)mDebugBakedTextureTimes[i][0] << " / " << (S32)mDebugBakedTextureTimes[i][1] << llendl;
}
}
diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h
index 666219f3aa..98addd42c1 100644
--- a/indra/newview/llvoavatarself.h
+++ b/indra/newview/llvoavatarself.h
@@ -124,8 +124,6 @@ public:
//--------------------------------------------------------------------
public:
/*virtual*/ BOOL getIsCloud();
- void bakedTextureUpload(LLVOAvatarDefines::EBakedTextureIndex index, BOOL finished);
- static void onTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
//--------------------------------------------------------------------
// Region state
@@ -348,16 +346,18 @@ public:
LLUUID mAvatarID;
LLVOAvatarDefines::ETextureIndex mIndex;
};
- void wearablesLoaded() { mTimeWearablesLoaded = mDebugSelfLoadTimer.getElapsedTimeF32(); }
- void avatarVisible() { mTimeAvatarVisible = mDebugSelfLoadTimer.getElapsedTimeF32(); }
+ void debugWearablesLoaded() { mDebugTimeWearablesLoaded = mDebugSelfLoadTimer.getElapsedTimeF32(); }
+ void debugAvatarVisible() { mDebugTimeAvatarVisible = mDebugSelfLoadTimer.getElapsedTimeF32(); }
void outputRezDiagnostics() const;
+ void debugBakedTextureUpload(LLVOAvatarDefines::EBakedTextureIndex index, BOOL finished);
+ static void debugOnTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
private:
LLFrameTimer mDebugSelfLoadTimer;
- F32 mTimeWearablesLoaded;
- F32 mTimeAvatarVisible;
- F32 mTextureLoadTimes[LLVOAvatarDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level
- F32 mBakedTextureTimes[LLVOAvatarDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture
- void timingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
+ F32 mDebugTimeWearablesLoaded;
+ F32 mDebugTimeAvatarVisible;
+ F32 mDebugTextureLoadTimes[LLVOAvatarDefines::TEX_NUM_INDICES][MAX_DISCARD_LEVEL+1]; // load time for each texture at each discard level
+ F32 mDebugBakedTextureTimes[LLVOAvatarDefines::BAKED_NUM_INDICES][2]; // time to start upload and finish upload of each baked texture
+ void debugTimingLocalTexLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata);
/** Diagnostics
** **
diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp
index 6c27aefebb..10b9a18fa8 100644
--- a/indra/newview/llwearable.cpp
+++ b/indra/newview/llwearable.cpp
@@ -442,7 +442,7 @@ BOOL LLWearable::importFile( LLFILE* file )
delete mSavedTEMap[te];
}
- image->setLoadedCallback(LLVOAvatarSelf::onTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te));
+ image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te));
LLUUID textureid(text_buffer);