From 14fef9f08a3bfb44d94771be6478a57ed9a91540 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 28 Jun 2012 11:05:32 -0400 Subject: SH-3230 Disable texture readback & upload If we're utilizing server-side texture baking, upload requests are discarded. Note: this breaks viewer in that it will *always* use the baked textures sent by the cache request/ initial login. Without a server-generated update, you will see those textures on your avatar for the entire session, even if you switch outfits. --- indra/newview/llvoavatarself.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0bfd0df769..ee3381a5ad 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -887,7 +887,10 @@ void LLVOAvatarSelf::removeMissingBakedTextures() invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, FALSE); } updateMeshTextures(); - requestLayerSetUploads(); + if (!LLAppearanceMgr::instance().useServerTextureBaking()) + { + requestLayerSetUploads(); + } } } @@ -1630,7 +1633,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r layerset->requestUpdate(); layerset->invalidateMorphMasks(); - if( upload_result ) + if( upload_result && !LLAppearanceMgr::instance().useServerTextureBaking()) { llassert(isSelf()); -- cgit v1.2.3 From e4a0dda457039b1a04c74024d9fbcf02e071b13d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 28 Jun 2012 14:24:04 -0400 Subject: SH-3228 WIP - always respond to processAppearance for self, convert baked textures to checkerboards --- 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 0bfd0df769..585a116acb 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -814,7 +814,7 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, updateMeshTextures(); // unpack the texture UUIDs to the texture slots - retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, block_num); + retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, (S32) block_num); // need to trigger a few operations to get the avatar to use the new bakes for (U32 i = 0; i < mBakedTextureDatas.size(); i++) -- cgit v1.2.3 From 64ad1aba304c50173195e15477c1882c5b6e7d37 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 11 Jul 2012 18:30:39 -0400 Subject: SH-3258 WIP initial work: refactoring appearance editing mode Added flags for appearance editing status as well as which textures we should be using at a time. Also refactored so we are not using camera state to track appearance editing mode. Need to add more handling for which textures we actually use. --- indra/newview/llvoavatarself.cpp | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ecc616fa67..5355651692 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2705,19 +2705,38 @@ LLTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) const // static -void LLVOAvatarSelf::onCustomizeStart() +void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) { - // We're no longer doing any baking or invalidating on entering - // appearance editing mode. Leaving function in place in case - // further changes require us to do something at this point - Nyx + if (isAgentAvatarValid()) + { + gAgentAvatarp->mIsEditingAppearance = true; + gAgentAvatarp->mUseLocalAppearance = true; + + if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch) + { + gAgentCamera.changeCameraToCustomizeAvatar(); + } + + gAgentAvatarp->invalidateAll(); + gAgentAvatarp->updateMeshTextures(); + } } // static -void LLVOAvatarSelf::onCustomizeEnd() +void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) { + gAgentAvatarp->mIsEditingAppearance = false; if (isAgentAvatarValid()) { gAgentAvatarp->invalidateAll(); + + if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch) + { + gAgentCamera.changeCameraToDefault(); + gAgentCamera.resetView(); + } + + LLAppearanceMgr::instance().updateAppearanceFromCOF(); } } -- cgit v1.2.3 From 3679631887f0acec0b0d180525a56d318692a0e2 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 16 Jul 2012 17:29:01 -0400 Subject: SH-3261 WIP Updated texture switching code Updated texture switching code to use the proper request URL, even if reverting to a "last known good" baked texture UUID. Viewer should now switch to a locally-generated composite on entering appearance mode, and should remain using such until a new appearance message is received. Still to do: handling adjacent regions with varying support for the new system, fixing switch back to server-generated bakes. --- indra/newview/llvoavatarself.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 5355651692..e715a0d2f1 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2726,6 +2726,11 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) { gAgentAvatarp->mIsEditingAppearance = false; + if (!LLAppearanceMgr::instance().useServerTextureBaking()) + { + gAgentAvatarp->mUseLocalAppearance = false; + } + if (isAgentAvatarValid()) { gAgentAvatarp->invalidateAll(); -- cgit v1.2.3 From e7a63cb356d49925131edfadb5a0e8d5368a9096 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 14 Aug 2012 17:12:01 -0400 Subject: SH-3310 WIP setting up architecture for switching texture baking on per-region basis Set up an architecture to minimize the use of the baked texture debug setting. Instead concentrating on setting a per-region flag at the region handshake point. This should be processed once the new regions are using the updated handshake. The debug setting is being used in this one location as a placeholder. Builds, but not fully tested/commented yet, passing this work off to Vir. --- indra/newview/llvoavatarself.cpp | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e715a0d2f1..c5eb96e740 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -887,7 +887,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures() invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, FALSE); } updateMeshTextures(); - if (!LLAppearanceMgr::instance().useServerTextureBaking()) + if (getRegion() && !getRegion()->getCentralBakeVersion()) { requestLayerSetUploads(); } @@ -1633,7 +1633,7 @@ void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_r layerset->requestUpdate(); layerset->invalidateMorphMasks(); - if( upload_result && !LLAppearanceMgr::instance().useServerTextureBaking()) + if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion())) { llassert(isSelf()); @@ -2616,15 +2616,6 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) } } -BOOL LLVOAvatarSelf::isUsingBakedTextures() const -{ - // Composite textures are used during appearance mode. - if (gAgentCamera.cameraCustomizeAvatar()) - return FALSE; - - return TRUE; -} - void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) { @@ -2725,14 +2716,15 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) // static void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) { - gAgentAvatarp->mIsEditingAppearance = false; - if (!LLAppearanceMgr::instance().useServerTextureBaking()) - { - gAgentAvatarp->mUseLocalAppearance = false; - } if (isAgentAvatarValid()) { + gAgentAvatarp->mIsEditingAppearance = false; + if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion()) + { + gAgentAvatarp->mUseLocalAppearance = false; + } + gAgentAvatarp->invalidateAll(); if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch) -- cgit v1.2.3 From 6e2739b76c669275b9ad62aa1b888cfc891012eb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 22 Aug 2012 16:16:54 -0400 Subject: SH-3625 - some associated cleanup, do_update field is useless in various calls because of possible race conditions --- 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 3604a373ad..6c8cbc37f7 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1296,7 +1296,7 @@ BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) const LLViewerObject *attached_obj = gAgentAvatarp->getWornAttachment(item_id); if (!attached_obj) { - LLAppearanceMgr::instance().removeCOFItemLinks(item_id, false); + LLAppearanceMgr::instance().removeCOFItemLinks(item_id); } } return TRUE; -- cgit v1.2.3 From c355fb98d3f4040196b7b8586dc9328fccb906d2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 06:12:50 +0000 Subject: Extracted texture baking system into llappearance library. --- indra/newview/llvoavatarself.cpp | 65 +++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 31 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 3604a373ad..0fcf43a501 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -55,6 +55,8 @@ #include "llviewerobjectlist.h" #include "llviewerstats.h" #include "llviewerregion.h" +#include "llviewertexlayer.h" +#include "llviewerwearable.h" #include "llappearancemgr.h" #include "llmeshrepository.h" #include "llvovolume.h" @@ -595,7 +597,7 @@ BOOL LLVOAvatarSelf::loadLayersets() { // Construct a layerset for each one specified in avatar_lad.xml and initialize it as such. const LLTexLayerSetInfo *info = *iter; - LLTexLayerSet* layer_set = new LLTexLayerSet( this ); + LLViewerTexLayerSet* layer_set = new LLViewerTexLayerSet( this ); if (!layer_set->setInfo(info)) { @@ -734,7 +736,7 @@ BOOL LLVOAvatarSelf::setParamWeight(LLViewerVisualParam *param, F32 weight, BOOL U32 size = gAgentWearables.getWearableCount(type); for (U32 count = 0; count < size; ++count) { - LLWearable *wearable = gAgentWearables.getWearable(type,count); + LLViewerWearable *wearable = gAgentWearables.getWearable(type,count); if (wearable) { wearable->setVisualParamWeight(param->getID(), weight, upload_bake); @@ -760,7 +762,7 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation() // apply wearable visual params to avatar for (U32 type = 0; type < LLWearableType::WT_COUNT; type++) { - LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type); + LLViewerWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type); if (wearable) { wearable->writeToAvatar(); @@ -1375,7 +1377,7 @@ BOOL LLVOAvatarSelf::getLocalTextureGL(ETextureIndex type, LLViewerTexture** tex { return FALSE; } - *tex_pp = local_tex_obj->getImage(); + *tex_pp = dynamic_cast (local_tex_obj->getImage()); return TRUE; } @@ -1395,7 +1397,7 @@ LLViewerFetchedTexture* LLVOAvatarSelf::getLocalTextureGL(LLVOAvatarDefines::ETe { return LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR); } - return local_tex_obj->getImage(); + return dynamic_cast (local_tex_obj->getImage()); } const LLUUID& LLVOAvatarSelf::getLocalTextureID(ETextureIndex type, U32 index) const @@ -1416,7 +1418,7 @@ const LLUUID& LLVOAvatarSelf::getLocalTextureID(ETextureIndex type, U32 index) c // Returns true if at least the lowest quality discard level exists for every texture // in the layerset. //----------------------------------------------------------------------------- -BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLTexLayerSet* layerset) const +BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* layerset) const { /* if (layerset == mBakedTextureDatas[BAKED_HEAD].mTexLayerSet) return getLocalDiscardLevel(TEX_HEAD_BODYPAINT) >= 0; */ @@ -1454,7 +1456,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLTexLayerSet* layerset) // Returns true if the highest quality discard level exists for every texture // in the layerset. //----------------------------------------------------------------------------- -BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLTexLayerSet* layerset) const +BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset) const { const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); // const U32 desired_tex_discard_level = 0; // hack to not bake textures on lower discard levels. @@ -1515,7 +1517,7 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLVOAvatarDefines::EBakedTextureIndex index) const { - const LLTexLayerSet *layerset = mBakedTextureDatas[index].mTexLayerSet; + const LLViewerTexLayerSet *layerset = mBakedTextureDatas[index].mTexLayerSet; if (!layerset) return FALSE; const LLTexLayerSetBuffer *layerset_buffer = layerset->getComposite(); if (!layerset_buffer) return FALSE; @@ -1568,7 +1570,7 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 } //virtual -BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const +BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLViewerWearable *wearable) const { if (isIndexBakedTexture(type)) { @@ -1611,7 +1613,7 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - LLTexLayerSet* layerset = mBakedTextureDatas[i].mTexLayerSet; + LLViewerTexLayerSet* layerset = mBakedTextureDatas[i].mTexLayerSet; if (layerset && layerset->getComposite() && layerset->getComposite()->uploadPending()) { return true; @@ -1620,7 +1622,7 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const return false; } -void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result ) +void LLVOAvatarSelf::invalidateComposite( LLViewerTexLayerSet* layerset, BOOL upload_result ) { if( !layerset || !layerset->getUpdatesEnabled() ) { @@ -1712,11 +1714,12 @@ S32 LLVOAvatarSelf::getLocalDiscardLevel(ETextureIndex type, U32 wearable_index) const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(type, wearable_index); if (local_tex_obj) { + const LLViewerFetchedTexture* image = dynamic_cast( local_tex_obj->getImage() ); if (type >= 0 && local_tex_obj->getID() != IMG_DEFAULT_AVATAR - && !local_tex_obj->getImage()->isMissingAsset()) + && !image->isMissingAsset()) { - return local_tex_obj->getImage()->getDiscardLevel(); + return image->getDiscardLevel(); } else { @@ -1741,7 +1744,7 @@ void LLVOAvatarSelf::getLocalTextureByteCount(S32* gl_bytes) const const LLLocalTextureObject *local_tex_obj = getLocalTextureObject((ETextureIndex) type, num); if (local_tex_obj) { - const LLViewerFetchedTexture* image_gl = local_tex_obj->getImage(); + const LLViewerFetchedTexture* image_gl = dynamic_cast( local_tex_obj->getImage() ); if (image_gl) { S32 bytes = (S32)image_gl->getWidth() * image_gl->getHeight() * image_gl->getComponents(); @@ -1790,7 +1793,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te return; } - LLTexLayerSet *layer_set = getLayerSet(type); + LLViewerTexLayerSet *layer_set = getLayerSet(type); if (layer_set) { layer_set->cloneTemplates(local_tex_obj, type, gAgentWearables.getWearable(wearable_type,index)); @@ -1814,15 +1817,15 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te if (isSelf()) { if (gAgentAvatarp->isUsingBakedTextures()) - { - requestLayerSetUpdate(type); - } + { + requestLayerSetUpdate(type); + } else - { - LLVisualParamHint::requestHintUpdates(); + { + LLVisualParamHint::requestHintUpdates(); + } } } - } else { tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, TRUE, FALSE, new LLAvatarTexData(getID(), type), NULL); @@ -1887,7 +1890,7 @@ void LLVOAvatarSelf::dumpLocalTextures() const } else { - const LLViewerFetchedTexture* image = local_tex_obj->getImage(); + const LLViewerFetchedTexture* image = dynamic_cast( local_tex_obj->getImage() ); llinfos << "LocTex " << name << ": " << "Discard " << image->getDiscardLevel() << ", " @@ -2060,7 +2063,7 @@ void LLVOAvatarSelf::debugBakedTextureUpload(EBakedTextureIndex index, BOOL fini mDebugBakedTextureTimes[index][done] = mDebugSelfLoadTimer.getElapsedTimeF32(); } -const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLTexLayerSet* layerset) const +const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const { std::string text=""; @@ -2283,7 +2286,7 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const for (U32 wearable_index = 0; wearable_index < count; ++wearable_index) { - LLWearable *wearable = gAgentWearables.getWearable(wearable_type, wearable_index); + LLViewerWearable *wearable = gAgentWearables.getWearable(wearable_type, wearable_index); if (wearable) { const LLLocalTextureObject *texture = wearable->getLocalTextureObject((S32)t_index); @@ -2358,7 +2361,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe LLLocalTextureObject* LLVOAvatarSelf::getLocalTextureObject(LLVOAvatarDefines::ETextureIndex i, U32 wearable_index) const { LLWearableType::EType type = LLVOAvatarDictionary::getInstance()->getTEWearableType(i); - LLWearable* wearable = gAgentWearables.getWearable(type, wearable_index); + LLViewerWearable* wearable = gAgentWearables.getWearable(type, wearable_index); if (wearable) { return wearable->getLocalTextureObject(i); @@ -2371,7 +2374,7 @@ LLLocalTextureObject* LLVOAvatarSelf::getLocalTextureObject(LLVOAvatarDefines::E // getBakedTE() // Used by the LayerSet. (Layer sets don't in general know what textures depend on them.) //----------------------------------------------------------------------------- -ETextureIndex LLVOAvatarSelf::getBakedTE( const LLTexLayerSet* layerset ) const +ETextureIndex LLVOAvatarSelf::getBakedTE( const LLViewerTexLayerSet* layerset ) const { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { @@ -2512,7 +2515,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const ++baked_iter) { const LLVOAvatarDefines::EBakedTextureIndex baked_index = baked_iter->first; - const LLTexLayerSet *layerset = debugGetLayerSet(baked_index); + const LLViewerTexLayerSet *layerset = debugGetLayerSet(baked_index); if (!layerset) continue; const LLTexLayerSetBuffer *layerset_buffer = layerset->getComposite(); if (!layerset_buffer) continue; @@ -2590,7 +2593,7 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) { if (texture_id == gAgentAvatarp->getTEImage(index)->getID()) { - LLTexLayerSet* layer_set = gAgentAvatarp->getLayerSet(index); + LLViewerTexLayerSet* layer_set = gAgentAvatarp->getLayerSet(index); if (layer_set) { llinfos << "TAT: rebake - matched entry " << (S32)index << llendl; @@ -2622,7 +2625,7 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug) for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { ETextureIndex baked_index = mBakedTextureDatas[i].mTextureIndex; - LLTexLayerSet* layer_set = getLayerSet(baked_index); + LLViewerTexLayerSet* layer_set = getLayerSet(baked_index); if (layer_set) { if (slam_for_debug) @@ -2664,7 +2667,7 @@ void LLVOAvatarSelf::requestLayerSetUpdate(ETextureIndex index ) } } -LLTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const +LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const { /* switch(index) case TEX_HEAD_BAKED: @@ -2679,7 +2682,7 @@ LLTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const return NULL; } -LLTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) const +LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) const { /* switch(index) case TEX_HEAD_BAKED: -- cgit v1.2.3 From 21c364c4d455cc05ec176032e8c090be0cc4ed50 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Mon, 3 Sep 2012 09:10:24 +0000 Subject: Renamed LLVOAvatarDefines to LLAvatarAppearanceDefines --- indra/newview/llvoavatarself.cpp | 132 +++++++++++++++++++-------------------- 1 file changed, 66 insertions(+), 66 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0fcf43a501..b300cfc71c 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -112,7 +112,7 @@ void selfStopAllPhases() } } -using namespace LLVOAvatarDefines; +using namespace LLAvatarAppearanceDefines; /********************************************************************************* ** ** @@ -190,7 +190,7 @@ void LLVOAvatarSelf::initInstance() llinfos << "Self avatar object created. Starting timer." << llendl; mDebugSelfLoadTimer.reset(); // clear all times to -1 for debugging - for (U32 i =0; i < LLVOAvatarDefines::TEX_NUM_INDICES; ++i) + for (U32 i =0; i < LLAvatarAppearanceDefines::TEX_NUM_INDICES; ++i) { for (U32 j = 0; j <= MAX_DISCARD_LEVEL; ++j) { @@ -198,7 +198,7 @@ void LLVOAvatarSelf::initInstance() } } - for (U32 i =0; i < LLVOAvatarDefines::BAKED_NUM_INDICES; ++i) + for (U32 i =0; i < LLAvatarAppearanceDefines::BAKED_NUM_INDICES; ++i) { mDebugBakedTextureTimes[i][0] = -1.0f; mDebugBakedTextureTimes[i][1] = -1.0f; @@ -609,11 +609,11 @@ BOOL LLVOAvatarSelf::loadLayersets() // scan baked textures and associate the layerset with the appropriate one EBakedTextureIndex baked_index = BAKED_NUM_INDICES; - for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin(); + baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end(); ++baked_iter) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second; if (layer_set->isBodyRegion(baked_dict->mName)) { baked_index = baked_iter->first; @@ -819,7 +819,7 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, // need to trigger a few operations to get the avatar to use the new bakes for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - const LLVOAvatarDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex; + const LLAvatarAppearanceDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex; LLUUID texture_id = getTEImage(te)->getID(); setNewBakedTexture(te, texture_id); mInitialBakeIDs[i] = texture_id; @@ -1074,16 +1074,16 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) //----------------------------------------------------------------------------- void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_result ) { - for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin(); + baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end(); ++baked_iter) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; - const LLVOAvatarDefines::EBakedTextureIndex index = baked_iter->first; + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second; + const LLAvatarAppearanceDefines::EBakedTextureIndex index = baked_iter->first; if (baked_dict) { - for (LLVOAvatarDefines::wearables_vec_t::const_iterator type_iter = baked_dict->mWearables.begin(); + for (LLAvatarAppearanceDefines::wearables_vec_t::const_iterator type_iter = baked_dict->mWearables.begin(); type_iter != baked_dict->mWearables.end(); ++type_iter) { @@ -1306,9 +1306,9 @@ BOOL LLVOAvatarSelf::detachAttachmentIntoInventory(const LLUUID &item_id) return FALSE; } -U32 LLVOAvatarSelf::getNumWearables(LLVOAvatarDefines::ETextureIndex i) const +U32 LLVOAvatarSelf::getNumWearables(LLAvatarAppearanceDefines::ETextureIndex i) const { - LLWearableType::EType type = LLVOAvatarDictionary::getInstance()->getTEWearableType(i); + LLWearableType::EType type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType(i); return gAgentWearables.getWearableCount(type); } @@ -1381,7 +1381,7 @@ BOOL LLVOAvatarSelf::getLocalTextureGL(ETextureIndex type, LLViewerTexture** tex return TRUE; } -LLViewerFetchedTexture* LLVOAvatarSelf::getLocalTextureGL(LLVOAvatarDefines::ETextureIndex type, U32 index) const +LLViewerFetchedTexture* LLVOAvatarSelf::getLocalTextureGL(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { if (!isIndexLocalTexture(type)) { @@ -1422,21 +1422,21 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye { /* if (layerset == mBakedTextureDatas[BAKED_HEAD].mTexLayerSet) return getLocalDiscardLevel(TEX_HEAD_BODYPAINT) >= 0; */ - for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + 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) { BOOL ret = true; - const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; + 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; - const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(tex_index); + const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(tex_index); const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++) { @@ -1465,13 +1465,13 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset { if (layerset == mBakedTextureDatas[i].mTexLayerSet) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); 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; - const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(tex_index); + const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(tex_index); const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++) { @@ -1495,13 +1495,13 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); 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; - const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(tex_index); + const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(tex_index); const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++) { @@ -1515,7 +1515,7 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const return TRUE; } -BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLVOAvatarDefines::EBakedTextureIndex index) const +BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const { const LLViewerTexLayerSet *layerset = mBakedTextureDatas[index].mTexLayerSet; if (!layerset) return FALSE; @@ -1524,13 +1524,13 @@ BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLVOAvatarDefines::EBakedTextureI return !layerset_buffer->uploadNeeded(); } -BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 index) const +BOOL LLVOAvatarSelf::isTextureDefined(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { LLUUID id; BOOL isDefined = TRUE; if (isIndexLocalTexture(type)) { - const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(type); + const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(type); const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); if (index >= wearable_count) { @@ -1557,7 +1557,7 @@ BOOL LLVOAvatarSelf::isTextureDefined(LLVOAvatarDefines::ETextureIndex type, U32 } //virtual -BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index) const +BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, U32 index) const { if (isIndexBakedTexture(type)) { @@ -1570,7 +1570,7 @@ BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 } //virtual -BOOL LLVOAvatarSelf::isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLViewerWearable *wearable) const +BOOL LLVOAvatarSelf::isTextureVisible(LLAvatarAppearanceDefines::ETextureIndex type, LLViewerWearable *wearable) const { if (isIndexBakedTexture(type)) { @@ -1593,7 +1593,7 @@ void LLVOAvatarSelf::requestLayerSetUploads() } } -void LLVOAvatarSelf::requestLayerSetUpload(LLVOAvatarDefines::EBakedTextureIndex i) +void LLVOAvatarSelf::requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedTextureIndex i) { ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex; const BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index)); @@ -1779,7 +1779,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te llerrs << "Tried to set local texture with invalid type: (" << (U32) type << ", " << index << ")" << llendl; return; } - LLWearableType::EType wearable_type = LLVOAvatarDictionary::getInstance()->getTEWearableType(type); + LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType(type); if (!gAgentWearables.getWearable(wearable_type,index)) { // no wearable is loaded, cannot set the texture. @@ -1839,7 +1839,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te setBakedReady(type,baked_version_ready,index); } //virtual -void LLVOAvatarSelf::setBakedReady(LLVOAvatarDefines::ETextureIndex type, BOOL baked_version_exists, U32 index) +void LLVOAvatarSelf::setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index) { if (!isIndexLocalTexture(type)) return; LLLocalTextureObject *local_tex_obj = getLocalTextureObject(type,index); @@ -1858,16 +1858,16 @@ void LLVOAvatarSelf::dumpLocalTextures() const /* ETextureIndex baked_equiv[] = { TEX_UPPER_BAKED, if (isTextureDefined(baked_equiv[i])) */ - for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); - iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); ++iter) { - const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture) continue; const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - const ETextureIndex baked_equiv = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex; + const ETextureIndex baked_equiv = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex; const std::string &name = texture_dict->mName; const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(iter->first, 0); @@ -2071,21 +2071,21 @@ const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTe /* if (layerset == mBakedTextureDatas[BAKED_HEAD].mTexLayerSet) return getLocalDiscardLevel(TEX_HEAD_BODYPAINT) >= 0; */ - for (LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + 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) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = baked_iter->second; + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second; text += llformat("%d-%s ( ",baked_index, baked_dict->mName.c_str()); 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; - const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(tex_index); + const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(tex_index); const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); if (wearable_count > 0) { @@ -2112,14 +2112,14 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)i); BOOL is_texture_final = TRUE; 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; - const LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(tex_index); + const LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(tex_index); const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++) { @@ -2243,7 +2243,7 @@ const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) c { if (canGrabBakedTexture(baked_index)) { - ETextureIndex tex_index = LLVOAvatarDictionary::bakedToLocalTextureIndex(baked_index); + ETextureIndex tex_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(baked_index); if (tex_index == TEX_NUM_INDICES) { return LLUUID::null; @@ -2255,7 +2255,7 @@ const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) c BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const { - ETextureIndex tex_index = LLVOAvatarDictionary::bakedToLocalTextureIndex(baked_index); + ETextureIndex tex_index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(baked_index); if (tex_index == TEX_NUM_INDICES) { return FALSE; @@ -2274,13 +2274,13 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const // baked texture. We don't want people copying people's // work via baked textures. - const LLVOAvatarDictionary::BakedEntry *baked_dict = LLVOAvatarDictionary::getInstance()->getBakedTexture(baked_index); + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index); for (texture_vec_t::const_iterator iter = baked_dict->mLocalTextures.begin(); iter != baked_dict->mLocalTextures.end(); ++iter) { const ETextureIndex t_index = (*iter); - LLWearableType::EType wearable_type = LLVOAvatarDictionary::getTEWearableType(t_index); + LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getTEWearableType(t_index); U32 count = gAgentWearables.getWearableCount(wearable_type); lldebugs << "Checking index " << (U32) t_index << " count: " << count << llendl; @@ -2358,9 +2358,9 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe } } -LLLocalTextureObject* LLVOAvatarSelf::getLocalTextureObject(LLVOAvatarDefines::ETextureIndex i, U32 wearable_index) const +LLLocalTextureObject* LLVOAvatarSelf::getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 wearable_index) const { - LLWearableType::EType type = LLVOAvatarDictionary::getInstance()->getTEWearableType(i); + LLWearableType::EType type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType(i); LLViewerWearable* wearable = gAgentWearables.getWearable(type, wearable_index); if (wearable) { @@ -2388,9 +2388,9 @@ ETextureIndex LLVOAvatarSelf::getBakedTE( const LLViewerTexLayerSet* layerset ) } -void LLVOAvatarSelf::setNewBakedTexture(LLVOAvatarDefines::EBakedTextureIndex i, const LLUUID &uuid) +void LLVOAvatarSelf::setNewBakedTexture(LLAvatarAppearanceDefines::EBakedTextureIndex i, const LLUUID &uuid) { - ETextureIndex index = LLVOAvatarDictionary::bakedToLocalTextureIndex(i); + ETextureIndex index = LLAvatarAppearanceDictionary::bakedToLocalTextureIndex(i); setNewBakedTexture(index, uuid); } @@ -2412,7 +2412,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) /* switch(te) case TEX_HEAD_BAKED: llinfos << "New baked texture: HEAD" << llendl; */ - const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(te); + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(te); if (texture_dict->mIsBakedTexture) { debugBakedTextureUpload(texture_dict->mBakedTextureIndex, TRUE); // FALSE for start of upload, TRUE for finish. @@ -2477,7 +2477,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const LL_DEBUGS("Avatar") << "\t Time from avatar creation to de-cloud: " << (S32)mDebugTimeAvatarVisible << llendl; LL_DEBUGS("Avatar") << "\t Time from avatar creation to de-cloud for others: " << (S32)final_time << llendl; LL_DEBUGS("Avatar") << "\t Load time for each texture: " << llendl; - for (U32 i = 0; i < LLVOAvatarDefines::TEX_NUM_INDICES; ++i) + for (U32 i = 0; i < LLAvatarAppearanceDefines::TEX_NUM_INDICES; ++i) { std::stringstream out; out << "\t\t (" << i << ") "; @@ -2505,16 +2505,16 @@ void LLVOAvatarSelf::outputRezDiagnostics() const } } LL_DEBUGS("Avatar") << "\t Time points for each upload (start / finish)" << llendl; - for (U32 i = 0; i < LLVOAvatarDefines::BAKED_NUM_INDICES; ++i) + for (U32 i = 0; i < LLAvatarAppearanceDefines::BAKED_NUM_INDICES; ++i) { LL_DEBUGS("Avatar") << "\t\t (" << i << ") \t" << (S32)mDebugBakedTextureTimes[i][0] << " / " << (S32)mDebugBakedTextureTimes[i][1] << llendl; } - for (LLVOAvatarDefines::LLVOAvatarDictionary::BakedTextures::const_iterator baked_iter = LLVOAvatarDefines::LLVOAvatarDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLVOAvatarDefines::LLVOAvatarDictionary::getInstance()->getBakedTextures().end(); + for (LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin(); + baked_iter != LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end(); ++baked_iter) { - const LLVOAvatarDefines::EBakedTextureIndex baked_index = baked_iter->first; + const LLAvatarAppearanceDefines::EBakedTextureIndex baked_index = baked_iter->first; const LLViewerTexLayerSet *layerset = debugGetLayerSet(baked_index); if (!layerset) continue; const LLTexLayerSetBuffer *layerset_buffer = layerset->getComposite(); @@ -2583,12 +2583,12 @@ void LLVOAvatarSelf::processRebakeAvatarTextures(LLMessageSystem* msg, void**) /* ETextureIndex baked_texture_indices[BAKED_NUM_INDICES] = TEX_HEAD_BAKED, TEX_UPPER_BAKED, */ - for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); - iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); ++iter) { const ETextureIndex index = iter->first; - const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; if (texture_dict->mIsBakedTexture) { if (texture_id == gAgentAvatarp->getTEImage(index)->getID()) @@ -2657,7 +2657,7 @@ void LLVOAvatarSelf::requestLayerSetUpdate(ETextureIndex index ) case LOCTEX_UPPER_SHIRT: if( mUpperBodyLayerSet ) mUpperBodyLayerSet->requestUpdate(); */ - const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); if (!texture_dict->mIsLocalTexture || !texture_dict->mIsUsedByBakedTexture) return; const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; @@ -2673,7 +2673,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const case TEX_HEAD_BAKED: case TEX_HEAD_BODYPAINT: return mHeadLayerSet; */ - const LLVOAvatarDictionary::TextureEntry *texture_dict = LLVOAvatarDictionary::getInstance()->getTexture(index); + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); if (texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; @@ -2747,12 +2747,12 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const { LLUUID texture_id[TEX_NUM_INDICES]; // pack away current TEs to make sure we don't send them out - for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); - iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); ++iter) { const ETextureIndex index = iter->first; - const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; if (!texture_dict->mIsBakedTexture) { LLTextureEntry* entry = getTE((U8) index); @@ -2764,12 +2764,12 @@ bool LLVOAvatarSelf::sendAppearanceMessage(LLMessageSystem *mesgsys) const bool success = packTEMessage(mesgsys); // unpack TEs to make sure we don't re-trigger a bake - for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); - iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); + for (LLAvatarAppearanceDictionary::Textures::const_iterator iter = LLAvatarAppearanceDictionary::getInstance()->getTextures().begin(); + iter != LLAvatarAppearanceDictionary::getInstance()->getTextures().end(); ++iter) { const ETextureIndex index = iter->first; - const LLVOAvatarDictionary::TextureEntry *texture_dict = iter->second; + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = iter->second; if (!texture_dict->mIsBakedTexture) { LLTextureEntry* entry = getTE((U8) index); -- cgit v1.2.3 From 204be2ba5261d794f8264e004b65725450bf1be9 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 4 Sep 2012 15:18:15 +0000 Subject: Split LLTexLayerSetBuffer into llappearance portion, and viewer-specific LLViewerTexLayerSetBuffer --- indra/newview/llvoavatarself.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ec37e6f301..e836a5e4a8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1519,7 +1519,7 @@ BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLAvatarAppearanceDefines::EBaked { const LLViewerTexLayerSet *layerset = mBakedTextureDatas[index].mTexLayerSet; if (!layerset) return FALSE; - const LLTexLayerSetBuffer *layerset_buffer = layerset->getComposite(); + const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite(); if (!layerset_buffer) return FALSE; return !layerset_buffer->uploadNeeded(); } @@ -1614,7 +1614,7 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { LLViewerTexLayerSet* layerset = mBakedTextureDatas[i].mTexLayerSet; - if (layerset && layerset->getComposite() && layerset->getComposite()->uploadPending()) + if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending()) { return true; } @@ -2517,7 +2517,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const const LLAvatarAppearanceDefines::EBakedTextureIndex baked_index = baked_iter->first; const LLViewerTexLayerSet *layerset = debugGetLayerSet(baked_index); if (!layerset) continue; - const LLTexLayerSetBuffer *layerset_buffer = layerset->getComposite(); + const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite(); if (!layerset_buffer) continue; LL_DEBUGS("Avatar") << layerset_buffer->dumpTextureInfo() << llendl; } -- cgit v1.2.3 From b146490e1b46799ccb35e156b4751eddea3a23ce Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 5 Sep 2012 17:46:11 -0400 Subject: SH-3264 Worked to move over mBakedTextureDatas from LLVOAvatar to LLAvatarAppearance. Appear to have been able to move over the parts that are common to both the backend and the viewer into LLAvatarAppearance. --- indra/newview/llvoavatarself.cpp | 57 +++++++++++++++++++++++----------------- 1 file changed, 33 insertions(+), 24 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e836a5e4a8..945e134d21 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -883,8 +883,9 @@ void LLVOAvatarSelf::removeMissingBakedTextures() { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(TRUE); - invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, FALSE); + LLViewerTexLayerSet *layerset = getTexLayerSet(i); + layerset->setUpdatesEnabled(TRUE); + invalidateComposite(layerset, FALSE); } updateMeshTextures(); if (getRegion() && !getRegion()->getCentralBakeVersion()) @@ -1090,10 +1091,11 @@ void LLVOAvatarSelf::wearableUpdated( LLWearableType::EType type, BOOL upload_re const LLWearableType::EType comp_type = *type_iter; if (comp_type == type) { - if (mBakedTextureDatas[index].mTexLayerSet) + LLViewerTexLayerSet *layerset = getLayerSet(index); + if (layerset) { - mBakedTextureDatas[index].mTexLayerSet->setUpdatesEnabled(true); - invalidateComposite(mBakedTextureDatas[index].mTexLayerSet, upload_result); + layerset->setUpdatesEnabled(true); + invalidateComposite(layerset, upload_result); } break; } @@ -1517,7 +1519,7 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const BOOL LLVOAvatarSelf::isBakedTextureFinal(const LLAvatarAppearanceDefines::EBakedTextureIndex index) const { - const LLViewerTexLayerSet *layerset = mBakedTextureDatas[index].mTexLayerSet; + const LLViewerTexLayerSet *layerset = getLayerSet(index); if (!layerset) return FALSE; const LLViewerTexLayerSetBuffer *layerset_buffer = layerset->getViewerComposite(); if (!layerset_buffer) return FALSE; @@ -1597,9 +1599,10 @@ void LLVOAvatarSelf::requestLayerSetUpload(LLAvatarAppearanceDefines::EBakedText { ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex; const BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index)); - if (!layer_baked && mBakedTextureDatas[i].mTexLayerSet) + LLViewerTexLayerSet *layerset = getLayerSet(i); + if (!layer_baked && layerset) { - mBakedTextureDatas[i].mTexLayerSet->requestUpload(); + layerset->requestUpload(); } } @@ -1613,7 +1616,7 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - LLViewerTexLayerSet* layerset = mBakedTextureDatas[i].mTexLayerSet; + LLViewerTexLayerSet* layerset = getTexLayerSet(i); if (layerset && layerset->getViewerComposite() && layerset->getViewerComposite()->uploadPending()) { return true; @@ -1648,7 +1651,8 @@ void LLVOAvatarSelf::invalidateAll() { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - invalidateComposite(mBakedTextureDatas[i].mTexLayerSet, TRUE); + LLViewerTexLayerSet *layerset = getTexLayerSet(i); + invalidateComposite(layerset, TRUE); } //mDebugSelfLoadTimer.reset(); } @@ -1666,17 +1670,19 @@ void LLVOAvatarSelf::setCompositeUpdatesEnabled( bool b ) void LLVOAvatarSelf::setCompositeUpdatesEnabled(U32 index, bool b) { - if (mBakedTextureDatas[index].mTexLayerSet ) + LLViewerTexLayerSet *layerset = getTexLayerSet(index); + if (layerset ) { - mBakedTextureDatas[index].mTexLayerSet->setUpdatesEnabled( b ); + layerset->setUpdatesEnabled( b ); } } bool LLVOAvatarSelf::isCompositeUpdateEnabled(U32 index) { - if (mBakedTextureDatas[index].mTexLayerSet) + LLViewerTexLayerSet *layerset = getTexLayerSet(index); + if (layerset) { - return mBakedTextureDatas[index].mTexLayerSet->getUpdatesEnabled(); + return layerset->getUpdatesEnabled(); } return false; } @@ -1687,9 +1693,10 @@ void LLVOAvatarSelf::setupComposites() { ETextureIndex tex_index = mBakedTextureDatas[i].mTextureIndex; BOOL layer_baked = isTextureDefined(tex_index, gAgentWearables.getWearableCount(tex_index)); - if (mBakedTextureDatas[i].mTexLayerSet) + LLViewerTexLayerSet *layerset = getTexLayerSet(i); + if (layerset) { - mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(!layer_baked); + layerset->setUpdatesEnabled(!layer_baked); } } } @@ -1698,10 +1705,11 @@ void LLVOAvatarSelf::updateComposites() { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - if (mBakedTextureDatas[i].mTexLayerSet + LLViewerTexLayerSet *layerset = getTexLayerSet(i); + if (layerset && ((i != BAKED_SKIRT) || isWearingWearableType(LLWearableType::WT_SKIRT))) { - mBakedTextureDatas[i].mTexLayerSet->updateComposite(); + layerset->updateComposite(); } } } @@ -1985,14 +1993,14 @@ BOOL LLVOAvatarSelf::getIsCloud() const if (!mPreviousFullyLoaded) { - if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_LOWER].mTexLayerSet) && + if (!isLocalTextureDataAvailable(getLayerSet(BAKED_LOWER)) && (!isTextureDefined(TEX_LOWER_BAKED, 0))) { lldebugs << "Lower textures not baked" << llendl; return TRUE; } - if (!isLocalTextureDataAvailable(mBakedTextureDatas[BAKED_UPPER].mTexLayerSet) && + if (!isLocalTextureDataAvailable(getLayerSet(BAKED_UPPER)) && (!isTextureDefined(TEX_UPPER_BAKED, 0))) { lldebugs << "Upper textures not baked" << llendl; @@ -2550,7 +2558,8 @@ void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid mHeadLayerSet->cancelUpload(); */ for (U32 i = 0; i < mBakedTextureDatas.size(); i++) { - if ( mBakedTextureDatas[i].mTextureIndex == te && mBakedTextureDatas[i].mTexLayerSet) + LLViewerTexLayerSet *layerset = getTexLayerSet(i); + if ( mBakedTextureDatas[i].mTextureIndex == te && layerset) { if (mInitialBakeIDs[i] != LLUUID::null) { @@ -2564,7 +2573,7 @@ void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid } mInitialBakeIDs[i] = LLUUID::null; } - mBakedTextureDatas[i].mTexLayerSet->cancelUpload(); + layerset->cancelUpload(); } } } @@ -2677,7 +2686,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const if (texture_dict->mIsUsedByBakedTexture) { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - return mBakedTextureDatas[baked_index].mTexLayerSet; + return getLayerSet(baked_index); } return NULL; } @@ -2690,7 +2699,7 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) return mHeadLayerSet; */ if (baked_index >= 0 && baked_index < BAKED_NUM_INDICES) { - return mBakedTextureDatas[baked_index].mTexLayerSet; + return getTexLayerSet(baked_index); } return NULL; } -- cgit v1.2.3 From 85d0bcc0630bfbf8b50be3a47a113c4f8d6ec9df Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 6 Sep 2012 02:53:55 +0000 Subject: Extracted mWearableDatas from LLAgentWearables into llappearance/LLWearableData. Moved LLDriverParam into llappearance --- indra/newview/llvoavatarself.cpp | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e836a5e4a8..c1984fa738 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -74,9 +74,7 @@ LLPointer gAgentAvatarp = NULL; BOOL isAgentAvatarValid() { - return (gAgentAvatarp.notNull() && - (gAgentAvatarp->getRegion() != NULL) && - (!gAgentAvatarp->isDead())); + return (gAgentAvatarp.notNull() && gAgentAvatarp->isValid()); } void selfStartPhase(const std::string& phase_name) @@ -669,10 +667,16 @@ BOOL LLVOAvatarSelf::updateCharacter(LLAgent &agent) return LLVOAvatar::updateCharacter(agent); } +// virtual +BOOL LLVOAvatarSelf::isValid() const +{ + return ((getRegion() != NULL) && !isDead()); +} + // virtual void LLVOAvatarSelf::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { - if (isAgentAvatarValid()) + if (isValid()) { LLVOAvatar::idleUpdate(agent, world, time); idleUpdateTractorBeam(); @@ -695,7 +699,7 @@ void LLVOAvatarSelf::resetJointPositions( void ) return LLVOAvatar::resetJointPositions(); } // virtual -BOOL LLVOAvatarSelf::setVisualParamWeight(LLVisualParam *which_param, F32 weight, BOOL upload_bake ) +BOOL LLVOAvatarSelf::setVisualParamWeight(const LLVisualParam *which_param, F32 weight, BOOL upload_bake ) { if (!which_param) { @@ -723,7 +727,7 @@ BOOL LLVOAvatarSelf::setVisualParamWeight(S32 index, F32 weight, BOOL upload_bak return setParamWeight(param,weight,upload_bake); } -BOOL LLVOAvatarSelf::setParamWeight(LLViewerVisualParam *param, F32 weight, BOOL upload_bake ) +BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight, BOOL upload_bake ) { if (!param) { @@ -736,7 +740,7 @@ BOOL LLVOAvatarSelf::setParamWeight(LLViewerVisualParam *param, F32 weight, BOOL U32 size = gAgentWearables.getWearableCount(type); for (U32 count = 0; count < size; ++count) { - LLViewerWearable *wearable = gAgentWearables.getWearable(type,count); + LLViewerWearable *wearable = gAgentWearables.getViewerWearable(type,count); if (wearable) { wearable->setVisualParamWeight(param->getID(), weight, upload_bake); @@ -762,7 +766,7 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation() // apply wearable visual params to avatar for (U32 type = 0; type < LLWearableType::WT_COUNT; type++) { - LLViewerWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type); + LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type); if (wearable) { wearable->writeToAvatar(); @@ -1257,7 +1261,7 @@ BOOL LLVOAvatarSelf::detachObject(LLViewerObject *viewer_object) // Make sure the inventory is in sync with the avatar. // Update COF contents, don't trigger appearance update. - if (!isAgentAvatarValid()) + if (!isValid()) { llinfos << "removeItemLinks skipped, avatar is under destruction" << llendl; } @@ -1780,7 +1784,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te return; } LLWearableType::EType wearable_type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType(type); - if (!gAgentWearables.getWearable(wearable_type,index)) + if (!gAgentWearables.getViewerWearable(wearable_type,index)) { // no wearable is loaded, cannot set the texture. return; @@ -1796,7 +1800,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te LLViewerTexLayerSet *layer_set = getLayerSet(type); if (layer_set) { - layer_set->cloneTemplates(local_tex_obj, type, gAgentWearables.getWearable(wearable_type,index)); + layer_set->cloneTemplates(local_tex_obj, type, gAgentWearables.getViewerWearable(wearable_type,index)); } } @@ -2286,7 +2290,7 @@ BOOL LLVOAvatarSelf::canGrabBakedTexture(EBakedTextureIndex baked_index) const for (U32 wearable_index = 0; wearable_index < count; ++wearable_index) { - LLViewerWearable *wearable = gAgentWearables.getWearable(wearable_type, wearable_index); + LLViewerWearable *wearable = gAgentWearables.getViewerWearable(wearable_type, wearable_index); if (wearable) { const LLLocalTextureObject *texture = wearable->getLocalTextureObject((S32)t_index); @@ -2361,7 +2365,7 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe LLLocalTextureObject* LLVOAvatarSelf::getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 wearable_index) const { LLWearableType::EType type = LLAvatarAppearanceDictionary::getInstance()->getTEWearableType(i); - LLViewerWearable* wearable = gAgentWearables.getWearable(type, wearable_index); + LLViewerWearable* wearable = gAgentWearables.getViewerWearable(type, wearable_index); if (wearable) { return wearable->getLocalTextureObject(i); -- cgit v1.2.3 From 77b33d9623c08152932282048fe847d79fcf43cd Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 7 Sep 2012 23:17:34 -0400 Subject: SH-3264 Porting over the XML loading of the avatar structure to llappearance Moved over the necessary classes to llappearance to support the loading of the avatar's structure & params from file. --- indra/newview/llvoavatarself.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index fc52347041..f832a126bd 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -255,7 +255,7 @@ BOOL LLVOAvatarSelf::loadAvatarSelf() return success; } -BOOL LLVOAvatarSelf::buildSkeletonSelf(const LLVOAvatarSkeletonInfo *info) +BOOL LLVOAvatarSelf::buildSkeletonSelf(const LLAvatarSkeletonInfo *info) { LLMemType mt(LLMemType::MTYPE_AVATAR); @@ -589,7 +589,7 @@ LLVOAvatarSelf::~LLVOAvatarSelf() BOOL LLVOAvatarSelf::loadLayersets() { BOOL success = TRUE; - for (LLVOAvatarXmlInfo::layer_info_list_t::const_iterator iter = sAvatarXmlInfo->mLayerInfoList.begin(); + for (LLAvatarXmlInfo::layer_info_list_t::const_iterator iter = sAvatarXmlInfo->mLayerInfoList.begin(); iter != sAvatarXmlInfo->mLayerInfoList.end(); ++iter) { @@ -952,7 +952,7 @@ void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) void LLVOAvatarSelf::idleUpdateTractorBeam() { // This is only done for yourself (maybe it should be in the agent?) - if (!needsRenderBeam() || !mIsBuilt) + if (!needsRenderBeam() || !isBuilt()) { mBeam = NULL; } -- cgit v1.2.3 From e1580128ab2a42ecd4019ef35069f9e939dc4ff2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Sun, 9 Sep 2012 12:12:19 +0000 Subject: Fixed crashes on login. Moved most of the remaining character/skeleton generation code into llappearance. Moved non-rendering related LLViewerJoint functionality into LLAvatarJoint. --- indra/newview/llvoavatarself.cpp | 66 ---------------------------------------- 1 file changed, 66 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f832a126bd..96fd41739f 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -249,8 +249,6 @@ BOOL LLVOAvatarSelf::loadAvatarSelf() llwarns << "avatar file: buildSkeleton() failed" << llendl; return FALSE; } - // TODO: make loadLayersets() called only by self. - //success &= loadLayersets(); return success; } @@ -585,70 +583,6 @@ LLVOAvatarSelf::~LLVOAvatarSelf() ** ** *********************************************************************************/ -//virtual -BOOL LLVOAvatarSelf::loadLayersets() -{ - BOOL success = TRUE; - for (LLAvatarXmlInfo::layer_info_list_t::const_iterator iter = sAvatarXmlInfo->mLayerInfoList.begin(); - iter != sAvatarXmlInfo->mLayerInfoList.end(); - ++iter) - { - // Construct a layerset for each one specified in avatar_lad.xml and initialize it as such. - const LLTexLayerSetInfo *info = *iter; - LLViewerTexLayerSet* layer_set = new LLViewerTexLayerSet( this ); - - if (!layer_set->setInfo(info)) - { - stop_glerror(); - delete layer_set; - llwarns << "avatar file: layer_set->parseData() failed" << llendl; - return FALSE; - } - - // scan baked textures and associate the layerset with the appropriate one - EBakedTextureIndex baked_index = BAKED_NUM_INDICES; - for (LLAvatarAppearanceDictionary::BakedTextures::const_iterator baked_iter = LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().begin(); - baked_iter != LLAvatarAppearanceDictionary::getInstance()->getBakedTextures().end(); - ++baked_iter) - { - const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = baked_iter->second; - if (layer_set->isBodyRegion(baked_dict->mName)) - { - baked_index = baked_iter->first; - // ensure both structures are aware of each other - mBakedTextureDatas[baked_index].mTexLayerSet = layer_set; - layer_set->setBakedTexIndex(baked_index); - break; - } - } - // if no baked texture was found, warn and cleanup - if (baked_index == BAKED_NUM_INDICES) - { - llwarns << " has invalid body_region attribute" << llendl; - delete layer_set; - return FALSE; - } - - // scan morph masks and let any affected layers know they have an associated morph - for (LLVOAvatar::morph_list_t::const_iterator morph_iter = mBakedTextureDatas[baked_index].mMaskedMorphs.begin(); - morph_iter != mBakedTextureDatas[baked_index].mMaskedMorphs.end(); - ++morph_iter) - { - LLMaskedMorph *morph = *morph_iter; - LLTexLayerInterface* layer = layer_set->findLayerByName(morph->mLayer); - if (layer) - { - layer->setHasMorph(TRUE); - } - else - { - llwarns << "Could not find layer named " << morph->mLayer << " to set morph flag" << llendl; - success = FALSE; - } - } - } - return success; -} // virtual BOOL LLVOAvatarSelf::updateCharacter(LLAgent &agent) { -- cgit v1.2.3 From fc84d684500c2216aa270bffef865ee265927535 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 10 Sep 2012 18:46:52 -0400 Subject: dumpArchetypeXML tweaks, appearance debugging --- indra/newview/llvoavatarself.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6c8cbc37f7..8791055695 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2706,6 +2706,7 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) gAgentCamera.changeCameraToCustomizeAvatar(); } + gAgentAvatarp->clearVisualParamWeights(); gAgentAvatarp->invalidateAll(); gAgentAvatarp->updateMeshTextures(); } -- cgit v1.2.3 From f1d6052e36ed6d817faedf9b32cb9d889395cd88 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 11 Sep 2012 11:59:45 -0400 Subject: SH-3264 Moved over a few more items to llappearance moved over: isWearingWearableType wearable::writeToAvatar wearable::mTEMap (stores LocalTextureObject*) more from wearable::import/export wearable::createVisualParams, etc --- indra/newview/llvoavatarself.cpp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 96fd41739f..d0ccde09e8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -703,7 +703,7 @@ void LLVOAvatarSelf::idleUpdateAppearanceAnimation() LLWearable *wearable = gAgentWearables.getTopWearable((LLWearableType::EType)type); if (wearable) { - wearable->writeToAvatar(); + wearable->writeToAvatar(this); } } @@ -1001,11 +1001,6 @@ void LLVOAvatarSelf::updateAttachmentVisibility(U32 camera_mode) } } -/*virtual*/ BOOL LLVOAvatarSelf::isWearingWearableType(LLWearableType::EType type ) const -{ - return gAgentWearables.getWearableCount(type) > 0; -} - //----------------------------------------------------------------------------- // updatedWearable( LLWearableType::EType type ) // forces an update to any baked textures relevant to type. @@ -2616,17 +2611,17 @@ void LLVOAvatarSelf::requestLayerSetUpdate(ETextureIndex index ) LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const { - /* switch(index) - case TEX_HEAD_BAKED: - case TEX_HEAD_BODYPAINT: - return mHeadLayerSet; */ - const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); - if (texture_dict->mIsUsedByBakedTexture) - { - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; - return getLayerSet(baked_index); - } - return NULL; + /* switch(index) + case TEX_HEAD_BAKED: + case TEX_HEAD_BODYPAINT: + return mHeadLayerSet; */ + const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); + if (texture_dict->mIsUsedByBakedTexture) + { + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + return getLayerSet(baked_index); + } + return NULL; } LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) const @@ -2637,12 +2632,14 @@ LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) return mHeadLayerSet; */ if (baked_index >= 0 && baked_index < BAKED_NUM_INDICES) { - return getTexLayerSet(baked_index); + return getTexLayerSet(baked_index); } return NULL; } + + // static void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) { -- cgit v1.2.3 From 8b2cb3766e3ed546994f81518983283e68263b09 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 14 Sep 2012 11:29:17 -0400 Subject: BUILDFIX: WIN fixing up windows building issues Cleaned up a couple of things that the windows compiler was warning about, with our inheritance structure --- indra/newview/llvoavatarself.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a29b3ff92b..c5bb4c3700 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1558,24 +1558,25 @@ bool LLVOAvatarSelf::hasPendingBakedUploads() const return false; } -void LLVOAvatarSelf::invalidateComposite( LLViewerTexLayerSet* layerset, BOOL upload_result ) +void LLVOAvatarSelf::invalidateComposite( LLTexLayerSet* layerset, BOOL upload_result ) { - if( !layerset || !layerset->getUpdatesEnabled() ) + LLViewerTexLayerSet *layer_set = dynamic_cast(layerset); + if( !layer_set || !layer_set->getUpdatesEnabled() ) { return; } // llinfos << "LLVOAvatar::invalidComposite() " << layerset->getBodyRegionName() << llendl; - layerset->requestUpdate(); - layerset->invalidateMorphMasks(); + layer_set->requestUpdate(); + layer_set->invalidateMorphMasks(); if( upload_result && (getRegion() && !getRegion()->getCentralBakeVersion())) { llassert(isSelf()); - ETextureIndex baked_te = getBakedTE( layerset ); + ETextureIndex baked_te = getBakedTE( layer_set ); setTEImage( baked_te, LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR) ); - layerset->requestUpload(); + layer_set->requestUpload(); updateMeshTextures(); } } -- cgit v1.2.3 From ae0bb922909af95d96c140c1d74a4f39a264d4ec Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Sep 2012 06:36:24 -0400 Subject: renamed isUsingBakedTextures to more accurate isUsingServerBakes. Commented some areas we are probably using the function incorrectly --- indra/newview/llvoavatarself.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c5bb4c3700..d6d1853bec 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1274,7 +1274,8 @@ void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *sr discard_level < local_tex_obj->getDiscard()) { local_tex_obj->setDiscard(discard_level); - if (isUsingBakedTextures()) + // FIXME DRANO + if (isUsingServerBakes()) { requestLayerSetUpdate(index); } @@ -1758,7 +1759,8 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te local_tex_obj->setDiscard(tex_discard); if (isSelf()) { - if (gAgentAvatarp->isUsingBakedTextures()) + // FIXME DRANO + if (gAgentAvatarp->isUsingServerBakes()) { requestLayerSetUpdate(type); } -- cgit v1.2.3 From 04b0862b3b53ef57801b779c51e6b8fe1c442008 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Sep 2012 11:27:13 -0400 Subject: use accessors for mUseLocalAppearance, mIsEditingAppearance, mUseServerBakes --- indra/newview/llvoavatarself.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d6d1853bec..b4f36a6391 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2671,6 +2671,7 @@ void LLVOAvatarSelf::onCustomizeEnd(bool disable_camera_switch) gAgentAvatarp->mIsEditingAppearance = false; if (gAgentAvatarp->getRegion() && !gAgentAvatarp->getRegion()->getCentralBakeVersion()) { + // FIXME DRANO - move to sendAgentSetAppearance, make conditional on upload complete. gAgentAvatarp->mUseLocalAppearance = false; } -- cgit v1.2.3 From ab83fab72c66e753917001a9030aa55e69a3c496 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Sep 2012 11:52:19 -0400 Subject: error checking, comments for areas needing fix/check in appearance --- 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 b4f36a6391..6f58ffc5c1 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1274,7 +1274,7 @@ void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *sr discard_level < local_tex_obj->getDiscard()) { local_tex_obj->setDiscard(discard_level); - // FIXME DRANO + // FIXME DRANO - should this be a local appearance check? if (isUsingServerBakes()) { requestLayerSetUpdate(index); -- cgit v1.2.3 From 93e210d91f521b01deb10aa6aa25160364e6ae28 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Sep 2012 15:45:58 -0400 Subject: more state management stuff, DRANO flags for problematic areas --- indra/newview/llvoavatarself.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 6f58ffc5c1..65cadb66df 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1274,12 +1274,8 @@ void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *sr discard_level < local_tex_obj->getDiscard()) { local_tex_obj->setDiscard(discard_level); - // FIXME DRANO - should this be a local appearance check? - if (isUsingServerBakes()) - { - requestLayerSetUpdate(index); - } - else + requestLayerSetUpdate(index); + if (isEditingAppearance()) { LLVisualParamHint::requestHintUpdates(); } @@ -1759,12 +1755,8 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te local_tex_obj->setDiscard(tex_discard); if (isSelf()) { - // FIXME DRANO - if (gAgentAvatarp->isUsingServerBakes()) - { - requestLayerSetUpdate(type); - } - else + requestLayerSetUpdate(type); + if (isEditingAppearance()) { LLVisualParamHint::requestHintUpdates(); } -- cgit v1.2.3 From 05ee87af14c4d20e754aa525e4a3f78eb736a96b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 26 Sep 2012 17:02:46 -0400 Subject: Fixed problems caused by defaulting mUseServerBakes to false --- indra/newview/llvoavatarself.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 65cadb66df..7ca40a8752 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -746,7 +746,10 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, { U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); - if (mInitialBakesLoaded == false && retval == 0x0) + // FIXME DRANO - skipping in the case of !mFirstAppearanceMessageReceived prevents us from trying to + // load textures before we know where they come from (ie, from baking service or not); + // unknown impact on performance. + if (mInitialBakesLoaded == false && retval == 0x0 && mFirstAppearanceMessageReceived) { // call update textures to force the images to be created updateMeshTextures(); -- cgit v1.2.3 From e29b66ed6ce29528f7b733c51db22a31a05d3a5f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 3 Oct 2012 17:13:18 -0400 Subject: additional fixes for avoiding avatar param manipulation via wearables, setting correct state from avatar appearance --- indra/newview/llvoavatarself.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 7ca40a8752..a29ef2f3ad 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -668,6 +668,13 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight return FALSE; } + // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables. + if (isUsingServerBakes() && !isUsingLocalAppearance()) + { + return FALSE; + } + + if (param->getCrossWearable()) { LLWearableType::EType type = (LLWearableType::EType)param->getWearableType(); -- cgit v1.2.3 From c06c35609c6683731eaea283468f6b32af18fea2 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 11 Oct 2012 00:09:04 +0000 Subject: Updating linux build to gcc4.6 --- indra/newview/llvoavatarself.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a29ef2f3ad..e4fb1ebf88 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -341,7 +341,6 @@ BOOL LLVOAvatarSelf::buildMenus() } else { - BOOL attachment_found = FALSE; for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -369,7 +368,6 @@ BOOL LLVOAvatarSelf::buildMenus() gAttachPieMenu->addChild(item); - attachment_found = TRUE; break; } @@ -382,7 +380,6 @@ BOOL LLVOAvatarSelf::buildMenus() } else { - BOOL attachment_found = FALSE; for (attachment_map_t::iterator iter = mAttachmentPoints.begin(); iter != mAttachmentPoints.end(); ++iter) @@ -409,7 +406,6 @@ BOOL LLVOAvatarSelf::buildMenus() gDetachPieMenu->addChild(item); - attachment_found = TRUE; break; } } -- cgit v1.2.3 From 22f53c85588912582f33d840d106b10f54f2c62d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 15 Oct 2012 18:41:55 -0400 Subject: additional debugging info, including tracking where visual params live --- indra/newview/llvoavatarself.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e4fb1ebf88..667eedd0c8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2654,7 +2654,14 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) gAgentCamera.changeCameraToCustomizeAvatar(); } + bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); + std::string dump_prefix = gAgentAvatarp->getFullname() + "_" + (gAgentAvatarp->isSelf()?"s":"o") + "_"; + if (enable_verbose_dumps) { gAgentAvatarp->dumpArchetypeXML(dump_prefix + "on_customize_start"); } gAgentAvatarp->clearVisualParamWeights(); + if (enable_verbose_dumps) { gAgentAvatarp->dumpArchetypeXML(dump_prefix + "on_customize_post_clear"); } + gAgentAvatarp->idleUpdateAppearanceAnimation(); + if (enable_verbose_dumps) { gAgentAvatarp->dumpArchetypeXML(dump_prefix + "on_customize_post_update"); } + gAgentAvatarp->invalidateAll(); gAgentAvatarp->updateMeshTextures(); } -- cgit v1.2.3 From 2390e21a9d2fc6f5cabe132a2bbd807aec186cfa Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 17 Oct 2012 18:32:26 -0400 Subject: additional diagnostics, improved shape stability at cost of increasing entanglement between baked and local appearance --- indra/newview/llvoavatarself.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 667eedd0c8..a01188d7dc 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -664,12 +664,13 @@ BOOL LLVOAvatarSelf::setParamWeight(const LLViewerVisualParam *param, F32 weight return FALSE; } +#if 0 // FIXME DRANO - kludgy way to avoid overwriting avatar state from wearables. if (isUsingServerBakes() && !isUsingLocalAppearance()) { return FALSE; } - +#endif if (param->getCrossWearable()) { @@ -2654,13 +2655,10 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) gAgentCamera.changeCameraToCustomizeAvatar(); } - bool enable_verbose_dumps = gSavedSettings.getBOOL("DebugAvatarAppearanceMessage"); - std::string dump_prefix = gAgentAvatarp->getFullname() + "_" + (gAgentAvatarp->isSelf()?"s":"o") + "_"; - if (enable_verbose_dumps) { gAgentAvatarp->dumpArchetypeXML(dump_prefix + "on_customize_start"); } +#if 0 gAgentAvatarp->clearVisualParamWeights(); - if (enable_verbose_dumps) { gAgentAvatarp->dumpArchetypeXML(dump_prefix + "on_customize_post_clear"); } gAgentAvatarp->idleUpdateAppearanceAnimation(); - if (enable_verbose_dumps) { gAgentAvatarp->dumpArchetypeXML(dump_prefix + "on_customize_post_update"); } +#endif gAgentAvatarp->invalidateAll(); gAgentAvatarp->updateMeshTextures(); -- cgit v1.2.3 From f5a4c277cbf83d6adbb5f2040f3a9e2bfaa02277 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 7 Nov 2012 15:28:38 -0500 Subject: SH-3500 FIX - added additional logging to allow params in various locations to be distinguished --- indra/newview/llvoavatarself.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a01188d7dc..2b95a38086 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2777,3 +2777,38 @@ void LLVOAvatarSelf::dumpScratchTextureByteCount() { llinfos << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << llendl; } + +void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); + +void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile) +{ + apr_file_t* file = outfile.getFileHandle(); + if (!file) + { + return; + } + + + apr_file_printf( file, "\n\n" ); + + LLWearableData *wd = getWearableData(); + for (S32 type = 0; type < LLWearableType::WT_COUNT; type++) + { + const std::string& type_name = LLWearableType::getTypeName((LLWearableType::EType)type); + for (U32 j=0; j< wd->getWearableCount((LLWearableType::EType)type); j++) + { + LLViewerWearable *wearable = gAgentWearables.getViewerWearable((LLWearableType::EType)type,j); + apr_file_printf( file, "\n\t \n", + type_name.c_str(), wearable->getName().c_str() ); + LLWearable::visual_param_vec_t v_params; + wearable->getVisualParams(v_params); + for (LLWearable::visual_param_vec_t::iterator it = v_params.begin(); + it != v_params.end(); ++it) + { + LLVisualParam *param = *it; + dump_visual_param(file, param, param->getWeight()); + } + } + } + apr_file_printf( file, "\n\n" ); +} -- cgit v1.2.3 From 51a1d510a5dc0b4c02cf8e1c592dd017bb0d07f3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 Nov 2012 13:09:54 -0500 Subject: SH-3541 WIP - fixed one cause of local textures failing to load --- indra/newview/llvoavatarself.cpp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 2b95a38086..88bf596a35 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2275,30 +2275,27 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe { if (!isIndexLocalTexture(type)) return; - if (!covered_by_baked) + if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR && imagep->getDiscardLevel() != 0) { - if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR && imagep->getDiscardLevel() != 0) - { - F32 desired_pixels; - desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); - imagep->setBoostLevel(getAvatarBoostLevel()); + F32 desired_pixels; + desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); + imagep->setBoostLevel(getAvatarBoostLevel()); - imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); - imagep->addTextureStats( desired_pixels / texel_area_ratio ); - imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; - imagep->forceUpdateBindStats() ; - if (imagep->getDiscardLevel() < 0) - { - mHasGrey = TRUE; // for statistics gathering - } - } - else + imagep->resetTextureStats(); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->addTextureStats( desired_pixels / texel_area_ratio ); + imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; + imagep->forceUpdateBindStats() ; + if (imagep->getDiscardLevel() < 0) { - // texture asset is missing mHasGrey = TRUE; // for statistics gathering } } + else + { + // texture asset is missing + mHasGrey = TRUE; // for statistics gathering + } } LLLocalTextureObject* LLVOAvatarSelf::getLocalTextureObject(LLAvatarAppearanceDefines::ETextureIndex i, U32 wearable_index) const -- cgit v1.2.3 From 2540568a83ca07856ddb760a6983efb3b85430a2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 Nov 2012 14:50:05 -0500 Subject: SH-3541 WIP - prioritize local textures when in local appearance --- indra/newview/llvoavatarself.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 88bf596a35..619058fd25 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2279,12 +2279,15 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe { F32 desired_pixels; desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); - imagep->setBoostLevel(getAvatarBoostLevel()); + if (isUsingLocalAppearance()) + { + imagep->setBoostLevel(getAvatarBoostLevel()); + imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; + } imagep->resetTextureStats(); imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); imagep->addTextureStats( desired_pixels / texel_area_ratio ); - imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; imagep->forceUpdateBindStats() ; if (imagep->getDiscardLevel() < 0) { -- cgit v1.2.3 From ebce476bd6e4b4b8a6404fa83e8fa0d8b1e64dc5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 15 Nov 2012 11:13:45 -0500 Subject: SH-3484 WIP, SH-3546 WIP, SH-3541 WIP - restrict useBakedTexture when in local update, minor readability tweaks --- indra/newview/llvoavatarself.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 619058fd25..77deb5e3bc 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1379,7 +1379,8 @@ BOOL LLVOAvatarSelf::isLocalTextureDataAvailable(const LLViewerTexLayerSet* laye const U32 wearable_count = gAgentWearables.getWearableCount(wearable_type); for (U32 wearable_index = 0; wearable_index < wearable_count; wearable_index++) { - ret &= (getLocalDiscardLevel(tex_index, wearable_index) >= 0); + BOOL tex_avail = (getLocalDiscardLevel(tex_index, wearable_index) >= 0); + ret &= tex_avail; } } return ret; @@ -1781,6 +1782,7 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te local_tex_obj->setID(tex->getID()); setBakedReady(type,baked_version_ready,index); } + //virtual void LLVOAvatarSelf::setBakedReady(LLAvatarAppearanceDefines::ETextureIndex type, BOOL baked_version_exists, U32 index) { -- cgit v1.2.3 From cbf24c55d511b2390fdc4c12698682531f26f41b Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 20 Dec 2012 10:27:18 -0500 Subject: SH-3344 WIP - additional debugging output for avatar local textures --- indra/newview/llvoavatarself.cpp | 85 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) (limited to 'indra/newview/llvoavatarself.cpp') 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( 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 -- cgit v1.2.3 From 4e1eda1c3bc898ae8481b8dfcff4b29196ac835e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 7 Jan 2013 18:31:28 -0500 Subject: SH-3344 WIP - keep avatar local textures flagged no-delete while in use --- indra/newview/llvoavatarself.cpp | 82 +++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 35 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 674988d94b..41dfe51116 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -177,7 +177,7 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, } // Called periodically for diagnostics, return true when done. -bool output_texture_diagnostics() +bool output_self_av_texture_diagnostics() { if (!isAgentAvatarValid()) return true; // done checking @@ -221,7 +221,7 @@ void LLVOAvatarSelf::initInstance() return; } - //doPeriodically(output_texture_diagnostics, 30.0); + doPeriodically(output_self_av_texture_diagnostics, 30.0); } // virtual @@ -2039,14 +2039,15 @@ const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLV ++local_tex_iter) { const ETextureIndex tex_index = *local_tex_iter; - outbuf << " tex_index " << (S32) tex_index << "\n"; + const std::string tex_name = LLAvatarAppearanceDictionary::getInstance()->getTexture(tex_index)->mName; + outbuf << " tex_index " << (S32) tex_index << " name " << tex_name << "\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"; + outbuf << " " << LLWearableType::getTypeName(wearable_type) << " " << wearable_index << ":"; const LLLocalTextureObject *local_tex_obj = getLocalTextureObject(tex_index, wearable_index); if (local_tex_obj) { @@ -2055,7 +2056,7 @@ const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLV && local_tex_obj->getID() != IMG_DEFAULT_AVATAR && !image->isMissingAsset()) { - outbuf << " id: " << image->getID() + outbuf << " id: " << image->getID() << " refs: " << image->getNumRefs() << " glocdisc: " << getLocalDiscardLevel(tex_index, wearable_index) << " discard: " << image->getDiscardLevel() @@ -2067,9 +2068,10 @@ const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLV << " fl: " << image->isFullyLoaded() // this is not an accessor for mFullyLoaded - see comment there. << " mvs: " << image->getMaxVirtualSize() << " mvsc: " << image->getMaxVirtualSizeResetCounter() - << "\n"; + << " mem: " << image->getTextureMemory(); } } + outbuf << "\n"; } } } @@ -2079,6 +2081,23 @@ const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLV return outbuf.str(); } +void LLVOAvatarSelf::dumpAllTextures() const +{ + 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; +} + const std::string LLVOAvatarSelf::debugDumpLocalTextureDataInfo(const LLViewerTexLayerSet* layerset) const { std::string text=""; @@ -2348,24 +2367,28 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe { if (!isIndexLocalTexture(type)) return; - if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR && imagep->getDiscardLevel() != 0) + if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR) { - F32 desired_pixels; - desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); - - // DRANO what priority should wearable-based textures have? - if (isUsingLocalAppearance()) - { - imagep->setBoostLevel(getAvatarBoostLevel()); - imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; - } - imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); - imagep->addTextureStats( desired_pixels / texel_area_ratio ); - imagep->forceUpdateBindStats() ; - if (imagep->getDiscardLevel() < 0) + imagep->setNoDelete(); + if (imagep->getDiscardLevel() != 0) { - mHasGrey = TRUE; // for statistics gathering + F32 desired_pixels; + desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); + + // DRANO what priority should wearable-based textures have? + if (isUsingLocalAppearance()) + { + imagep->setBoostLevel(getAvatarBoostLevel()); + imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; + } + imagep->resetTextureStats(); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->addTextureStats( desired_pixels / texel_area_ratio ); + imagep->forceUpdateBindStats() ; + if (imagep->getDiscardLevel() < 0) + { + mHasGrey = TRUE; // for statistics gathering + } } } else @@ -2538,19 +2561,8 @@ 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; + + dumpAllTextures(); } void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const -- cgit v1.2.3 From 0f753a530b914370c7c89c198ee335833ac3e6a1 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 11 Jan 2013 11:36:11 -0500 Subject: SH-3639 WIP - cleaned up some diagnostics and added fault injection ability. Disabled inventory retries for now. --- 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 8f118f5110..9b43db7087 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2256,7 +2256,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() if (S32_MAX == ++report_sequence) report_sequence = 0; - LL_DEBUGS("Avatar") << avString() << "message: " << ll_pretty_print_sd(msg) << LL_ENDL; +// LL_DEBUGS("Avatar") << avString() << "message: " << ll_pretty_print_sd(msg) << LL_ENDL; std::string caps_url; if (getRegion()) { -- cgit v1.2.3 From b3cbe35532b365e223df14921532a6e587695dec Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 18 Jan 2013 16:51:03 -0500 Subject: SH-3344 WIP - more texture load monitoring --- indra/newview/llvoavatarself.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 9b43db7087..19534bde59 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2066,6 +2066,7 @@ const std::string LLVOAvatarSelf::verboseDebugDumpLocalTextureDataInfo(const LLV << " ts: " << image->getTextureState() << " bl: " << image->getBoostLevel() << " fl: " << image->isFullyLoaded() // this is not an accessor for mFullyLoaded - see comment there. + << " cl: " << (image->isFullyLoaded() && image->getDiscardLevel()==0) // "completely loaded" << " mvs: " << image->getMaxVirtualSize() << " mvsc: " << image->getMaxVirtualSizeResetCounter() << " mem: " << image->getTextureMemory(); -- cgit v1.2.3 From c24c974cc6a7df3a1df7f7a24ad52275430b18dd Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 30 Jan 2013 18:23:31 -0500 Subject: SH-3800 WIP - logic to detect baked textures being sought in the wrong place, avoid querying textures for which we have no authoritative data where they live --- indra/newview/llvoavatarself.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) mode change 100644 => 100755 indra/newview/llvoavatarself.cpp (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp old mode 100644 new mode 100755 index 757d029513..aeac478d4e --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -759,6 +759,15 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, { U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); +#if 0 + // DRANO - it's not clear this does anything useful. If we wait + // until an appearance message has been received, we already have + // the texture ids. If we don't wait, we don't yet know where to + // look for baked textures, because we haven't received the + // appearance version data from the appearance message. This looks + // like an old optimization that's incompatible with server-side + // texture baking. + // FIXME DRANO - skipping in the case of !mFirstAppearanceMessageReceived prevents us from trying to // load textures before we know where they come from (ie, from baking service or not); // unknown impact on performance. @@ -783,6 +792,7 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, mInitialBakesLoaded = true; } +#endif return retval; } -- cgit v1.2.3 From 0897a291d16dc4002765c5eb4ed9e310ee1ba4a4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 7 Feb 2013 11:14:37 -0500 Subject: SH-3852 WIP - small tweaks --- indra/newview/llvoavatarself.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index aeac478d4e..a1c7cf97ff 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1462,7 +1462,9 @@ BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const 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) > (S32)(desired_tex_discard_level)) + S32 local_discard_level = getLocalDiscardLevel(*local_tex_iter, wearable_index); + if ((local_discard_level > (S32)(desired_tex_discard_level)) || + (local_discard_level < 0 )) { return FALSE; } @@ -2177,20 +2179,13 @@ LLSD LLVOAvatarSelf::metricsData() // runway - add region info LLSD result; result["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); - std::vector rez_counts; - LLVOAvatar::getNearbyRezzedStats(rez_counts); - result["nearby"] = LLSD::emptyMap(); - for (S32 i=0; i Date: Thu, 7 Feb 2013 19:14:00 -0500 Subject: SH-3852 WIP - track per-timer stats --- indra/newview/llvoavatarself.cpp | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a1c7cf97ff..3ae4f9bc71 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -81,7 +81,7 @@ void selfStartPhase(const std::string& phase_name) { if (isAgentAvatarValid()) { - gAgentAvatarp->getPhases().startPhase(phase_name); + gAgentAvatarp->startPhase(phase_name); } } @@ -89,7 +89,7 @@ void selfStopPhase(const std::string& phase_name) { if (isAgentAvatarValid()) { - gAgentAvatarp->getPhases().stopPhase(phase_name); + gAgentAvatarp->stopPhase(phase_name); } } @@ -97,19 +97,11 @@ void selfClearPhases() { if (isAgentAvatarValid()) { - gAgentAvatarp->getPhases().clearPhases(); + gAgentAvatarp->clearPhases(); gAgentAvatarp->mLastRezzedStatus = -1; } } -void selfStopAllPhases() -{ - if (isAgentAvatarValid()) - { - gAgentAvatarp->getPhases().stopAllPhases(); - } -} - using namespace LLAvatarAppearanceDefines; /********************************************************************************* @@ -222,6 +214,7 @@ void LLVOAvatarSelf::initInstance() } //doPeriodically(output_self_av_texture_diagnostics, 30.0); + doPeriodically(boost::bind(&LLVOAvatarSelf::updateAvatarRezMetrics, this, false), 5.0); } // virtual @@ -2238,6 +2231,22 @@ private: volatile bool & mReportingStarted; }; +bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send) +{ + F32 send_period = 30.0; + + if (force_send || mTimeSinceLastRezMessage.getElapsedTimeF32() > send_period) + { + // Stats for completed phases have been getting logged as they + // complete. This will give us stats for any timers that + // haven't finished as of the metric's being sent. + LLVOAvatar::logPendingPhasesAllAvatars(); + sendAppearanceChangeMetrics(); + } + + return false; +} + void LLVOAvatarSelf::sendAppearanceChangeMetrics() { // gAgentAvatarp->stopAllPhases(); @@ -2251,7 +2260,9 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() msg["sequence"] = report_sequence; msg["initial"] = !reporting_started; msg["break"] = false; - + msg["duration"] = mTimeSinceLastRezMessage.getElapsedTimeF32(); + mTimeSinceLastRezMessage.reset(); + // Update sequence number if (S32_MAX == ++report_sequence) report_sequence = 0; -- cgit v1.2.3 From 3bab0b6153b77c2b428e5f7d2a767b77a55fef68 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 8 Feb 2013 15:51:01 -0500 Subject: SH-3852 WIP - bucketize stats by agent_id, grid coordinates and various other criteria --- indra/newview/llvoavatarself.cpp | 89 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 83 insertions(+), 6 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 3ae4f9bc71..4461ba32c5 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -62,6 +62,7 @@ #include "llvovolume.h" #include "llsdutil.h" #include "llstartup.h" +#include "llsdserialize.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -2166,6 +2167,8 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const return text; } + +#if 0 // Dump avatar metrics data. LLSD LLVOAvatarSelf::metricsData() { @@ -2178,10 +2181,10 @@ LLSD LLVOAvatarSelf::metricsData() result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32(); result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); result["startup"] = LLStartUp::getPhases().dumpPhases(); - result["phases"] = getPhases().dumpPhases(); return result; } +#endif class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder { @@ -2241,19 +2244,65 @@ bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send) // complete. This will give us stats for any timers that // haven't finished as of the metric's being sent. LLVOAvatar::logPendingPhasesAllAvatars(); - sendAppearanceChangeMetrics(); + sendViewerAppearanceChangeMetrics(); } return false; } -void LLVOAvatarSelf::sendAppearanceChangeMetrics() +void LLVOAvatarSelf::addMetricsTimerRecord(const LLSD& record) +{ + mPendingTimerRecords.push_back(record); +} + +bool operator<(const LLSD& a, const LLSD& b) +{ + std::ostringstream aout, bout; + aout << LLSDNotationStreamer(a); + bout << LLSDNotationStreamer(b); + return aout.str() < bout.str(); + +} + +// Given a vector of LLSD records, return an LLSD array of bucketed stats for val_field. +LLSD summarize_by_buckets(std::vector in_records, + std::vector by_fields, + std::string& val_field) +{ + LLSD result = LLSD::emptyArray(); + std::map accum; + for (std::vector::iterator in_record_iter = in_records.begin(); + in_record_iter != in_records.end(); ++in_record_iter) + { + LLSD& record = *in_record_iter; + LLSD key; + for (std::vector::iterator field_iter = by_fields.begin(); + field_iter != by_fields.end(); ++field_iter) + { + const std::string& field = *field_iter; + key[field] = record[field]; + LLViewerStats::StatsAccumulator& stats = accum[key]; + F32 value = record[val_field].asReal(); + stats.push(value); + } + } + for (std::map::iterator accum_it = accum.begin(); + accum_it != accum.end(); ++accum_it) + { + LLSD out_record = accum_it->first; + out_record["stats"] = accum_it->second.getData(); + result.append(out_record); + } + return result; +} + +void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() { // gAgentAvatarp->stopAllPhases(); static volatile bool reporting_started(false); static volatile S32 report_sequence(0); - LLSD msg = metricsData(); + LLSD msg; // = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; msg["session_id"] = gAgentSessionID; msg["agent_id"] = gAgentID; @@ -2261,8 +2310,35 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() msg["initial"] = !reporting_started; msg["break"] = false; msg["duration"] = mTimeSinceLastRezMessage.getElapsedTimeF32(); - mTimeSinceLastRezMessage.reset(); - + + // Status of our own rezzing. + msg["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); + + // Status of all nearby avs including ourself. + msg["nearby"] = LLSD::emptyArray(); + std::vector rez_counts; + LLVOAvatar::getNearbyRezzedStats(rez_counts); + for (S32 rez_stat=0; rez_stat < rez_counts.size(); ++rez_stat) + { + std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat); + msg["nearby"][rez_status_name] = rez_counts[rez_stat]; + } + + // std::vector bucket_fields("timer_name","agent_id","is_self","grid_x","grid_y","is_using_server_bake"); + std::vector by_fields; + by_fields.push_back("timer_name"); + by_fields.push_back("agent_id"); + by_fields.push_back("completed"); + by_fields.push_back("grid_x"); + by_fields.push_back("grid_y"); + by_fields.push_back("is_using_server_bake"); + by_fields.push_back("is_self"); + by_fields.push_back("cbv"); + LLSD summary = summarize_by_buckets(mPendingTimerRecords, by_fields, std::string("elapsed")); + msg["timers"] = summary; + + mPendingTimerRecords.clear(); + // Update sequence number if (S32_MAX == ++report_sequence) report_sequence = 0; @@ -2282,6 +2358,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() new ViewerAppearanceChangeMetricsResponder(report_sequence, report_sequence, reporting_started)); + mTimeSinceLastRezMessage.reset(); } } -- cgit v1.2.3 From f3e407ae3f05e897de0b0d7daea4d31f09e73048 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 11 Feb 2013 13:50:26 -0500 Subject: SH-3852 WIP - removed avatar metrics from ViewerAssetMetrics --- indra/newview/llvoavatarself.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4461ba32c5..55e927652e 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2236,7 +2236,12 @@ private: bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send) { - F32 send_period = 30.0; + const F32 AV_METRICS_INTERVAL_QA = 30.0; + F32 send_period = 300.0; + if (gSavedSettings.getBOOL("QAModeMetrics")) + { + send_period = AV_METRICS_INTERVAL_QA; + } if (force_send || mTimeSinceLastRezMessage.getElapsedTimeF32() > send_period) { @@ -2260,7 +2265,10 @@ bool operator<(const LLSD& a, const LLSD& b) std::ostringstream aout, bout; aout << LLSDNotationStreamer(a); bout << LLSDNotationStreamer(b); - return aout.str() < bout.str(); + std::string astring = aout.str(); + std::string bstring = bout.str(); + + return astring < bstring; } @@ -2281,10 +2289,10 @@ LLSD summarize_by_buckets(std::vector in_records, { const std::string& field = *field_iter; key[field] = record[field]; - LLViewerStats::StatsAccumulator& stats = accum[key]; - F32 value = record[val_field].asReal(); - stats.push(value); } + LLViewerStats::StatsAccumulator& stats = accum[key]; + F32 value = record[val_field].asReal(); + stats.push(value); } for (std::map::iterator accum_it = accum.begin(); accum_it != accum.end(); ++accum_it) @@ -2331,9 +2339,9 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() by_fields.push_back("completed"); by_fields.push_back("grid_x"); by_fields.push_back("grid_y"); - by_fields.push_back("is_using_server_bake"); + by_fields.push_back("is_using_server_bakes"); by_fields.push_back("is_self"); - by_fields.push_back("cbv"); + by_fields.push_back("central_bake_version"); LLSD summary = summarize_by_buckets(mPendingTimerRecords, by_fields, std::string("elapsed")); msg["timers"] = summary; -- cgit v1.2.3 From f6698ad956d7c168a997e91fc5bc7e9a9b7aba64 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 11 Feb 2013 15:09:53 -0500 Subject: fix for mac build failure --- 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 55e927652e..21798d5774 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2275,7 +2275,7 @@ bool operator<(const LLSD& a, const LLSD& b) // Given a vector of LLSD records, return an LLSD array of bucketed stats for val_field. LLSD summarize_by_buckets(std::vector in_records, std::vector by_fields, - std::string& val_field) + std::string val_field) { LLSD result = LLSD::emptyArray(); std::map accum; -- cgit v1.2.3 From e11fd0a7eb9e5aa39aa719f6d349506348a06d18 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 12 Feb 2013 10:58:04 -0500 Subject: SH-3852 WIP - added more specific logging of completenesss of texture loading --- indra/newview/llvoavatarself.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 21798d5774..fedab5cd06 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -99,7 +99,7 @@ void selfClearPhases() if (isAgentAvatarValid()) { gAgentAvatarp->clearPhases(); - gAgentAvatarp->mLastRezzedStatus = -1; + //gAgentAvatarp->mLastRezzedStatus = -1; } } @@ -1426,7 +1426,9 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset 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) > (S32)(desired_tex_discard_level)) + S32 local_discard_level = getLocalDiscardLevel(*local_tex_iter, wearable_index); + if ((local_discard_level > (S32)(desired_tex_discard_level)) || + (local_discard_level < 0 )) { return FALSE; } @@ -1439,6 +1441,7 @@ BOOL LLVOAvatarSelf::isLocalTextureDataFinal(const LLViewerTexLayerSet* layerset return FALSE; } + BOOL LLVOAvatarSelf::isAllLocalTextureDataFinal() const { const U32 desired_tex_discard_level = gSavedSettings.getU32("TextureDiscardLevel"); -- cgit v1.2.3 From 02e9afd0e5d727ea0729fb2242b3a89247ae5b1a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 12 Feb 2013 14:26:48 -0500 Subject: SH-2852 WIP - track avatar loading via load_ timers, added distinction between partially and fully loaded textures --- indra/newview/llvoavatarself.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index fedab5cd06..8b29622fdb 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -99,7 +99,6 @@ void selfClearPhases() if (isAgentAvatarValid()) { gAgentAvatarp->clearPhases(); - //gAgentAvatarp->mLastRezzedStatus = -1; } } -- cgit v1.2.3 From 78016f4a8d9aea748a367da73b3aac0bd1690eec Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 12 Feb 2013 17:59:00 -0500 Subject: SH-3852 WIP - removed agent_id from summary packets --- indra/newview/llvoavatarself.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 8b29622fdb..e30d62869f 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2334,10 +2334,9 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() msg["nearby"][rez_status_name] = rez_counts[rez_stat]; } - // std::vector bucket_fields("timer_name","agent_id","is_self","grid_x","grid_y","is_using_server_bake"); + // std::vector bucket_fields("timer_name","is_self","grid_x","grid_y","is_using_server_bake"); std::vector by_fields; by_fields.push_back("timer_name"); - by_fields.push_back("agent_id"); by_fields.push_back("completed"); by_fields.push_back("grid_x"); by_fields.push_back("grid_y"); -- cgit v1.2.3 From 72dfb2abce5d5635e7f81436d65c8689d161eb37 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Feb 2013 17:28:05 -0500 Subject: SH-3812 WIP, SH-3852 WIP - some metrics cleanup, added rebake when needed and sb system is unavailable, to avoid stale appearance problems --- indra/newview/llvoavatarself.cpp | 81 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 78 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e30d62869f..2775c9442a 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -86,11 +86,11 @@ void selfStartPhase(const std::string& phase_name) } } -void selfStopPhase(const std::string& phase_name) +void selfStopPhase(const std::string& phase_name, bool err_check) { if (isAgentAvatarValid()) { - gAgentAvatarp->stopPhase(phase_name); + gAgentAvatarp->stopPhase(phase_name, err_check); } } @@ -179,6 +179,24 @@ bool output_self_av_texture_diagnostics() return false; } +bool update_avatar_rez_metrics() +{ + if (!isAgentAvatarValid()) + return true; + + gAgentAvatarp->updateAvatarRezMetrics(false); + return false; +} + +bool check_for_unsupported_baked_appearance() +{ + if (!isAgentAvatarValid()) + return true; + + gAgentAvatarp->checkForUnsupportedServerBakeAppearance(); + return false; +} + void LLVOAvatarSelf::initInstance() { BOOL status = TRUE; @@ -214,7 +232,8 @@ void LLVOAvatarSelf::initInstance() } //doPeriodically(output_self_av_texture_diagnostics, 30.0); - doPeriodically(boost::bind(&LLVOAvatarSelf::updateAvatarRezMetrics, this, false), 5.0); + doPeriodically(update_avatar_rez_metrics, 5.0); + doPeriodically(check_for_unsupported_baked_appearance, 120.0); } // virtual @@ -2371,6 +2390,62 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() } } +class CheckAgentAppearanceServiceResponder: public LLHTTPClient::Responder +{ +public: + CheckAgentAppearanceServiceResponder() + { + } + + virtual ~CheckAgentAppearanceServiceResponder() + { + } + + /* virtual */ void result(const LLSD& content) + { + LL_DEBUGS("Avatar") << "status OK" << llendl; + } + + // Error + /*virtual*/ void error(U32 status, const std::string& reason) + { + if (isAgentAvatarValid()) + { + LL_DEBUGS("Avatar") << "failed, will rebake" << llendl; + forceAppearanceUpdate(); + } + } + + static void forceAppearanceUpdate() + { + // Trying to rebake immediately after crossing region boundary + // seems to be failure prone; adding a delay factor. Yes, this + // fix is ad-hoc and not guaranteed to work in all cases. + doAfterInterval(boost::bind(&LLVOAvatarSelf::forceBakeAllTextures, + gAgentAvatarp.get(), true), 5.0); + } +}; + +void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance() +{ + // Need to check only if we have a server baked appearance and are + // in a non-baking region. + if (!gAgentAvatarp->isUsingServerBakes()) + return; + if (!gAgent.getRegion() || gAgent.getRegion()->getCentralBakeVersion()!=0) + return; + + // if baked image service is unknown, need to refresh. + if (gSavedSettings.getString("AgentAppearanceServiceURL").empty()) + { + CheckAgentAppearanceServiceResponder::forceAppearanceUpdate(); + } + // query baked image service to check status. + std::string image_url = gAgentAvatarp->getImageURL(TEX_HEAD_BAKED, + getTE(TEX_HEAD_BAKED)->getID()); + LLHTTPClient::head(image_url, new CheckAgentAppearanceServiceResponder); +} + const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const { if (canGrabBakedTexture(baked_index)) -- cgit v1.2.3 From c99e206374f6afdcc038a97934314dec1a742b2e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 13 Feb 2013 18:37:15 -0500 Subject: SH-3852 WIP - send non-complete timers only on av destruction or last message, so they don't get multiply counted --- indra/newview/llvoavatarself.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 2775c9442a..1a1564e1a8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2269,7 +2269,11 @@ bool LLVOAvatarSelf::updateAvatarRezMetrics(bool force_send) // Stats for completed phases have been getting logged as they // complete. This will give us stats for any timers that // haven't finished as of the metric's being sent. - LLVOAvatar::logPendingPhasesAllAvatars(); + + if (force_send) + { + LLVOAvatar::logPendingPhasesAllAvatars(); + } sendViewerAppearanceChangeMetrics(); } -- cgit v1.2.3 From 741821eb6a8717896307da44b1b8e7078a865fff Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 15 Feb 2013 09:52:11 -0500 Subject: SH-3867 FIX - on logout, wait for any pending metrics uploads to complete --- indra/newview/llvoavatarself.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 1a1564e1a8..7e24c43017 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2223,6 +2223,7 @@ public: const std::string& reason, const LLSD& content) { + gPendingMetricsUploads--; // if we add retry, this should be moved to the isGoodStatus case. if (isGoodStatus(status)) { LL_DEBUGS("Avatar") << "OK" << LL_ENDL; @@ -2235,11 +2236,6 @@ public: } } - // virtual - void error(U32 status_num, const std::string & reason) - { - } - // virtual void result(const LLSD & content) { @@ -2384,6 +2380,7 @@ void LLVOAvatarSelf::sendViewerAppearanceChangeMetrics() } if (!caps_url.empty()) { + gPendingMetricsUploads++; LLCurlRequest::headers_t headers; LLHTTPClient::post(caps_url, msg, -- cgit v1.2.3 From ce9a15bf989224ccda03d2d8461a3c619ae4339d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 19 Feb 2013 10:09:38 -0500 Subject: SH-3792 WIP - changed local texture loading to be consistent with viewer_development - this fixes the gray head issue. There is still some remaining issue with bakes not uploading at full resolution, probably due to a bad image asset. --- indra/newview/llvoavatarself.cpp | 41 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 7e24c43017..0e8e48099e 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2540,34 +2540,33 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe { if (!isIndexLocalTexture(type)) return; - if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR) + if (!covered_by_baked) { - imagep->setNoDelete(); - if (imagep->getDiscardLevel() != 0) + if (getLocalTextureID(type, index) != IMG_DEFAULT_AVATAR) { - F32 desired_pixels; - desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); - - // DRANO what priority should wearable-based textures have? - if (isUsingLocalAppearance()) + imagep->setNoDelete(); + if (imagep->getDiscardLevel() != 0) { + F32 desired_pixels; + desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); + imagep->setBoostLevel(getAvatarBoostLevel()); imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; - } - imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); - imagep->addTextureStats( desired_pixels / texel_area_ratio ); - imagep->forceUpdateBindStats() ; - if (imagep->getDiscardLevel() < 0) - { - mHasGrey = TRUE; // for statistics gathering + imagep->resetTextureStats(); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->addTextureStats( desired_pixels / texel_area_ratio ); + imagep->forceUpdateBindStats() ; + if (imagep->getDiscardLevel() < 0) + { + mHasGrey = TRUE; // for statistics gathering + } } } - } - else - { - // texture asset is missing - mHasGrey = TRUE; // for statistics gathering + else + { + // texture asset is missing + mHasGrey = TRUE; // for statistics gathering + } } } -- cgit v1.2.3 From b16dcda6a387774a446c04f63e1a55bd35ec7afe Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 25 Feb 2013 19:12:36 -0500 Subject: SH-3860 WIP, SH-3899 WIP - make folder version management more debuggable, log appearance request results --- indra/newview/llvoavatarself.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0e8e48099e..c069488a37 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -3049,8 +3049,6 @@ void LLVOAvatarSelf::dumpScratchTextureByteCount() llinfos << "Scratch Texture GL: " << (sScratchTexBytes/1024) << "KB" << llendl; } -void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value); - void LLVOAvatarSelf::dumpWearableInfo(LLAPRFile& outfile) { apr_file_t* file = outfile.getFileHandle(); -- cgit v1.2.3 From 312b2563548c19837707b6598932d8ef19430f73 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 1 Mar 2013 13:50:21 -0500 Subject: Periodic log messages to explain why user is still clouded, if they are --- indra/newview/llvoavatarself.cpp | 50 ++++++++++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 9 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c069488a37..d3c91f3339 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1946,19 +1946,41 @@ void LLVOAvatarSelf::dumpTotalLocalTextureByteCount() BOOL LLVOAvatarSelf::getIsCloud() const { + // Let people know why they're clouded without spamming them into oblivion. + bool do_warn = false; + static LLTimer time_since_notice; + F32 update_freq = 30.0; + if (time_since_notice.getElapsedTimeF32() > update_freq) + { + time_since_notice.reset(); + do_warn = true; + } + // do we have our body parts? - if (gAgentWearables.getWearableCount(LLWearableType::WT_SHAPE) == 0 || - gAgentWearables.getWearableCount(LLWearableType::WT_HAIR) == 0 || - gAgentWearables.getWearableCount(LLWearableType::WT_EYES) == 0 || - gAgentWearables.getWearableCount(LLWearableType::WT_SKIN) == 0) + S32 shape_count = gAgentWearables.getWearableCount(LLWearableType::WT_SHAPE); + S32 hair_count = gAgentWearables.getWearableCount(LLWearableType::WT_HAIR); + S32 eye_count = gAgentWearables.getWearableCount(LLWearableType::WT_EYES); + S32 skin_count = gAgentWearables.getWearableCount(LLWearableType::WT_SKIN); + if (!shape_count || !hair_count || !eye_count || !skin_count) { - lldebugs << "No body parts" << llendl; + if (do_warn) + { + llinfos << "Self is clouded due to missing one or more required body parts: " + << (shape_count ? "" : "SHAPE ") + << (hair_count ? "" : "HAIR ") + << (eye_count ? "" : "EYES ") + << (skin_count ? "" : "SKIN ") + << llendl; + } return TRUE; } if (!isTextureDefined(TEX_HAIR, 0)) { - lldebugs << "No hair texture" << llendl; + if (do_warn) + { + llinfos << "Self is clouded because of no hair texture" << llendl; + } return TRUE; } @@ -1967,14 +1989,20 @@ BOOL LLVOAvatarSelf::getIsCloud() const if (!isLocalTextureDataAvailable(getLayerSet(BAKED_LOWER)) && (!isTextureDefined(TEX_LOWER_BAKED, 0))) { - lldebugs << "Lower textures not baked" << llendl; + if (do_warn) + { + llinfos << "Self is clouded because lower textures not baked" << llendl; + } return TRUE; } if (!isLocalTextureDataAvailable(getLayerSet(BAKED_UPPER)) && (!isTextureDefined(TEX_UPPER_BAKED, 0))) { - lldebugs << "Upper textures not baked" << llendl; + if (do_warn) + { + llinfos << "Self is clouded because upper textures not baked" << llendl; + } return TRUE; } @@ -1991,7 +2019,11 @@ BOOL LLVOAvatarSelf::getIsCloud() const const LLViewerTexture* baked_img = getImage( texture_data.mTextureIndex, 0 ); if (!baked_img || !baked_img->hasGLTexture()) { - lldebugs << "Texture at index " << i << " (texture index is " << texture_data.mTextureIndex << ") is not loaded" << llendl; + if (do_warn) + { + llinfos << "Self is clouded because texture at index " << i + << " (texture index is " << texture_data.mTextureIndex << ") is not loaded" << llendl; + } return TRUE; } } -- cgit v1.2.3 From 9a0c52a247ecbd79f5f872ceb97a6be3e0499bea Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 5 Mar 2013 11:28:06 -0800 Subject: Adding debug setting to allow overriding appearance service url --- 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 d3c91f3339..3605383c5c 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2469,7 +2469,7 @@ void LLVOAvatarSelf::checkForUnsupportedServerBakeAppearance() return; // if baked image service is unknown, need to refresh. - if (gSavedSettings.getString("AgentAppearanceServiceURL").empty()) + if (LLAppearanceMgr::instance().getAppearanceServiceURL().empty()) { CheckAgentAppearanceServiceResponder::forceAppearanceUpdate(); } -- cgit v1.2.3 From 54cdc322b8f2bd35b289cacf3493622e7cc51194 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 5 Mar 2013 22:05:22 -0800 Subject: Fixing issues with not detecting when LLSD XML parsing fails. Changing most http error handlers to understand LLSD error responses. Fleshing out most http error handler message spam. --- indra/newview/llvoavatarself.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 3605383c5c..9be1de4f0e 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2264,7 +2264,7 @@ public: else { LL_WARNS("Avatar") << "Failed " << status << " reason " << reason << LL_ENDL; - error(status,reason); + errorWithContent(status,reason,content); } } @@ -2440,11 +2440,12 @@ public: } // Error - /*virtual*/ void error(U32 status, const std::string& reason) + /*virtual*/ void errorWithContent(U32 status, const std::string& reason, const LLSD& content) { if (isAgentAvatarValid()) { - LL_DEBUGS("Avatar") << "failed, will rebake" << llendl; + LL_DEBUGS("Avatar") << "failed, will rebake [status:" + << status << "]: " << content << llendl; forceAppearanceUpdate(); } } -- cgit v1.2.3 From 2784a515b0e725f74bf0e5fab47153ba358b26d6 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Wed, 6 Mar 2013 17:20:33 -0500 Subject: SH-3954 SH-3941 SH-3910 FIX local appearance does not update We suppress texture downloads for local textures not needed with server side baking. We need to explicitly re-set texture priority for local textures when entering appearance mode. --- indra/newview/llvoavatarself.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoavatarself.cpp') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d3c91f3339..66ad4ec394 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2963,8 +2963,9 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) gAgentAvatarp->idleUpdateAppearanceAnimation(); #endif - gAgentAvatarp->invalidateAll(); - gAgentAvatarp->updateMeshTextures(); + gAgentAvatarp->updateTextures(); // call updateTextureStats + gAgentAvatarp->invalidateAll(); // mark all bakes as dirty, request updates + gAgentAvatarp->updateMeshTextures(); // make sure correct textures are applied to the avatar mesh. } } -- cgit v1.2.3 From 5a436e46f6893719fc91a1cb70813671cb2a6d44 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 8 Mar 2013 17:07:17 -0500 Subject: SH-3959 WIP - pass information about type of fetched image - server bake, host bake, map tile, etc - down the chain so LLTextureFetchWorker can adjust behavior as needed --- 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 f7902c5302..240ab202f8 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2648,7 +2648,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) { // Baked textures live on other sims. LLHost target_host = getObjectHost(); - setTEImage( te, LLViewerTextureManager::getFetchedTextureFromHost( uuid, target_host ) ); + setTEImage( te, LLViewerTextureManager::getFetchedTextureFromHost( uuid, FTT_HOST_BAKE, target_host ) ); updateMeshTextures(); dirtyMesh(); -- cgit v1.2.3 From 7e967ce2fd78078fb4284f2d61171bc90a669375 Mon Sep 17 00:00:00 2001 From: Nyx Linden Date: Fri, 8 Mar 2013 18:45:33 -0500 Subject: SH-3941 SH-3954 FIX local appearance does not update properly We were using an indicator of whether there *was* a baked texture to whether we were *using* a baked texture. Switched to one of the (several) proper indicators of whether a baked texture was in use. This should allow local texture data to get marked for download when we enter appearance mode. Local testing confirms that old apperances linger for a second or two, but are soon replaced by the correct local renders. --- 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 f7902c5302..36229e51ec 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2964,9 +2964,9 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) gAgentAvatarp->idleUpdateAppearanceAnimation(); #endif - gAgentAvatarp->updateTextures(); // call updateTextureStats gAgentAvatarp->invalidateAll(); // mark all bakes as dirty, request updates gAgentAvatarp->updateMeshTextures(); // make sure correct textures are applied to the avatar mesh. + gAgentAvatarp->updateTextures(); // call updateTextureStats } } -- cgit v1.2.3