From 00d534d7a7a21798d50be047de62e9f2e7b6092a Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 25 May 2010 14:56:45 -0400 Subject: 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. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappearancemgr.cpp | 4 ++-- indra/newview/lltexlayer.cpp | 2 +- indra/newview/llviewertexture.cpp | 6 ++++++ indra/newview/llvoavatarself.cpp | 34 +++++++++++++++++---------------- indra/newview/llvoavatarself.h | 18 ++++++++--------- indra/newview/llwearable.cpp | 2 +- 7 files changed, 48 insertions(+), 29 deletions(-) (limited to 'indra/newview') 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 @@ Value 0 + TextureDiscardLevel + + Comment + Specify texture resolution (0 = highest, 5 = lowest) + Persist + 1 + Type + U32 + Value + 0 + TextureLoadFullRes Comment 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 <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); -- cgit v1.2.3