From 951f7571e8ca4b37bebe7e70926ca72b8476a3f7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 17 Feb 2012 09:45:03 -0500 Subject: SH-2968 WIP - simplified and consolidated DebugAvatarRezTime logging --- indra/newview/llvoavatar.cpp | 121 +++++++++++++++++-------------------------- indra/newview/llvoavatar.h | 1 + 2 files changed, 48 insertions(+), 74 deletions(-) mode change 100644 => 100755 indra/newview/llvoavatar.cpp mode change 100644 => 100755 indra/newview/llvoavatar.h (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp old mode 100644 new mode 100755 index bc7f5a9744..3de9e0099b --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -774,32 +774,39 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastPelvisFixup = 0.0f; } +void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) +{ + llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + << "sec ] Avatar '" << getFullname() + << "' RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() + << " Notification " << notification_name + << " : " << comment + << llendl; + + if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + { + LLSD args; + args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); + args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32()); + args["NAME"] = getFullname(); + LLNotificationsUtil::add(notification_name,args); + } +} + //------------------------------------------------------------------------ // LLVOAvatar::~LLVOAvatar() //------------------------------------------------------------------------ LLVOAvatar::~LLVOAvatar() { - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + if (!mFullyLoaded) { - if (!mFullyLoaded) - { - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' left after " << (U32)mRuthDebugTimer.getElapsedTimeF32() << " seconds as cloud." << llendl; - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32()); - args["NAME"] = getFullname(); - LLNotificationsUtil::add("AvatarRezLeftCloudNotification",args); - } - else - { - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' left." << llendl; - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["NAME"] = getFullname(); - LLNotificationsUtil::add("AvatarRezLeftNotification",args); - } - + debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); + } + else + { + debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); } + lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl; mRoot.removeAllChildren(); @@ -2252,18 +2259,12 @@ U32 LLVOAvatar::processUpdateMessage(LLMessageSystem *mesgsys, U32 retval = LLViewerObject::processUpdateMessage(mesgsys, user_data, block_num, update_type, dp); // Print out arrival information once we have name of avatar. - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + if (has_name && getNVPair("FirstName")) { - if (has_name && getNVPair("FirstName")) - { - mDebugExistenceTimer.reset(); - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["NAME"] = getFullname(); - LLNotificationsUtil::add("AvatarRezArrivedNotification",args); - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' arrived." << llendl; - } + mDebugExistenceTimer.reset(); + debugAvatarRezTime("AvatarRezArrivedNotification","avatar arrived"); } + if(retval & LLViewerObject::INVALID_UPDATE) { if (isSelf()) @@ -3006,34 +3007,23 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) is_muted = false; } else - { + { is_muted = LLMuteList::getInstance()->isMuted(getID()); } bool is_friend = LLAvatarTracker::instance().isBuddy(getID()); bool is_cloud = getIsCloud(); - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) - { - if (is_appearance != mNameAppearance) - { - if (is_appearance) - { - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["NAME"] = getFullname(); - LLNotificationsUtil::add("AvatarRezEnteredAppearanceNotification",args); - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' entered appearance mode." << llendl; - } - else - { - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["NAME"] = getFullname(); - LLNotificationsUtil::add("AvatarRezLeftAppearanceNotification",args); - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' left appearance mode." << llendl; - } - } - } + if (is_appearance != mNameAppearance) + { + if (is_appearance) + { + debugAvatarRezTime("AvatarRezEnteredAppearanceNotification","entered appearance mode"); + } + else + { + debugAvatarRezTime("AvatarRezLeftAppearanceNotification","left appearance mode"); + } + } // Rebuild name tag if state change detected if (mNameString.empty() @@ -3241,8 +3231,8 @@ void LLVOAvatar::clearNameTag() { mNameString.clear(); if (mNameText) - { - mNameText->setLabel(""); + { + mNameText->setLabel(""); mNameText->setString( "" ); } } @@ -6429,16 +6419,7 @@ void LLVOAvatar::updateRuthTimer(bool loading) if (mPreviousFullyLoaded) { mRuthTimer.reset(); - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) - { - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' became cloud." << llendl; - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32()); - args["NAME"] = getFullname(); - LLNotificationsUtil::add("AvatarRezCloudNotification",args); - } - mRuthDebugTimer.reset(); + debugAvatarRezTime("AvatarRezCloudNotification","became cloud"); } const F32 LOADING_TIMEOUT__SECONDS = 120.f; @@ -6466,17 +6447,9 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > PAUSE); - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) + if (!mPreviousFullyLoaded && !loading && mFullyLoaded) { - if (!mPreviousFullyLoaded && !loading && mFullyLoaded) - { - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ] Avatar '" << getFullname() << "' resolved in " << (U32)mRuthDebugTimer.getElapsedTimeF32() << " seconds." << llendl; - LLSD args; - args["EXISTENCE"] = llformat("%d",(U32)mDebugExistenceTimer.getElapsedTimeF32()); - args["TIME"] = llformat("%d",(U32)mRuthDebugTimer.getElapsedTimeF32()); - args["NAME"] = getFullname(); - LLNotificationsUtil::add("AvatarRezNotification",args); - } + debugAvatarRezTime("AvatarRezNotification","fully loaded"); } // did our loading state "change" from last call? diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h old mode 100644 new mode 100755 index dd0317f555..cadebb8b6a --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -983,6 +983,7 @@ private: // Avatar Rez Metrics //-------------------------------------------------------------------- public: + void debugAvatarRezTime(std::string notification_name, std::string comment = ""); F32 debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); } protected: LLFrameTimer mRuthDebugTimer; // For tracking how long it takes for av to rez -- cgit v1.2.3 From 4e081c96895cc7b0b176ce7d9289cf8265ea2838 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 17 Feb 2012 13:43:28 -0500 Subject: SH-2968 WIP - log avatar name in more places --- indra/newview/llappearancemgr.cpp | 111 ++++++++++++++++++++------------------ indra/newview/llvoavatar.cpp | 28 ++++++---- indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 3 +- 4 files changed, 82 insertions(+), 61 deletions(-) mode change 100644 => 100755 indra/newview/llappearancemgr.cpp mode change 100644 => 100755 indra/newview/llvoavatarself.cpp (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp old mode 100644 new mode 100755 index 33f5373d7e..27e2b1f135 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -50,6 +50,16 @@ #include "llviewerregion.h" #include "llwearablelist.h" +std::string self_av_string() +{ + static std::string av_name_string = ""; + if (av_name_string.empty() && gAgentAvatarp) + { + av_name_string = " Avatar '" + gAgentAvatarp->getFullname() + "' "; + } + return av_name_string; +} + // RAII thingy to guarantee that a variable gets reset when the Setter // goes out of scope. More general utility would be handy - TODO: // check boost. @@ -172,7 +182,7 @@ public: protected: ~LLWearInventoryCategoryCallback() { - llinfos << "done all inventory callbacks" << llendl; + llinfos << self_av_string() << "done all inventory callbacks" << llendl; // Is the destructor called by ordinary dereference, or because the app's shutting down? // If the inventory callback manager goes away, we're shutting down, no longer want the callback. @@ -182,7 +192,7 @@ protected: } else { - llwarns << "Dropping unhandled LLWearInventoryCategoryCallback" << llendl; + llwarns << self_av_string() << "Dropping unhandled LLWearInventoryCategoryCallback" << llendl; } } @@ -216,7 +226,7 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() { - llinfos << "done update appearance on destroy" << llendl; + llinfos << self_av_string() << "done update appearance on destroy" << llendl; if (!LLApp::isExiting()) { @@ -390,7 +400,7 @@ void LLWearableHoldingPattern::checkMissingWearables() { if (!isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } std::vector found_by_type(LLWearableType::WT_COUNT,0); @@ -408,7 +418,7 @@ void LLWearableHoldingPattern::checkMissingWearables() { if (requested_by_type[type] > found_by_type[type]) { - llwarns << "got fewer wearables than requested, type " << type << ": requested " << requested_by_type[type] << ", found " << found_by_type[type] << llendl; + llwarns << self_av_string() << "got fewer wearables than requested, type " << type << ": requested " << requested_by_type[type] << ", found " << found_by_type[type] << llendl; } if (found_by_type[type] > 0) continue; @@ -425,7 +435,7 @@ void LLWearableHoldingPattern::checkMissingWearables() mTypesToRecover.insert(type); mTypesToLink.insert(type); recoverMissingWearable((LLWearableType::EType)type); - llwarns << "need to replace " << type << llendl; + llwarns << self_av_string() << "need to replace " << type << llendl; } } @@ -445,13 +455,13 @@ void LLWearableHoldingPattern::onAllComplete() if (!isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } // Activate all gestures in this folder if (mGestItems.count() > 0) { - llinfos << "Activating " << mGestItems.count() << " gestures" << llendl; + llinfos << self_av_string() << "Activating " << mGestItems.count() << " gestures" << llendl; LLGestureMgr::instance().activateGestures(mGestItems); @@ -468,13 +478,13 @@ void LLWearableHoldingPattern::onAllComplete() } // Update wearables. - llinfos << "Updating agent wearables with " << mResolved << " wearable items " << llendl; + llinfos << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << llendl; LLAppearanceMgr::instance().updateAgentWearables(this, false); // Update attachments to match those requested. if (isAgentAvatarValid()) { - llinfos << "Updating " << mObjItems.count() << " attachments" << llendl; + llinfos << self_av_string() << "Updating " << mObjItems.count() << " attachments" << llendl; LLAgentWearables::userUpdateAttachments(mObjItems); } @@ -494,7 +504,7 @@ void LLWearableHoldingPattern::onFetchCompletion() { if (!isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } checkMissingWearables(); @@ -505,7 +515,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() { if (!isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } bool completed = isFetchCompleted(); @@ -514,14 +524,14 @@ bool LLWearableHoldingPattern::pollFetchCompletion() if (done) { - llinfos << "polling, done status: " << completed << " timed out " << timed_out + llinfos << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() << llendl; mFired = true; if (timed_out) { - llwarns << "Exceeded max wait time for wearables, updating appearance based on what has arrived" << llendl; + llwarns << self_av_string() << "Exceeded max wait time for wearables, updating appearance based on what has arrived" << llendl; } onFetchCompletion(); @@ -569,12 +579,12 @@ public: } else { - llwarns << "inventory item not found for recovered wearable" << llendl; + llwarns << self_av_string() << "inventory item not found for recovered wearable" << llendl; } } else { - llwarns << "inventory link not found for recovered wearable" << llendl; + llwarns << self_av_string() << "inventory link not found for recovered wearable" << llendl; } } private: @@ -596,10 +606,10 @@ public: { if (!mHolder->isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } - llinfos << "Recovered item for type " << mType << llendl; + llinfos << self_av_string() << "Recovered item for type " << mType << llendl; LLViewerInventoryItem *itemp = gInventory.getItem(item_id); mWearable->setItemID(item_id); LLPointer cb = new RecoveredItemLinkCB(mType,mWearable,mHolder); @@ -626,7 +636,7 @@ void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type { if (!isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } // Try to recover by replacing missing wearable with a new one. @@ -665,7 +675,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable)) { // Wearable link that was never resolved; remove links to it from COF - llinfos << "removing link for unresolved item " << data.mItemID.asString() << llendl; + llinfos << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << llendl; LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false); } } @@ -675,7 +685,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() { if (!isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } bool timed_out = isTimedOut(); @@ -684,7 +694,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (!done) { - llinfos << "polling missing wearables, waiting for items " << mTypesToRecover.size() + llinfos << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() << " links " << mTypesToLink.size() << " wearables, timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() @@ -722,14 +732,14 @@ void LLWearableHoldingPattern::handleLateArrivals() } if (!isMostRecent()) { - llwarns << "Late arrivals not handled - outfit change no longer valid" << llendl; + llwarns << self_av_string() << "Late arrivals not handled - outfit change no longer valid" << llendl; } if (!mIsAllComplete) { - llwarns << "Late arrivals not handled - in middle of missing wearables processing" << llendl; + llwarns << self_av_string() << "Late arrivals not handled - in middle of missing wearables processing" << llendl; } - llinfos << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << llendl; + llinfos << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << llendl; // Update mFoundList using late-arriving wearables. std::set replaced_types; @@ -805,19 +815,19 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) { if (!isMostRecent()) { - llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } mResolved += 1; // just counting callbacks, not successes. - llinfos << "resolved " << mResolved << "/" << getFoundList().size() << llendl; + llinfos << self_av_string() << "resolved " << mResolved << "/" << getFoundList().size() << llendl; if (!wearable) { - llwarns << "no wearable found" << llendl; + llwarns << self_av_string() << "no wearable found" << llendl; } if (mFired) { - llwarns << "called after holder fired" << llendl; + llwarns << self_av_string() << "called after holder fired" << llendl; if (wearable) { mLateArrivals.insert(wearable); @@ -843,7 +853,7 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) // Failing this means inventory or asset server are corrupted in a way we don't handle. if ((data.mWearableType >= LLWearableType::WT_COUNT) || (wearable->getType() != data.mWearableType)) { - llwarns << "recovered wearable but type invalid. inventory wearable type: " << data.mWearableType << " asset wearable type: " << wearable->getType() << llendl; + llwarns << self_av_string() << "recovered wearable but type invalid. inventory wearable type: " << data.mWearableType << " asset wearable type: " << wearable->getType() << llendl; break; } @@ -1416,7 +1426,7 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); - llinfos << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << llendl; + llinfos << self_av_string() << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << llendl; const LLUUID cof = getCOF(); @@ -1478,26 +1488,26 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) gInventory.notifyObservers(); // Create links to new COF contents. - llinfos << "creating LLUpdateAppearanceOnDestroy" << llendl; + llinfos << self_av_string() << "creating LLUpdateAppearanceOnDestroy" << llendl; LLPointer link_waiter = new LLUpdateAppearanceOnDestroy(!append); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "Linking body items" << llendl; + llinfos << self_av_string() << "Linking body items" << llendl; #endif linkAll(cof, body_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "Linking wear items" << llendl; + llinfos << self_av_string() << "Linking wear items" << llendl; #endif linkAll(cof, wear_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "Linking obj items" << llendl; + llinfos << self_av_string() << "Linking obj items" << llendl; #endif linkAll(cof, obj_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "Linking gesture items" << llendl; + llinfos << self_av_string() << "Linking gesture items" << llendl; #endif linkAll(cof, gest_items, link_waiter); @@ -1506,7 +1516,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { createBaseOutfitLink(category, link_waiter); } - llinfos << "waiting for LLUpdateAppearanceOnDestroy" << llendl; + llinfos << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << llendl; } void LLAppearanceMgr::updatePanelOutfitName(const std::string& name) @@ -1663,7 +1673,7 @@ void LLAppearanceMgr::enforceItemRestrictions() ++it) { LLViewerInventoryItem *item = *it; - llinfos << "purging duplicate or excess item " << item->getName() << llendl; + llinfos << self_av_string() << "purging duplicate or excess item " << item->getName() << llendl; gInventory.purgeObject(item->getUUID()); } gInventory.notifyObservers(); @@ -1680,7 +1690,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); - llinfos << "starting" << llendl; + llinfos << self_av_string() << "starting" << llendl; //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) @@ -1777,7 +1787,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) { LLFoundData& found = *it; - lldebugs << "waiting for onWearableAssetFetch callback, asset " << found.mAssetID.asString() << llendl; + lldebugs << self_av_string() << "waiting for onWearableAssetFetch callback, asset " << found.mAssetID.asString() << llendl; // Fetch the wearables about to be worn. LLWearableList::instance().getAsset(found.mAssetID, @@ -1851,7 +1861,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool gAgentWearables.notifyLoadingStarted(); - llinfos << "wearInventoryCategory( " << category->getName() + llinfos << self_av_string() << "wearInventoryCategory( " << category->getName() << " )" << llendl; callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, @@ -1861,7 +1871,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) { - llinfos << "starting" << llendl; + llinfos << self_av_string() << "starting" << llendl; // We now have an outfit ready to be copied to agent inventory. Do // it, and wear that outfit normally. @@ -1944,7 +1954,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego // wearables being dirty. if(!category) return; - llinfos << "wearInventoryCategoryOnAvatar( " << category->getName() + llinfos << self_av_string() << "wearInventoryCategoryOnAvatar( " << category->getName() << " )" << llendl; if (gAgentCamera.cameraCustomizeAvatar()) @@ -1958,7 +1968,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego void LLAppearanceMgr::wearOutfitByName(const std::string& name) { - llinfos << "Wearing category " << name << llendl; + llinfos << self_av_string() << "Wearing category " << name << llendl; //inc_busy_count(); LLInventoryModel::cat_array_t cat_array; @@ -2281,7 +2291,7 @@ const std::string OTHER_GESTURES_FOLDER = "Other Gestures"; void LLAppearanceMgr::copyLibraryGestures() { - llinfos << "Copying library gestures" << llendl; + llinfos << self_av_string() << "Copying library gestures" << llendl; // Copy gestures LLUUID lib_gesture_cat_id = @@ -2337,11 +2347,11 @@ void LLAppearanceMgr::copyLibraryGestures() LLUUID cat_id = findDescendentCategoryIDByName(lib_gesture_cat_id,folder_name); if (cat_id.isNull()) { - llwarns << "failed to find gesture folder for " << folder_name << llendl; + llwarns << self_av_string() << "failed to find gesture folder for " << folder_name << llendl; } else { - llinfos << "initiating fetch and copy for " << folder_name << " cat_id " << cat_id << llendl; + llinfos << self_av_string() << "initiating fetch and copy for " << folder_name << " cat_id " << cat_id << llendl; callAfterCategoryFetch(cat_id, boost::bind(&LLAppearanceMgr::shallowCopyCategory, &LLAppearanceMgr::instance(), @@ -2355,7 +2365,7 @@ void LLAppearanceMgr::autopopulateOutfits() // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account) // then auto-populate outfits from the library into the My Outfits folder. - llinfos << "avatar fully visible" << llendl; + llinfos << self_av_string() << "avatar fully visible" << llendl; static bool check_populate_my_outfits = true; if (check_populate_my_outfits && @@ -2731,7 +2741,7 @@ void LLAppearanceMgr::dumpCat(const LLUUID& cat_id, const std::string& msg) } void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items, - const std::string& msg) + const std::string& msg) { for (S32 i=0; igetAssetUUID(); } - llinfos << msg << " " << i <<" " << (item ? item->getName() : "(nullitem)") << " " << asset_id.asString() << llendl; + llinfos << self_av_string() << msg << " " << i <<" " << (item ? item->getName() : "(nullitem)") << " " << asset_id.asString() << llendl; } - llinfos << llendl; } LLAppearanceMgr::LLAppearanceMgr(): diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3de9e0099b..6a372eb5b3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -774,11 +774,17 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastPelvisFixup = 0.0f; } +std::string LLVOAvatar::avString() const +{ + return " Avatar '" + getFullname() + "' "; +} + void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) { llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ] Avatar '" << getFullname() - << "' RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() + << "sec ]" + << avString() + << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() << " Notification " << notification_name << " : " << comment << llendl; @@ -2775,12 +2781,16 @@ void LLVOAvatar::idleUpdateLoadingEffect() static bool first_fully_visible = true; if (first_fully_visible) { - llinfos << "self isFullyLoaded, first_fully_visible" << llendl; + llinfos << avString() << "self isFullyLoaded, first_fully_visible" << llendl; first_fully_visible = false; LLAppearanceMgr::instance().onFirstFullyVisible(); } } + if (isFullyLoaded() && !isSelf()) + { + llinfos << avString() << "other isFullyLoaded" << llendl; + } if (isFullyLoaded()) { deleteParticleSource(); @@ -6892,7 +6902,7 @@ LLColor4 LLVOAvatar::getDummyColor() void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const { - llinfos << (isSelf() ? "Self: " : "Other: ") << context << llendl; + llinfos << avString() << (isSelf() ? "Self: " : "Other: ") << context << llendl; for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); ++iter) @@ -6902,23 +6912,23 @@ void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const const LLViewerTexture* te_image = getImage(iter->first,0); if( !te_image ) { - llinfos << " " << texture_dict->mName << ": null ptr" << llendl; + llinfos << avString() << " " << texture_dict->mName << ": null ptr" << llendl; } else if( te_image->getID().isNull() ) { - llinfos << " " << texture_dict->mName << ": null UUID" << llendl; + llinfos << avString() << " " << texture_dict->mName << ": null UUID" << llendl; } else if( te_image->getID() == IMG_DEFAULT ) { - llinfos << " " << texture_dict->mName << ": IMG_DEFAULT" << llendl; + llinfos << avString() << " " << texture_dict->mName << ": IMG_DEFAULT" << llendl; } else if( te_image->getID() == IMG_DEFAULT_AVATAR ) { - llinfos << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl; + llinfos << avString() << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl; } else { - llinfos << " " << texture_dict->mName << ": " << te_image->getID() << llendl; + llinfos << avString() << " " << texture_dict->mName << ": " << te_image->getID() << llendl; } } } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index cadebb8b6a..1ed43f7ed9 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -882,6 +882,7 @@ private: public: std::string getFullname() const; // Returns "FirstName LastName" + std::string avString() const; // Frequently used string in log messages "Avatar '* labels); static void getAnimNames(LLDynamicArray* names); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp old mode 100644 new mode 100755 index f1df67494f..7cb254b92b --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2324,7 +2324,8 @@ void LLVOAvatarSelf::outputRezDiagnostics() const void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const { - LL_DEBUGS("Avatar Rez") + llinfos + << " Avatar '" << getFullname() << "' " << llformat("%s. Time from avatar creation: %.2f", msg.c_str(), mDebugSelfLoadTimer.getElapsedTimeF32()) << llendl; } -- cgit v1.2.3 From 89752e76495e2b553fb92165499baccb245860c6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 17 Feb 2012 16:38:08 -0500 Subject: SH-2968 WIP - more logging --- indra/newview/llappearancemgr.cpp | 8 ++++---- indra/newview/lltexlayer.cpp | 7 +++++-- indra/newview/llvoavatarself.cpp | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 6 deletions(-) mode change 100644 => 100755 indra/newview/lltexlayer.cpp (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 27e2b1f135..fe2a7bcb2d 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -239,7 +239,7 @@ void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item) LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item); const std::string item_name = item ? item->getName() : "ITEM NOT FOUND"; #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << llendl; + llinfos << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << llendl; #endif mFireCount++; } @@ -1401,8 +1401,8 @@ void LLAppearanceMgr::filterWearableItems( // Create links to all listed items. void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, - LLInventoryModel::item_array_t& items, - LLPointer cb) + LLInventoryModel::item_array_t& items, + LLPointer cb) { for (S32 i=0; igetName() : "CAT NOT FOUND"; #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << llendl; + llinfos << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << llendl; #endif } } diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp old mode 100644 new mode 100755 index 6f6d5dbf12..0802abd005 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -55,6 +55,9 @@ using namespace LLVOAvatarDefines; static const S32 BAKE_UPLOAD_ATTEMPTS = 7; static const F32 BAKE_UPLOAD_RETRY_DELAY = 2.f; // actual delay grows by power of 2 each attempt +// runway consolidate +extern std::string self_av_string(); + class LLTexLayerInfo { friend class LLTexLayer; @@ -577,7 +580,7 @@ void LLTexLayerSetBuffer::doUpload() args["BODYREGION"] = mTexLayerSet->getBodyRegionName(); args["RESOLUTION"] = lod_str; LLNotificationsUtil::add("AvatarRezSelfBakedTextureUploadNotification",args); - llinfos << "Uploading [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << llendl; + llinfos << self_av_string() << "Uploading [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << llendl; } } else @@ -631,7 +634,7 @@ void LLTexLayerSetBuffer::doUpdate() args["BODYREGION"] = mTexLayerSet->getBodyRegionName(); args["RESOLUTION"] = lod_str; LLNotificationsUtil::add("AvatarRezSelfBakedTextureUpdateNotification",args); - llinfos << "Locally updating [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUpdateTimer.getElapsedTimeF32() << " ]" << llendl; + llinfos << self_av_string() << "Locally updating [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUpdateTimer.getElapsedTimeF32() << " ]" << llendl; } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 7cb254b92b..a13b32e0e7 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2252,11 +2252,25 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) if (isAllLocalTextureDataFinal()) { LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args); + llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + << "sec ]" + << avString() + << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() + << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() + << " Notification " << "AvatarRezSelfBakedDoneNotification" + << llendl; } else { args["STATUS"] = debugDumpAllLocalTextureDataInfo(); LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args); + llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + << "sec ]" + << avString() + << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() + << " SelfLoadTimer " << (U32)mDebugSelfLoadTimer.getElapsedTimeF32() + << " Notification " << "AvatarRezSelfBakedUpdateNotification" + << llendl; } } -- cgit v1.2.3 From d8a7427c2e6baab711d62e719449375993980904 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Sat, 18 Feb 2012 08:28:17 +0000 Subject: Re-added eventhost nearyby host listener --- indra/newview/llnearbychatbar.cpp | 2 ++ indra/newview/llnearbychatbar.h | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'indra') diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 4512c14b7a..78f1fd583e 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -34,6 +34,7 @@ #include "llfirstuse.h" #include "llnearbychatbar.h" +#include "llnearbychatbarlistener.h" #include "llagent.h" #include "llgesturemgr.h" #include "llmultigesture.h" @@ -80,6 +81,7 @@ LLNearbyChatBar::LLNearbyChatBar(const LLSD& key) mExpandedHeight(COLLAPSED_HEIGHT + EXPANDED_HEIGHT) { mSpeakerMgr = LLLocalSpeakerMgr::getInstance(); + mListener.reset(new LLNearbyChatBarListener(*this)); } //virtual diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index baf12a06ea..bb07c60154 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -35,6 +35,8 @@ #include "lloutputmonitorctrl.h" #include "llspeakers.h" +class LLNearbyChatBarListener; + class LLNearbyChatBar : public LLFloater { public: @@ -92,6 +94,8 @@ protected: LLLocalSpeakerMgr* mSpeakerMgr; S32 mExpandedHeight; + + boost::shared_ptr mListener; }; #endif -- cgit v1.2.3 From dd499d55a051a2b05b6a5dfa77c5df0ab7406009 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 21 Feb 2012 21:39:54 +0000 Subject: Connected getGroups event host hook. --- indra/newview/llagentlistener.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra') diff --git a/indra/newview/llagentlistener.cpp b/indra/newview/llagentlistener.cpp index a8d2222c03..a4c0b056ac 100644 --- a/indra/newview/llagentlistener.cpp +++ b/indra/newview/llagentlistener.cpp @@ -126,6 +126,17 @@ LLAgentListener::LLAgentListener(LLAgent &agent) "[\"obj_uuid\"]: id of object to look at, use this or [\"position\"] to indicate the target\n" "[\"position\"]: region position {x, y, z} where to find closest object or avatar to look at", &LLAgentListener::lookAt); + add("getGroups", + "Send information about the agent's groups on [\"reply\"]:\n" + "[\"groups\"]: array of group information\n" + "[\"id\"]: group id\n" + "[\"name\"]: group name\n" + "[\"insignia\"]: group insignia texture id\n" + "[\"notices\"]: boolean indicating if this user accepts notices from this group\n" + "[\"display\"]: boolean indicating if this group is listed in the user's profile\n" + "[\"contrib\"]: user's land contribution to this group\n", + &LLAgentListener::getGroups, + LLSDMap("reply", LLSD())); } void LLAgentListener::requestTeleport(LLSD const & event_data) const -- cgit v1.2.3 From 04caf8c8764c0a433121acef6c7b7396c43550b2 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 21 Feb 2012 17:40:40 -0500 Subject: SH-2689 WIP - move first_fully_visible static into avatar class, bake-related logging --- indra/newview/llagent.cpp | 6 +++--- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llappearancemgr.cpp | 7 +------ indra/newview/llvoavatar.cpp | 22 ++++++++++------------ indra/newview/llvoavatar.h | 2 ++ 5 files changed, 17 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index ab9b5ff436..af3a409944 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3779,7 +3779,7 @@ void LLAgent::sendAgentSetAppearance() return; } - llinfos << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << llendl; + llinfos << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << llendl; //dumpAvatarTEs( "sendAgentSetAppearance()" ); LLMessageSystem* msg = gMessageSystem; @@ -3826,14 +3826,14 @@ void LLAgent::sendAgentSetAppearance() // only update cache entries if we have all our baked textures if (textures_current) { - llinfos << "TAT: Sending cached texture data" << llendl; + llinfos << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << llendl; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { BOOL generate_valid_hash = TRUE; if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLVOAvatarDefines::EBakedTextureIndex)baked_index)) { generate_valid_hash = FALSE; - llinfos << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << llendl; + llinfos << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << llendl; } const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 09305a5b4d..53ca0a214a 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1630,7 +1630,7 @@ void LLAgentWearables::queryWearableCache() gAgentAvatarp->outputRezTiming("Fetching textures from cache"); } - llinfos << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl; + llinfos << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl; gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); gAgentQueryManager.mNumPendingQueries++; gAgentQueryManager.mWearablesCacheQueryID++; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fe2a7bcb2d..e37a577460 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -52,12 +52,7 @@ std::string self_av_string() { - static std::string av_name_string = ""; - if (av_name_string.empty() && gAgentAvatarp) - { - av_name_string = " Avatar '" + gAgentAvatarp->getFullname() + "' "; - } - return av_name_string; + return gAgentAvatarp->avString(); } // RAII thingy to guarantee that a variable gets reset when the Setter diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 6a372eb5b3..317cdca090 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -687,6 +687,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNeedsSkin(FALSE), mLastSkinTime(0.f), mUpdatePeriod(1), + mFirstFullyVisible(TRUE), mFullyLoaded(FALSE), mPreviousFullyLoaded(FALSE), mFullyLoadedInitialized(FALSE), @@ -2776,20 +2777,16 @@ void LLVOAvatar::idleUpdateLoadingEffect() // update visibility when avatar is partially loaded if (updateIsFullyLoaded()) // changed? { - if (isFullyLoaded() && isSelf()) + if (isFullyLoaded() && mFirstFullyVisible && isSelf()) { - static bool first_fully_visible = true; - if (first_fully_visible) - { - llinfos << avString() << "self isFullyLoaded, first_fully_visible" << llendl; - - first_fully_visible = false; - LLAppearanceMgr::instance().onFirstFullyVisible(); - } + llinfos << avString() << "self isFullyLoaded, mFirstFullyVisible" << llendl; + mFirstFullyVisible = FALSE; + LLAppearanceMgr::instance().onFirstFullyVisible(); } - if (isFullyLoaded() && !isSelf()) + if (isFullyLoaded() && mFirstFullyVisible && !isSelf()) { - llinfos << avString() << "other isFullyLoaded" << llendl; + llinfos << avString() << "other isFullyLoaded, mFirstFullyVisible" << llendl; + mFirstFullyVisible = FALSE; } if (isFullyLoaded()) { @@ -6435,7 +6432,8 @@ void LLVOAvatar::updateRuthTimer(bool loading) const F32 LOADING_TIMEOUT__SECONDS = 120.f; if (mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT__SECONDS) { - llinfos << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' " + llinfos << avString() + << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' " << "( Params loaded : " << !visualParamWeightsAreDefault() << " ) " << "( Lower : " << isTextureDefined(TEX_LOWER_BAKED) << " ) " << "( Upper : " << isTextureDefined(TEX_UPPER_BAKED) << " ) " diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 1ed43f7ed9..e0202c38cd 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -285,6 +285,8 @@ protected: void updateRuthTimer(bool loading); F32 calcMorphAmount(); private: + // runway state-machine spaghetti + BOOL mFirstFullyVisible; BOOL mFullyLoaded; BOOL mPreviousFullyLoaded; BOOL mFullyLoadedInitialized; -- cgit v1.2.3 From 2ac6aaf760569c66fee150aa25c14eb8b0114d3d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 22 Feb 2012 10:24:23 -0500 Subject: merge --- indra/newview/llappearancemgr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index e37a577460..83eed6c0c9 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -395,6 +395,7 @@ void LLWearableHoldingPattern::checkMissingWearables() { if (!isMostRecent()) { + // runway why don't we actually skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } @@ -450,6 +451,7 @@ void LLWearableHoldingPattern::onAllComplete() if (!isMostRecent()) { + // runway need to skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } @@ -499,6 +501,7 @@ void LLWearableHoldingPattern::onFetchCompletion() { if (!isMostRecent()) { + // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } @@ -510,6 +513,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() { if (!isMostRecent()) { + // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } @@ -548,6 +552,7 @@ public: if (!mHolder->isMostRecent()) { llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + // runway skip here? } llinfos << "Recovered item link for type " << mType << llendl; @@ -601,6 +606,7 @@ public: { if (!mHolder->isMostRecent()) { + // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } @@ -631,6 +637,7 @@ void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type { if (!isMostRecent()) { + // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } @@ -680,6 +687,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() { if (!isMostRecent()) { + // runway skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } -- cgit v1.2.3 From 709745f5a646b8c96e26f85d0f3e02f81af4fd31 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 23 Feb 2012 13:26:59 -0500 Subject: SH-2689 WIP --- indra/newview/llvoavatar.cpp | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 317cdca090..d63fb1d885 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3956,7 +3956,7 @@ void LLVOAvatar::updateVisibility() LLNameValue* firstname = getNVPair("FirstName"); if (firstname) { - llinfos << "Avatar " << firstname->getString() << " updating visiblity" << llendl; + llinfos << avString() << " updating visiblity" << llendl; } else { @@ -6461,6 +6461,7 @@ BOOL LLVOAvatar::processFullyLoadedChange(bool loading) } // did our loading state "change" from last call? + // runway - why are we updating every 30 calls even if nothing has changed? const S32 UPDATE_RATE = 30; BOOL changed = ((mFullyLoaded != mPreviousFullyLoaded) || // if the value is different from the previous call @@ -7057,6 +7058,7 @@ void LLVOAvatar::rebuildHUD() //----------------------------------------------------------------------------- void LLVOAvatar::onFirstTEMessageReceived() { + llinfos << avString() << llendl; if( !mFirstTEMessageReceived ) { mFirstTEMessageReceived = TRUE; @@ -7085,6 +7087,7 @@ void LLVOAvatar::onFirstTEMessageReceived() image->setLoadedCallback( onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID ), src_callback_list, paused); } + llinfos << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << llendl; image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); } @@ -7143,14 +7146,16 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LLMemType mt(LLMemType::MTYPE_AVATAR); -// llinfos << "processAvatarAppearance start " << mID << llendl; BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; - mFirstAppearanceMessageReceived = TRUE; + llinfos << avString() << "processAvatarAppearance start " << mID + << " first? " << is_first_appearance_message << " self? " << isSelf() << llendl; + + if( isSelf() ) { - llwarns << "Received AvatarAppearance for self" << llendl; + llwarns << avString() << "Received AvatarAppearance for self" << llendl; if( mFirstTEMessageReceived ) { // llinfos << "processAvatarAppearance end " << mID << llendl; @@ -7178,7 +7183,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } - if( !is_first_appearance_message ) + // runway - is this right? Will be called every time *except* the first. + // FIXME - trying toggle + if (is_first_appearance_message ) { onFirstTEMessageReceived(); } @@ -7199,6 +7206,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing if( num_blocks > 1 && !drop_visual_params_debug) { + llinfos << avString() << " handle visual params, num_blocks " << num_blocks << llendl; BOOL params_changed = FALSE; BOOL interp_params = FALSE; @@ -7271,6 +7279,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) else { // AvatarAppearance message arrived without visual params + llinfos << avString() << "no visual params" << llendl; if (drop_visual_params_debug) { llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl; @@ -7423,8 +7432,15 @@ void LLVOAvatar::onBakedTextureMasksLoaded( BOOL success, LLViewerFetchedTexture // static void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata ) { + + LLUUID *avatar_idp = (LLUUID *)userdata; LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); + + if (selfp) + { + llinfos << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << llendl; + } if (!success && selfp) { @@ -7443,6 +7459,10 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_ LLUUID id = src_vi->getID(); LLUUID *avatar_idp = (LLUUID *)userdata; LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); + if (selfp) + { + llinfos << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << llendl; + } if (selfp && !success) { @@ -7464,6 +7484,8 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_ // Called when baked texture is loaded and also when we start up with a baked texture void LLVOAvatar::useBakedTexture( const LLUUID& id ) { + + /* if(id == head_baked->getID()) mHeadBakedLoaded = TRUE; mLastHeadBakedID = id; -- cgit v1.2.3 From 51d5147f470d114c16674df75608cc6153df3b3f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 27 Feb 2012 09:25:33 -0500 Subject: avatar logging and cleanup --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llvoavatar.cpp | 16 ++++++++++------ indra/newview/llvoavatar.h | 1 - 3 files changed, 11 insertions(+), 8 deletions(-) mode change 100644 => 100755 indra/newview/app_settings/settings.xml (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml old mode 100644 new mode 100755 index 0e26013152..c1f65ca7f5 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1914,7 +1914,7 @@ Type Boolean Value - 0 + 1 DebugBeaconLineWidth diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index d63fb1d885..21ba3b60f3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2997,10 +2997,10 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) } void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) - { - LLNameValue *title = getNVPair("Title"); - LLNameValue* firstname = getNVPair("FirstName"); - LLNameValue* lastname = getNVPair("LastName"); +{ + LLNameValue *title = getNVPair("Title"); + LLNameValue* firstname = getNVPair("FirstName"); + LLNameValue* lastname = getNVPair("LastName"); // Avatars must have a first and last name if (!firstname || !lastname) return; @@ -7452,7 +7452,10 @@ void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTextu } } -void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, S32 discard_level, BOOL final, void* userdata) +// Static +void LLVOAvatar::onBakedTextureLoaded(BOOL success, + LLViewerFetchedTexture *src_vi, LLImageRaw* src, LLImageRaw* aux_src, + S32 discard_level, BOOL final, void* userdata) { //llinfos << "onBakedTextureLoaded: " << src_vi->getID() << llendl; @@ -7461,7 +7464,7 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLViewerFetchedTexture *src_ LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); if (selfp) { - llinfos << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << llendl; + llinfos << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << llendl; } if (selfp && !success) @@ -7496,6 +7499,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 ); if (id == image_baked->getID()) { + llinfos << avString() << " i " << i << " id " << id << llendl; mBakedTextureDatas[i].mIsLoaded = true; mBakedTextureDatas[i].mLastTextureIndex = id; mBakedTextureDatas[i].mIsUsed = true; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index e0202c38cd..e2a6617c5f 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -285,7 +285,6 @@ protected: void updateRuthTimer(bool loading); F32 calcMorphAmount(); private: - // runway state-machine spaghetti BOOL mFirstFullyVisible; BOOL mFullyLoaded; BOOL mPreviousFullyLoaded; -- cgit v1.2.3 From 55b5d6b7b45e956d6927461d8a0ef153ec3c7770 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 27 Feb 2012 17:20:55 -0500 Subject: SH-2689 WIP - tracking cloud/gray/textured state for avs, display with rendering cost --- indra/newview/llviewerjointmesh.cpp | 1 - indra/newview/llviewerjointmesh.h | 1 + indra/newview/llvoavatar.cpp | 69 ++++++++++++++++++++++++++++++++----- indra/newview/llvoavatar.h | 7 ++-- indra/newview/llvoavatarself.cpp | 2 +- indra/newview/llvoavatarself.h | 2 +- 6 files changed, 68 insertions(+), 14 deletions(-) mode change 100644 => 100755 indra/newview/llviewerjointmesh.cpp mode change 100644 => 100755 indra/newview/llviewerjointmesh.h (limited to 'indra') diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp old mode 100644 new mode 100755 index 76f4e18c27..20573c8fba --- a/indra/newview/llviewerjointmesh.cpp +++ b/indra/newview/llviewerjointmesh.cpp @@ -577,7 +577,6 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy) { old_mode = mTexture->getAddressMode(); } - gGL.getTexUnit(diffuse_channel)->bind(mTexture.get()); gGL.getTexUnit(diffuse_channel)->bind(mTexture); gGL.getTexUnit(diffuse_channel)->setTextureAddressMode(LLTexUnit::TAM_CLAMP); } diff --git a/indra/newview/llviewerjointmesh.h b/indra/newview/llviewerjointmesh.h old mode 100644 new mode 100755 index 0191f0cae8..dd5dae1dc1 --- a/indra/newview/llviewerjointmesh.h +++ b/indra/newview/llviewerjointmesh.h @@ -61,6 +61,7 @@ public: //----------------------------------------------------------------------------- class LLViewerJointMesh : public LLViewerJoint { + friend class LLVOAvatar; protected: LLColor4 mColor; // color value // LLColor4 mSpecular; // specular color (always white for now) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 21ba3b60f3..f027429c79 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -777,7 +777,14 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, std::string LLVOAvatar::avString() const { - return " Avatar '" + getFullname() + "' "; + std::string viz_string; + if (getIsCloud()) + viz_string = "cloud"; + else if (isFullyTextured()) + viz_string = "textured"; + else + viz_string = "gray"; + return " Avatar '" + getFullname() + "' " + viz_string + " "; } void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) @@ -895,6 +902,44 @@ BOOL LLVOAvatar::isFullyBaked() return TRUE; } +BOOL LLVOAvatar::isFullyTextured() const +{ + for (std::vector::const_iterator jointIter = mMeshLOD.begin(); + jointIter != mMeshLOD.end(); ++jointIter) + { + LLViewerJoint* joint = (LLViewerJoint*) *jointIter; + if (!joint) + { + continue; // nonexistent LOD OK. + } + std::vector::iterator meshIter = joint->mMeshParts.begin(); + if (meshIter != joint->mMeshParts.end()) + { + LLViewerJointMesh *mesh = (LLViewerJointMesh *) *meshIter; + if (!mesh) + { + continue; // nonexistent mesh OK + } + if (mesh->mTexture.notNull() && mesh->mTexture->hasGLTexture()) + { + continue; // Mesh exists and has a baked texture. + } + if (mesh->mLayerSet && mesh->mLayerSet->hasComposite()) + { + continue; // Mesh exists and has a composite texture. + } + // Fail + return FALSE; + } + } + return TRUE; +} + +BOOL LLVOAvatar::hasGray() const +{ + return !getIsCloud() && !isFullyTextured(); +} + void LLVOAvatar::deleteLayerSetCaches(bool clearAll) { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -4122,11 +4167,11 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) { //LOD changed or new mesh created, allocate new vertex buffer if needed if (needs_rebuild || mDirtyMesh >= 2 || mVisibilityRank <= 4) { - updateMeshData(); + updateMeshData(); mDirtyMesh = 0; - mNeedsSkin = TRUE; - mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); - } + mNeedsSkin = TRUE; + mDrawable->clearState(LLDrawable::REBUILD_GEOMETRY); + } } if (LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_AVATAR) <= 0) @@ -6385,10 +6430,10 @@ BOOL LLVOAvatar::isVisible() const } // Determine if we have enough avatar data to render -BOOL LLVOAvatar::getIsCloud() +BOOL LLVOAvatar::getIsCloud() const { // Do we have a shape? - if (visualParamWeightsAreDefault()) + if ((const_cast(this))->visualParamWeightsAreDefault()) { return TRUE; } @@ -8468,7 +8513,15 @@ void LLVOAvatar::idleUpdateRenderCost() } } - setDebugText(llformat("%d", cost)); + + std::string viz_string; + if (getIsCloud()) + viz_string = "cloud"; + else if (isFullyTextured()) + viz_string = "textured"; + else + viz_string = "gray"; + setDebugText(llformat("%s %d", viz_string.c_str(), cost)); mVisualComplexity = cost; F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); F32 red = llmin((F32) cost/(F32)ARC_LIMIT, 1.f); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index e2a6617c5f..bab4f02caf 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -277,9 +277,11 @@ public: public: BOOL isFullyLoaded() const; bool isTooComplex() const; - bool visualParamWeightsAreDefault(); + bool visualParamWeightsAreDefault(); + virtual BOOL getIsCloud() const; + BOOL isFullyTextured() const; + BOOL hasGray() const; protected: - virtual BOOL getIsCloud(); BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); @@ -519,7 +521,6 @@ public: virtual BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, U32 index = 0) const; virtual BOOL isTextureVisible(LLVOAvatarDefines::ETextureIndex type, LLWearable *wearable) const; -protected: BOOL isFullyBaked(); static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a13b32e0e7..fcdb4e3c63 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -1888,7 +1888,7 @@ void LLVOAvatarSelf::dumpTotalLocalTextureByteCount() llinfos << "Total Avatar LocTex GL:" << (gl_bytes/1024) << "KB" << llendl; } -BOOL LLVOAvatarSelf::getIsCloud() +BOOL LLVOAvatarSelf::getIsCloud() const { // do we have our body parts? if (gAgentWearables.getWearableCount(LLWearableType::WT_SHAPE) == 0 || diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 54dbe81993..6aadf4533e 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -121,7 +121,7 @@ public: // Loading state //-------------------------------------------------------------------- public: - /*virtual*/ BOOL getIsCloud(); + /*virtual*/ BOOL getIsCloud() const; //-------------------------------------------------------------------- // Region state -- cgit v1.2.3 From 2959bcd3de68d6a71f0f09cfa8b95d6fb8c9cdab Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 27 Feb 2012 18:13:06 -0500 Subject: SH-2689 WIP - fix for isFullyTextured when no skirt worn --- indra/newview/llvoavatar.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f027429c79..fcb774f0e5 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -904,10 +904,13 @@ BOOL LLVOAvatar::isFullyBaked() BOOL LLVOAvatar::isFullyTextured() const { - for (std::vector::const_iterator jointIter = mMeshLOD.begin(); - jointIter != mMeshLOD.end(); ++jointIter) + for (S32 i = 0; i < mMeshLOD.size(); i++) { - LLViewerJoint* joint = (LLViewerJoint*) *jointIter; + LLViewerJoint* joint = (LLViewerJoint*) mMeshLOD[i]; + if (i==MESH_ID_SKIRT && !isWearingWearableType(LLWearableType::WT_SKIRT)) + { + continue; // don't care about skirt textures if we're not wearing one. + } if (!joint) { continue; // nonexistent LOD OK. -- cgit v1.2.3 From 07545e99fcb70c8bce34fc7a8c5a84c40f39174a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 Feb 2012 13:09:28 -0500 Subject: SH-2689 FIX - a bit more logging and related cleanup. Somewhat arbitrarily calling this done, although tweaks will be ongoing --- indra/llprimitive/llprimitive.cpp | 0 indra/newview/llvoavatar.cpp | 9 +++++---- indra/newview/llvoavatarself.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 indra/llprimitive/llprimitive.cpp (limited to 'indra') diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp old mode 100644 new mode 100755 diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index fcb774f0e5..8ea0fb7c50 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4004,7 +4004,7 @@ void LLVOAvatar::updateVisibility() LLNameValue* firstname = getNVPair("FirstName"); if (firstname) { - llinfos << avString() << " updating visiblity" << llendl; + llinfos << avString() << " updating visibility" << llendl; } else { @@ -4216,7 +4216,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) LLNameValue* firstname = getNVPair("FirstName"); if (firstname) { - llinfos << "Avatar " << firstname->getString() << " in render" << llendl; + llinfos << avString() << " in render" << llendl; } else { @@ -7231,8 +7231,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) } - // runway - is this right? Will be called every time *except* the first. - // FIXME - trying toggle + // runway - was + // if (!is_first_appearance_message ) + // which means it would be called on second appearance message - probably wrong. if (is_first_appearance_message ) { onFirstTEMessageReceived(); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index fcdb4e3c63..e0af6c3995 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2339,7 +2339,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const { llinfos - << " Avatar '" << getFullname() << "' " + << avString() << llformat("%s. Time from avatar creation: %.2f", msg.c_str(), mDebugSelfLoadTimer.getElapsedTimeF32()) << llendl; } -- cgit v1.2.3 From e2edb5b7519606b31681a00bd01eaa732d75577d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 29 Feb 2012 13:24:02 -0500 Subject: SH-3018 WIP - removed obsolete texture category and texture size consoles --- indra/newview/lldebugview.cpp | 26 -- indra/newview/lltextureview.cpp | 300 --------------------- indra/newview/lltextureview.h | 35 --- indra/newview/llviewermenu.cpp | 16 -- indra/newview/skins/default/xui/en/menu_viewer.xml | 22 -- 5 files changed, 399 deletions(-) mode change 100644 => 100755 indra/newview/lltextureview.cpp (limited to 'indra') diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index 7d3170cb76..bba5d7c459 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -68,8 +68,6 @@ LLDebugView::~LLDebugView() gDebugView = NULL; gTextureView = NULL; gSceneView = NULL; - gTextureSizeView = NULL; - gTextureCategoryView = NULL; } void LLDebugView::init() @@ -122,30 +120,6 @@ void LLDebugView::init() gTextureView = LLUICtrlFactory::create(tvp); addChild(gTextureView); //gTextureView->reshape(r.getWidth(), r.getHeight(), TRUE); - - - if(gAuditTexture) - { - r.set(150, rect.getHeight() - 50, 900 + LLImageGL::sTextureLoadedCounter.size() * 30, 100); - LLTextureSizeView::Params tsv ; - tsv.name("gTextureSizeView"); - tsv.rect(r); - tsv.follows.flags(FOLLOWS_BOTTOM|FOLLOWS_LEFT); - tsv.visible(false); - gTextureSizeView = LLUICtrlFactory::create(tsv); - addChild(gTextureSizeView); - gTextureSizeView->setType(LLTextureSizeView::TEXTURE_MEM_OVER_SIZE) ; - - r.set(150, rect.getHeight() - 50, 900 + LLViewerTexture::getTotalNumOfCategories() * 30, 100); - LLTextureSizeView::Params tcv ; - tcv.name("gTextureCategoryView"); - tcv.rect(r); - tcv.follows.flags(FOLLOWS_BOTTOM|FOLLOWS_LEFT); - tcv.visible(false); - gTextureCategoryView = LLUICtrlFactory::create(tcv); - gTextureCategoryView->setType(LLTextureSizeView::TEXTURE_MEM_OVER_CATEGORY); - addChild(gTextureCategoryView); - } } void LLDebugView::draw() diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp old mode 100644 new mode 100755 index 1c89766b26..69422bfc5a --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -57,8 +57,6 @@ extern F32 texmem_lower_bound_scale; LLTextureView *gTextureView = NULL; -LLTextureSizeView *gTextureSizeView = NULL; -LLTextureSizeView *gTextureCategoryView = NULL; #define HIGH_PRIORITY 100000000.f @@ -1049,302 +1047,4 @@ BOOL LLTextureView::handleKey(KEY key, MASK mask, BOOL called_from_parent) return FALSE; } -//----------------------------------------------------------------- -LLTextureSizeView::LLTextureSizeView(const LLTextureSizeView::Params& p) : LLContainerView(p) -{ - setVisible(FALSE) ; - - mTextureSizeBarWidth = 30 ; -} - -LLTextureSizeView::~LLTextureSizeView() -{ - if(mTextureSizeBar.size()) - { - for(U32 i = 0 ; i < mTextureSizeBar.size() ; i++) - { - delete mTextureSizeBar[i] ; - } - mTextureSizeBar.clear() ; - } -} -void LLTextureSizeView::draw() -{ - if(mType == TEXTURE_MEM_OVER_SIZE) - { - drawTextureSizeGraph(); - } - else - { - drawTextureCategoryGraph() ; - } - - LLView::draw(); -} - -BOOL LLTextureSizeView::handleHover(S32 x, S32 y, MASK mask) -{ - if(x > mTextureSizeBarRect.mLeft && x < mTextureSizeBarRect.mRight) - { - mTextureSizeBar[(x - mTextureSizeBarRect.mLeft) / mTextureSizeBarWidth]->handleHover(x, y, mask, (mType == TEXTURE_MEM_OVER_SIZE)) ; - } - - return TRUE ; -} - -//draw real-time texture mem bar over size -void LLTextureSizeView::drawTextureSizeGraph() -{ - if(mTextureSizeBar.size() == 0) - { - S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); - mTextureSizeBar.resize(LLImageGL::sTextureLoadedCounter.size()) ; - mTextureSizeBarRect.set(700, line_height * 2 + 400, 700 + mTextureSizeBar.size() * mTextureSizeBarWidth, line_height * 2) ; - - for(U32 i = 0 ; i < mTextureSizeBar.size() ; i++) - { - mTextureSizeBar[i] = new LLGLTexSizeBar(i, mTextureSizeBarRect.mLeft + i * mTextureSizeBarWidth , - line_height * 2, mTextureSizeBarRect.mLeft + (i + 1) * mTextureSizeBarWidth, line_height) ; - } - } - - F32 size_bar_scale = drawTextureSizeDistributionGraph() ; - for(U32 i = 0 ; i < mTextureSizeBar.size() ; i++) - { - mTextureSizeBar[i]->setTop(LLImageGL::sTextureLoadedCounter[i], LLImageGL::sTextureBoundCounter[i], size_bar_scale) ; - mTextureSizeBar[i]->draw() ; - } - LLImageGL::resetCurTexSizebar(); -} - -//draw background of texture size bar graph -F32 LLTextureSizeView::drawTextureSizeDistributionGraph() -{ - //scale - F32 scale = 1.0f ; - - LLGLSUIDefault gls_ui; - - { - S32 count = 0 ; - for(U32 i = 0 ; i < LLImageGL::sTextureLoadedCounter.size() ; i++) - { - if(LLImageGL::sTextureLoadedCounter[i] > count) - { - count = LLImageGL::sTextureLoadedCounter[i] ; - } - } - if(count > mTextureSizeBarRect.getHeight()) - { - scale = (F32)mTextureSizeBarRect.getHeight() / count ; - } - } - S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); - S32 left = mTextureSizeBarRect.mLeft ; - S32 bottom = mTextureSizeBarRect.mBottom ; - S32 right = mTextureSizeBarRect.mRight ; - S32 top = mTextureSizeBarRect.mTop ; - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - //background rect - gl_rect_2d(left - 25, top + 30, right + 100, bottom - 25, LLColor4(0.0f, 0.0f, 0.0f, 0.25f)) ; - - //-------------------------------------------------- - gGL.color4f(1.0f, 0.5f, 0.5f, 0.75f); - gl_line_2d(left, bottom, right, bottom) ; //x axis - gl_line_2d(left, bottom, left, top) ; //y axis - - //ruler - //-------------------------------------------------- - gGL.color4f(1.0f, 0.5f, 0.5f, 0.5f); - for(S32 i = bottom + 50 ; i <= top ; i += 50) - { - gl_line_2d(left, i, right, i) ; - } - - //texts - //-------------------------------------------------- - F32 text_color[] = {1.f, 1.f, 1.f, 0.75f}; - std::string text; - - //------- - //x axis: size label - text = llformat("%d", 0) ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 12, bottom - line_height / 2, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - for(U32 i = 1 ; i < mTextureSizeBar.size() ; i++) - { - text = llformat("%d", (1 << (i / 2)) + ((i & 1) ? ((1 << (i / 2)) >> 1) : 0)) ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + i * mTextureSizeBarWidth + 12, bottom - line_height / 2, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - } - text = llformat("(w + h)/2") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, right + 10, bottom - line_height / 2, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - //------- - - //y axis: number label - for(S32 i = bottom + 50 ; i <= top ; i += 50) - { - text = llformat("%d", (S32)((i - bottom) / scale)) ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left - 20, i + line_height / 2 , - text_color, LLFontGL::LEFT, LLFontGL::TOP); - LLFontGL::getFontMonospace()->renderUTF8(text, 0, right + 5, i + line_height / 2 , - text_color, LLFontGL::LEFT, LLFontGL::TOP); - } - - //-------------------------------------------------- - F32 loaded_color[] = {1.0f, 0.0f, 0.0f, 0.75f}; - gl_rect_2d(left + 70, top + line_height * 2, left + 90, top + line_height, loaded_color) ; - text = llformat("Loaded") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 100, top + line_height * 2, - loaded_color, LLFontGL::LEFT, LLFontGL::TOP); - - F32 bound_color[] = {1.0f, 1.0f, 0.0f, 0.75f}; - gl_rect_2d(left + 170, top + line_height * 2, left + 190, top + line_height, bound_color) ; - text = llformat("Bound") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 200, top + line_height * 2, - bound_color, LLFontGL::LEFT, LLFontGL::TOP); - - //-------------------------------------------------- - - //title - text = llformat("Texture Size Distribution") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 250, top + line_height * 3, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - return scale ; -} - -//draw real-time texture mem bar over category -void LLTextureSizeView::drawTextureCategoryGraph() -{ - if(mTextureSizeBar.size() == 0) - { - S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); - mTextureSizeBar.resize(LLViewerTexture::getTotalNumOfCategories()) ; - mTextureSizeBarRect.set(700, line_height * 2 + 400, 700 + mTextureSizeBar.size() * mTextureSizeBarWidth, line_height * 2) ; - - for(U32 i = 0 ; i < mTextureSizeBar.size() ; i++) - { - mTextureSizeBar[i] = new LLGLTexSizeBar(i, mTextureSizeBarRect.mLeft + i * mTextureSizeBarWidth , - line_height * 2, mTextureSizeBarRect.mLeft + (i + 1) * mTextureSizeBarWidth, line_height) ; - } - } - - F32 size_bar_scale = drawTextureCategoryDistributionGraph() ; - for(U32 i = 0 ; i < mTextureSizeBar.size() ; i++) - { - U32 k = LLViewerTexture::getIndexFromCategory(i) ; - mTextureSizeBar[i]->setTop(LLImageGL::sTextureMemByCategory[k] >> 20, LLImageGL::sTextureMemByCategoryBound[k] >> 20, size_bar_scale) ; - mTextureSizeBar[i]->draw() ; - } - LLImageGL::resetCurTexSizebar(); -} - -//draw background for TEXTURE_MEM_OVER_CATEGORY -F32 LLTextureSizeView::drawTextureCategoryDistributionGraph() -{ - //scale - F32 scale = 4.0f ; - - LLGLSUIDefault gls_ui; - - { - S32 count = 0 ; - for(U32 i = 0 ; i < LLImageGL::sTextureMemByCategory.size() ; i++) - { - S32 tmp = LLImageGL::sTextureMemByCategory[i] >> 20 ; - if(tmp > count) - { - count = tmp ; - } - } - if(count > mTextureSizeBarRect.getHeight() * 0.25f) - { - scale = (F32)mTextureSizeBarRect.getHeight() * 0.25f / count ; - } - } - - S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); - S32 left = mTextureSizeBarRect.mLeft ; - S32 bottom = mTextureSizeBarRect.mBottom ; - S32 right = mTextureSizeBarRect.mRight ; - S32 top = mTextureSizeBarRect.mTop ; - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - //background rect - gl_rect_2d(left - 25, top + 30, right + 100, bottom - 25, LLColor4(0.0f, 0.0f, 0.0f, 0.25f)) ; - - //-------------------------------------------------- - gGL.color4f(1.0f, 0.5f, 0.5f, 0.75f); - gl_line_2d(left, bottom, right, bottom) ; //x axis - gl_line_2d(left, bottom, left, top) ; //y axis - - //ruler - //-------------------------------------------------- - gGL.color4f(1.0f, 0.5f, 0.5f, 0.5f); - for(S32 i = bottom + 50 ; i <= top ; i += 50) - { - gl_line_2d(left, i, right, i) ; - } - - //texts - //-------------------------------------------------- - F32 text_color[] = {1.f, 1.f, 1.f, 0.75f}; - std::string text; - - //------- - //x axis: size label - static char category[LLViewerTexture::MAX_GL_IMAGE_CATEGORY][4] = - {"Non", "Bak", "Av", "Cld", "Scp", "Hi", "Trn", "Slt", "Hud", "Bsf", "UI", "Pvw", "Map", "Mvs", "Slf", "Loc", "Scr", "Dyn", "Mdi", "ALT", "Oth" } ; - - text = llformat("%s", category[0]) ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 12, bottom - line_height / 2, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - for(U32 i = 1 ; i < mTextureSizeBar.size() ; i++) - { - text = llformat("%s", category[i]) ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + i * mTextureSizeBarWidth + 12, bottom - line_height / 2, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - } - //------- - - //y axis: number label - for(S32 i = bottom + 50 ; i <= top ; i += 50) - { - text = llformat("%d", (S32)((i - bottom) / scale)) ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left - 20, i + line_height / 2 , - text_color, LLFontGL::LEFT, LLFontGL::TOP); - LLFontGL::getFontMonospace()->renderUTF8(text, 0, right + 5, i + line_height / 2 , - text_color, LLFontGL::LEFT, LLFontGL::TOP); - } - - text = llformat("MB") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left - 20, top + line_height * 2 , - text_color, LLFontGL::LEFT, LLFontGL::TOP); - //-------------------------------------------------- - F32 loaded_color[] = {1.0f, 0.0f, 0.0f, 0.75f}; - gl_rect_2d(left + 70, top + line_height * 2, left + 90, top + line_height, loaded_color) ; - text = llformat("Loaded") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 100, top + line_height * 2, - loaded_color, - LLFontGL::LEFT, LLFontGL::TOP); - - F32 bound_color[] = {1.0f, 1.0f, 0.0f, 0.75f}; - gl_rect_2d(left + 170, top + line_height * 2, left + 190, top + line_height, bound_color) ; - text = llformat("Bound") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 200, top + line_height * 2, - bound_color, LLFontGL::LEFT, LLFontGL::TOP); - - //-------------------------------------------------- - - //title - text = llformat("Texture Category Distribution") ; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left + 250, top + line_height * 3, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - - return scale ; -} diff --git a/indra/newview/lltextureview.h b/indra/newview/lltextureview.h index 3723eb737b..900b4e17d8 100644 --- a/indra/newview/lltextureview.h +++ b/indra/newview/lltextureview.h @@ -75,41 +75,6 @@ public: }; class LLGLTexSizeBar; -class LLTextureSizeView : public LLContainerView -{ -protected: - LLTextureSizeView(const Params&); - friend class LLUICtrlFactory; -public: - ~LLTextureSizeView(); - - /*virtual*/ void draw(); - /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask) ; - - void setType(S32 type) {mType = type ;} - enum - { - TEXTURE_MEM_OVER_SIZE, - TEXTURE_MEM_OVER_CATEGORY - }; -private: - //draw background for TEXTURE_MEM_OVER_SIZE - F32 drawTextureSizeDistributionGraph() ; - //draw real-time texture mem bar over size - void drawTextureSizeGraph(); - - //draw background for TEXTURE_MEM_OVER_CATEGORY - F32 drawTextureCategoryDistributionGraph() ; - //draw real-time texture mem bar over category - void drawTextureCategoryGraph(); -private: - std::vector mTextureSizeBar ; - LLRect mTextureSizeBarRect ; - S32 mTextureSizeBarWidth ; - S32 mType ; -}; extern LLTextureView *gTextureView; -extern LLTextureSizeView *gTextureSizeView; -extern LLTextureSizeView *gTextureCategoryView; #endif // LL_TEXTURE_VIEW_H diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 99540ccce9..301b78ad4e 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -511,14 +511,6 @@ class LLAdvancedToggleConsole : public view_listener_t { toggle_visibility( (void*)static_cast(gDebugView->mDebugConsolep)); } - else if (gTextureSizeView && "texture size" == console_type) - { - toggle_visibility( (void*)gTextureSizeView ); - } - else if (gTextureCategoryView && "texture category" == console_type) - { - toggle_visibility( (void*)gTextureCategoryView ); - } else if ("fast timers" == console_type) { LLFloaterReg::toggleInstance("fast_timers"); @@ -551,14 +543,6 @@ class LLAdvancedCheckConsole : public view_listener_t { new_value = get_visibility( (void*)((LLView*)gDebugView->mDebugConsolep) ); } - else if (gTextureSizeView && "texture size" == console_type) - { - new_value = get_visibility( (void*)gTextureSizeView ); - } - else if (gTextureCategoryView && "texture category" == console_type) - { - new_value = get_visibility( (void*)gTextureCategoryView ); - } else if ("fast timers" == console_type) { new_value = LLFloaterReg::instanceVisible("fast_timers"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index cd8550b00d..389eea93d2 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1890,28 +1890,6 @@ function="Floater.Toggle" parameter="notifications_console" /> - - - - - - - - Date: Wed, 29 Feb 2012 16:15:02 -0500 Subject: SH-3018 WIP - removed audit texture, other unused diagnostic code --- indra/llrender/llimagegl.cpp | 149 +-------------------- indra/llrender/llimagegl.h | 36 ++--- indra/llrender/llrender.cpp | 8 -- indra/newview/app_settings/settings.xml | 11 -- indra/newview/llappviewer.cpp | 1 - indra/newview/llviewercontrol.cpp | 8 -- indra/newview/llviewertexture.cpp | 9 -- indra/newview/llvoavatarself.cpp | 43 ------ indra/newview/skins/default/xui/en/menu_viewer.xml | 10 -- 9 files changed, 11 insertions(+), 264 deletions(-) mode change 100644 => 100755 indra/llrender/llimagegl.cpp mode change 100644 => 100755 indra/llrender/llimagegl.h (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp old mode 100644 new mode 100755 index 78591ddd38..ab744fb7ff --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -43,7 +43,6 @@ const F32 MIN_TEXTURE_LIFETIME = 10.f; //statics -LLGLuint LLImageGL::sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS] = { 0 }; U32 LLImageGL::sUniqueCount = 0; U32 LLImageGL::sBindCount = 0; @@ -65,19 +64,10 @@ std::set LLImageGL::sImageList; //**************************************************************************************************** //----------------------- //debug use -BOOL gAuditTexture = FALSE ; -#define MAX_TEXTURE_LOG_SIZE 22 //2048 * 2048 -std::vector LLImageGL::sTextureLoadedCounter(MAX_TEXTURE_LOG_SIZE + 1) ; -std::vector LLImageGL::sTextureBoundCounter(MAX_TEXTURE_LOG_SIZE + 1) ; -std::vector LLImageGL::sTextureCurBoundCounter(MAX_TEXTURE_LOG_SIZE + 1) ; S32 LLImageGL::sCurTexSizeBar = -1 ; S32 LLImageGL::sCurTexPickSize = -1 ; -LLPointer LLImageGL::sHighlightTexturep = NULL; -S32 LLImageGL::sMaxCatagories = 1 ; +S32 LLImageGL::sMaxCategories = 1 ; -std::vector LLImageGL::sTextureMemByCategory; -std::vector LLImageGL::sTextureMemByCategoryBound ; -std::vector LLImageGL::sTextureCurMemByCategoryBound ; //------------------------ //**************************************************************************************************** //End for texture auditing use only @@ -175,49 +165,11 @@ BOOL is_little_endian() //static void LLImageGL::initClass(S32 num_catagories) { - sMaxCatagories = num_catagories ; - - sTextureMemByCategory.resize(sMaxCatagories); - sTextureMemByCategoryBound.resize(sMaxCatagories) ; - sTextureCurMemByCategoryBound.resize(sMaxCatagories) ; } //static void LLImageGL::cleanupClass() { - sTextureMemByCategory.clear() ; - sTextureMemByCategoryBound.clear() ; - sTextureCurMemByCategoryBound.clear() ; -} - -//static -void LLImageGL::setHighlightTexture(S32 category) -{ - const S32 dim = 128; - sHighlightTexturep = new LLImageGL() ; - LLPointer image_raw = new LLImageRaw(dim,dim,3); - U8* data = image_raw->getData(); - for (S32 i = 0; i=(dim-border) || j>=(dim-border)) - { - *data++ = 0xff; - *data++ = 0xff; - *data++ = 0xff; - } - else - { - *data++ = 0xff; - *data++ = 0xff; - *data++ = 0x00; - } - } - } - sHighlightTexturep->createGLTexture(0, image_raw, 0, TRUE, category); - image_raw = NULL; } //static @@ -285,31 +237,11 @@ void LLImageGL::updateStats(F32 current_time) sLastFrameTime = current_time; sBoundTextureMemoryInBytes = sCurBoundTextureMemory; sCurBoundTextureMemory = 0; - - if(gAuditTexture) - { - for(U32 i = 0 ; i < sTextureCurBoundCounter.size() ; i++) - { - sTextureBoundCounter[i] = sTextureCurBoundCounter[i] ; - sTextureCurBoundCounter[i] = 0 ; - } - for(U32 i = 0 ; i < sTextureCurMemByCategoryBound.size() ; i++) - { - sTextureMemByCategoryBound[i] = sTextureCurMemByCategoryBound[i] ; - sTextureCurMemByCategoryBound[i] = 0 ; - } - } } //static S32 LLImageGL::updateBoundTexMem(const S32 mem, const S32 ncomponents, S32 category) { - if(gAuditTexture && ncomponents > 0 && category > -1) - { - sTextureCurBoundCounter[getTextureCounterIndex(mem / ncomponents)]++ ; - sTextureCurMemByCategoryBound[category] += mem ; - } - LLImageGL::sCurBoundTextureMemory += mem ; return LLImageGL::sCurBoundTextureMemory; } @@ -1284,7 +1216,7 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S return TRUE ; } - setCategory(category) ; + setCategory(category); const U8* rawdata = imageraw->getData(); return createGLTexture(discard_level, rawdata, FALSE, usename); } @@ -1362,11 +1294,6 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ { sGlobalTextureMemoryInBytes -= mTextureMemory; - if(gAuditTexture) - { - decTextureCounter(mTextureMemory, mComponents, mCategory) ; - } - LLImageGL::deleteTextures(1, &old_name); stop_glerror(); @@ -1376,10 +1303,6 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_ sGlobalTextureMemoryInBytes += mTextureMemory; mTexelsInGLTexture = getWidth() * getHeight() ; - if(gAuditTexture) - { - incTextureCounter(mTextureMemory, mComponents, mCategory) ; - } // mark this as bound at this point, so we don't throw it out immediately mLastBindTime = sLastFrameTime; return TRUE; @@ -1536,10 +1459,6 @@ void LLImageGL::destroyGLTexture() { if(mTextureMemory) { - if(gAuditTexture) - { - decTextureCounter(mTextureMemory, mComponents, mCategory) ; - } sGlobalTextureMemoryInBytes -= mTextureMemory; mTextureMemory = 0; } @@ -1969,70 +1888,6 @@ BOOL LLImageGL::getMask(const LLVector2 &tc) return res; } -void LLImageGL::setCategory(S32 category) -{ -#if 0 //turn this off temporarily because it is not in use now. - if(!gAuditTexture) - { - return ; - } - if(mCategory != category) - { - if(mCategory > -1) - { - sTextureMemByCategory[mCategory] -= mTextureMemory ; - } - if(category > -1 && category < sMaxCatagories) - { - sTextureMemByCategory[category] += mTextureMemory ; - mCategory = category; - } - else - { - mCategory = -1 ; - } - } -#endif -} - -//for debug use -//val is a "power of two" number -S32 LLImageGL::getTextureCounterIndex(U32 val) -{ - //index range is [0, MAX_TEXTURE_LOG_SIZE]. - if(val < 2) - { - return 0 ; - } - else if(val >= (1 << MAX_TEXTURE_LOG_SIZE)) - { - return MAX_TEXTURE_LOG_SIZE ; - } - else - { - S32 ret = 0 ; - while(val >>= 1) - { - ++ret; - } - return ret ; - } -} - -//static -void LLImageGL::incTextureCounter(U32 val, S32 ncomponents, S32 category) -{ - sTextureLoadedCounter[getTextureCounterIndex(val)]++ ; - sTextureMemByCategory[category] += (S32)val * ncomponents ; -} - -//static -void LLImageGL::decTextureCounter(U32 val, S32 ncomponents, S32 category) -{ - sTextureLoadedCounter[getTextureCounterIndex(val)]-- ; - sTextureMemByCategory[category] += (S32)val * ncomponents ; -} - void LLImageGL::setCurTexSizebar(S32 index, BOOL set_pick_size) { sCurTexSizeBar = index ; diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h old mode 100644 new mode 100755 index 2cfb15b0d9..2060be914b --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -102,8 +102,8 @@ public: static void setManualImage(U32 target, S32 miplevel, S32 intformat, S32 width, S32 height, U32 pixformat, U32 pixtype, const void *pixels); BOOL createGLTexture() ; - BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename = 0, BOOL to_create = TRUE, - S32 category = sMaxCatagories - 1); + BOOL createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename = 0, BOOL to_create = TRUE, + S32 category = sMaxCategories-1); BOOL createGLTexture(S32 discard_level, const U8* data, BOOL data_hasmips = FALSE, S32 usename = 0); void setImage(const LLImageRaw* imageraw); void setImage(const U8* data_in, BOOL data_hasmips = FALSE); @@ -234,8 +234,6 @@ public: static S32 sCount; static F32 sLastFrameTime; - - static LLGLuint sCurrentBoundTextures[MAX_GL_TEXTURE_UNITS]; // Currently bound texture ID // Global memory statistics static S32 sGlobalTextureMemoryInBytes; // Tracks main memory texmem @@ -257,9 +255,10 @@ public: public: static void initClass(S32 num_catagories) ; static void cleanupClass() ; -private: - static S32 sMaxCatagories ; +private: + static S32 sMaxCategories; + //the flag to allow to call readBackRaw(...). //can be removed if we do not use that function at all. static BOOL sAllowReadBackRaw ; @@ -269,39 +268,22 @@ private: //**************************************************************************************************** private: S32 mCategory ; -public: - void setCategory(S32 category) ; - S32 getCategory()const {return mCategory ;} - +public: + void setCategory(S32 category) {mCategory = category;} + S32 getCategory()const {return mCategory;} + //for debug use: show texture size distribution //---------------------------------------- - static LLPointer sHighlightTexturep; //default texture to replace normal textures - static std::vector sTextureLoadedCounter ; - static std::vector sTextureBoundCounter ; - static std::vector sTextureCurBoundCounter ; static S32 sCurTexSizeBar ; static S32 sCurTexPickSize ; - static void setHighlightTexture(S32 category) ; - static S32 getTextureCounterIndex(U32 val) ; - static void incTextureCounter(U32 val, S32 ncomponents, S32 category) ; - static void decTextureCounter(U32 val, S32 ncomponents, S32 category) ; static void setCurTexSizebar(S32 index, BOOL set_pick_size = TRUE) ; static void resetCurTexSizebar(); - //---------------------------------------- - //for debug use: show texture category distribution - //---------------------------------------- - - static std::vector sTextureMemByCategory; - static std::vector sTextureMemByCategoryBound ; - static std::vector sTextureCurMemByCategoryBound ; - //---------------------------------------- //**************************************************************************************************** //End of definitions for texture auditing use only //**************************************************************************************************** }; -extern BOOL gAuditTexture; #endif // LL_LLIMAGEGL_H diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index b0ddacbb05..93bac4c779 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -246,14 +246,6 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) } //in audit, replace the selected texture by the default one. - if(gAuditTexture && for_rendering && LLImageGL::sCurTexPickSize > 0) - { - if(texture->getWidth() * texture->getHeight() == LLImageGL::sCurTexPickSize) - { - gl_tex->updateBindStats(gl_tex->mTextureMemory); - return bind(LLImageGL::sHighlightTexturep.get()); - } - } if ((mCurrTexture != gl_tex->getTexName()) || forceBind) { activate(); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c1f65ca7f5..27c757b306 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -335,17 +335,6 @@ Value 1 - AuditTexture - - Comment - Enable texture auditting. - Persist - 1 - Type - Boolean - Value - 0 - AutoAcceptNewInventory Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 49fbdbf1df..9378398a76 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -560,7 +560,6 @@ static void settings_modify() LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); - gAuditTexture = gSavedSettings.getBOOL("AuditTexture"); } class LLFastTimerLogThread : public LLThread diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 093b84413a..90594f28dc 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -87,7 +87,6 @@ std::string gLastRunVersion; extern BOOL gResizeScreenTexture; extern BOOL gDebugGL; -extern BOOL gAuditTexture; //////////////////////////////////////////////////////////////////////////// // Listeners @@ -401,12 +400,6 @@ static bool handleRenderUseImpostorsChanged(const LLSD& newvalue) return true; } -static bool handleAuditTextureChanged(const LLSD& newvalue) -{ - gAuditTexture = newvalue.asBoolean(); - return true; -} - static bool handleRenderDebugGLChanged(const LLSD& newvalue) { gDebugGL = newvalue.asBoolean() || gDebugSession; @@ -608,7 +601,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderPerformanceTest")->getSignal()->connect(boost::bind(&handleRenderPerfTestChanged, _2)); gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2)); - gSavedSettings.getControl("AuditTexture")->getSignal()->connect(boost::bind(&handleAuditTextureChanged, _2)); gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&handleChatFontSizeChanged, _2)); gSavedSettings.getControl("ChatPersistTime")->getSignal()->connect(boost::bind(&handleChatPersistTimeChanged, _2)); gSavedSettings.getControl("ConsoleMaxLines")->getSignal()->connect(boost::bind(&handleConsoleMaxLinesChanged, _2)); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 61236edc86..0360a8faf0 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -383,11 +383,6 @@ void LLViewerTextureManager::cleanup() void LLViewerTexture::initClass() { LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture() ; - - if(gAuditTexture) - { - LLImageGL::setHighlightTexture(LLViewerTexture::OTHER) ; - } } // static @@ -655,10 +650,6 @@ void LLViewerTexture::setBoostLevel(S32 level) { setNoDelete() ; } - if(gAuditTexture) - { - setCategory(mBoostLevel); - } } } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index e0af6c3995..d5895bdc31 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2572,49 +2572,6 @@ BOOL LLVOAvatarSelf::needsRenderBeam() // static void LLVOAvatarSelf::deleteScratchTextures() { - if(gAuditTexture) - { - S32 total_tex_size = sScratchTexBytes ; - S32 tex_size = SCRATCH_TEX_WIDTH * SCRATCH_TEX_HEIGHT ; - - if( sScratchTexNames.checkData( GL_LUMINANCE ) ) - { - LLImageGL::decTextureCounter(tex_size, 1, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - total_tex_size -= tex_size ; - } - if( sScratchTexNames.checkData( GL_ALPHA ) ) - { - LLImageGL::decTextureCounter(tex_size, 1, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - total_tex_size -= tex_size ; - } - if( sScratchTexNames.checkData( GL_COLOR_INDEX ) ) - { - LLImageGL::decTextureCounter(tex_size, 1, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - total_tex_size -= tex_size ; - } - if( sScratchTexNames.checkData( LLRender::sGLCoreProfile ? GL_RG : GL_LUMINANCE_ALPHA ) ) - { - LLImageGL::decTextureCounter(tex_size, 2, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - total_tex_size -= 2 * tex_size ; - } - if( sScratchTexNames.checkData( GL_RGB ) ) - { - LLImageGL::decTextureCounter(tex_size, 3, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - total_tex_size -= 3 * tex_size ; - } - if( sScratchTexNames.checkData( GL_RGBA ) ) - { - LLImageGL::decTextureCounter(tex_size, 4, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - total_tex_size -= 4 * tex_size ; - } - //others - while(total_tex_size > 0) - { - LLImageGL::decTextureCounter(tex_size, 4, LLViewerTexture::AVATAR_SCRATCH_TEX) ; - total_tex_size -= 4 * tex_size ; - } - } - for( LLGLuint* namep = sScratchTexNames.getFirstData(); namep; namep = sScratchTexNames.getNextData() ) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 389eea93d2..7422b61f1a 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2576,16 +2576,6 @@ function="ToggleControl" parameter="TextureLoadFullRes" /> - - - - -- cgit v1.2.3 From a37e121dbf3eba78f3f44f7028eb9849c7a3883e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Sat, 3 Mar 2012 06:59:34 -0500 Subject: SH-2970 WIP - avatar metrics --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 13 +++++++------ indra/newview/llvoavatar.cpp | 19 +++++++++++++++++++ indra/newview/llvoavatar.h | 3 +++ indra/newview/llvoavatarself.cpp | 2 +- 5 files changed, 41 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 27c757b306..9fff543b13 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7150,6 +7150,17 @@ Value -1 + QAModeMetrics + + Comment + "Enables QA features (logging, faster cycling) for metrics collector" + Persist + 1 + Type + Boolean + Value + 0 + QuietSnapshotsToDisk Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9378398a76..3f511748ea 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -730,12 +730,12 @@ bool LLAppViewer::init() { // Viewer metrics initialization - static LLCachedControl metrics_submode(gSavedSettings, - "QAModeMetrics", - false, - "Enables QA features (logging, faster cycling) for metrics collector"); + //static LLCachedControl metrics_submode(gSavedSettings, + // "QAModeMetrics", + // false, + // "Enables QA features (logging, faster cycling) for metrics collector"); - if (metrics_submode) + if (gSavedSettings.getBOOL("QAModeMetrics")) { app_metrics_qa_mode = true; app_metrics_interval = METRICS_INTERVAL_QA; @@ -4244,7 +4244,8 @@ void LLAppViewer::idle() static LLTimer report_interval; // *TODO: Add configuration controls for this - if (report_interval.getElapsedTimeF32() >= app_metrics_interval) + F32 seconds = report_interval.getElapsedTimeF32(); + if (seconds >= app_metrics_interval) { metricsSend(! gDisconnected); report_interval.reset(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 8ea0fb7c50..9249e0fa21 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -807,6 +807,17 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c } } +// Dump avatar metrics data. +// virtual +LLSD LLVOAvatar::metricsData() +{ + LLSD result; + result["id"] = getID(); + result["rez_status"] = getRezzedStatus(); + result["is_self"] = isSelf(); + return result; +} + //------------------------------------------------------------------------ // LLVOAvatar::~LLVOAvatar() //------------------------------------------------------------------------ @@ -943,6 +954,14 @@ BOOL LLVOAvatar::hasGray() const return !getIsCloud() && !isFullyTextured(); } +S32 LLVOAvatar::getRezzedStatus() const +{ + if (getIsCloud()) return 0; + if (hasGray()) return 1; + if (isFullyTextured()) return 2; + return -1; +} + void LLVOAvatar::deleteLayerSetCaches(bool clearAll) { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index bab4f02caf..9a9ba85eb2 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -281,6 +281,7 @@ public: virtual BOOL getIsCloud() const; BOOL isFullyTextured() const; BOOL hasGray() const; + S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = fully textured. protected: BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); @@ -988,6 +989,8 @@ private: public: void debugAvatarRezTime(std::string notification_name, std::string comment = ""); F32 debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); } + LLSD metricsData(); + protected: LLFrameTimer mRuthDebugTimer; // For tracking how long it takes for av to rez LLFrameTimer mDebugExistenceTimer; // Debugging for how long the avatar has been in memory. diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d5895bdc31..467961c55e 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2278,7 +2278,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) } } -// FIXME: This is never called. Something may be broken. +// FIXME: This is not called consistently. Something may be broken. void LLVOAvatarSelf::outputRezDiagnostics() const { if(!gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime")) -- cgit v1.2.3 From cc762ba60493a2dceba53929d10640a556a5e9ae Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Mar 2012 14:19:39 -0500 Subject: SH-2970 WIP - simple LLSD metrics for self av --- indra/newview/llvoavatar.cpp | 37 ++++++++++++++++++++++++------------- indra/newview/llvoavatar.h | 2 +- indra/newview/llvoavatarself.cpp | 16 ++++++++++++++++ indra/newview/llvoavatarself.h | 1 + 4 files changed, 42 insertions(+), 14 deletions(-) mode change 100644 => 100755 indra/newview/llvoavatarself.h (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9249e0fa21..dbb9c218d3 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -797,6 +797,9 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c << " : " << comment << llendl; + LLSD metrics = gAgentAvatarp->metricsData(); + llinfos << gAgentAvatarp->avString() << " metrics " << metrics << llendl; + if (gSavedSettings.getBOOL("DebugAvatarRezTime")) { LLSD args; @@ -807,17 +810,6 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c } } -// Dump avatar metrics data. -// virtual -LLSD LLVOAvatar::metricsData() -{ - LLSD result; - result["id"] = getID(); - result["rez_status"] = getRezzedStatus(); - result["is_self"] = isSelf(); - return result; -} - //------------------------------------------------------------------------ // LLVOAvatar::~LLVOAvatar() //------------------------------------------------------------------------ @@ -957,9 +949,9 @@ BOOL LLVOAvatar::hasGray() const S32 LLVOAvatar::getRezzedStatus() const { if (getIsCloud()) return 0; - if (hasGray()) return 1; if (isFullyTextured()) return 2; - return -1; + llassert(hasGray()); + return 1; // gray } void LLVOAvatar::deleteLayerSetCaches(bool clearAll) @@ -1008,6 +1000,22 @@ BOOL LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars) return res; } +// static +void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) +{ + counts.clear(); + counts.resize(3); + for (std::vector::iterator iter = LLCharacter::sInstances.begin(); + iter != LLCharacter::sInstances.end(); ++iter) + { + LLVOAvatar* inst = (LLVOAvatar*) *iter; + if (!inst) + continue; + S32 rez_status = inst->getRezzedStatus(); + counts[rez_status]++; + } +} + // static void LLVOAvatar::dumpBakedStatus() { @@ -7733,6 +7741,9 @@ void LLVOAvatar::cullAvatarsByPixelArea() } } + // runway - this doesn't detect gray/grey state. + // think we just need to be checking self av since it's the only + // one with lltexlayer stuff. S32 grey_avatars = 0; if (LLVOAvatar::areAllNearbyInstancesBaked(grey_avatars)) { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 9a9ba85eb2..d4166a66b2 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -524,6 +524,7 @@ public: BOOL isFullyBaked(); static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); + static void getNearbyRezzedStats(std::vector& counts); //-------------------------------------------------------------------- // Baked textures @@ -989,7 +990,6 @@ private: public: void debugAvatarRezTime(std::string notification_name, std::string comment = ""); F32 debugGetExistenceTimeElapsedF32() const { return mDebugExistenceTimer.getElapsedTimeF32(); } - LLSD metricsData(); protected: LLFrameTimer mRuthDebugTimer; // For tracking how long it takes for av to rez diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 467961c55e..0a60ef4fff 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2054,6 +2054,22 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const return text; } +// Dump avatar metrics data. +LLSD LLVOAvatarSelf::metricsData() +{ + LLSD result; + result["id"] = getID(); + result["rez_status"] = getRezzedStatus(); + result["is_self"] = isSelf(); + std::vector rez_counts; + LLVOAvatar::getNearbyRezzedStats(rez_counts); + result["nearby_cloud"] = rez_counts[0]; + result["nearby_gray"] = rez_counts[1]; + result["nearby_textured"] = rez_counts[2]; + + return result; +} + const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const { if (canGrabBakedTexture(baked_index)) diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h old mode 100644 new mode 100755 index 6aadf4533e..aaceff933a --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -369,6 +369,7 @@ public: const LLTexLayerSet* debugGetLayerSet(LLVOAvatarDefines::EBakedTextureIndex index) const { return mBakedTextureDatas[index].mTexLayerSet; } const std::string debugDumpLocalTextureDataInfo(const LLTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD + LLSD metricsData(); private: LLFrameTimer mDebugSelfLoadTimer; F32 mDebugTimeWearablesLoaded; -- cgit v1.2.3 From 7f6e5055fb93949a3a1455a336fa93137a954862 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 5 Mar 2012 18:24:49 -0500 Subject: SH-2970 WIP - av metrics --- indra/newview/llvoavatar.cpp | 7 +++++-- indra/newview/llvoavatarself.cpp | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index dbb9c218d3..47f7ce0f62 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -797,8 +797,11 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c << " : " << comment << llendl; - LLSD metrics = gAgentAvatarp->metricsData(); - llinfos << gAgentAvatarp->avString() << " metrics " << metrics << llendl; + if (gAgentAvatarp && !gAgentAvatarp->isDead()) // not safe to call during ~LLVOAvatarself + { + LLSD metrics = gAgentAvatarp->metricsData(); + llinfos << gAgentAvatarp->avString() << " metrics " << metrics << llendl; + } if (gSavedSettings.getBOOL("DebugAvatarRezTime")) { diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 0a60ef4fff..22a52f8854 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2066,6 +2066,11 @@ LLSD LLVOAvatarSelf::metricsData() result["nearby_cloud"] = rez_counts[0]; result["nearby_gray"] = rez_counts[1]; result["nearby_textured"] = rez_counts[2]; + result["timer_debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32(); + result["timer_ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32(); + result["timer_ruth"] = mRuthTimer.getElapsedTimeF32(); + result["timer_invisible"] = mInvisibleTimer.getElapsedTimeF32(); + result["timer_fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); return result; } -- cgit v1.2.3 From 4e7bef91a72f6b08414fa56e9516159b848f818c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 6 Mar 2012 10:10:17 -0500 Subject: SH-2970 WIP --- indra/newview/llvoavatarself.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 22a52f8854..f14b3c2b6b 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2063,14 +2063,15 @@ LLSD LLVOAvatarSelf::metricsData() result["is_self"] = isSelf(); std::vector rez_counts; LLVOAvatar::getNearbyRezzedStats(rez_counts); - result["nearby_cloud"] = rez_counts[0]; - result["nearby_gray"] = rez_counts[1]; - result["nearby_textured"] = rez_counts[2]; - result["timer_debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32(); - result["timer_ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32(); - result["timer_ruth"] = mRuthTimer.getElapsedTimeF32(); - result["timer_invisible"] = mInvisibleTimer.getElapsedTimeF32(); - result["timer_fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); + result["nearby"] = LLSD::emptyArray(); + result["nearby"][0] = rez_counts[0]; + result["nearby"][1] = rez_counts[1]; + result["nearby"][2] = rez_counts[2]; + result["timers"]["debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32(); + result["timers"]["ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32(); + result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32(); + result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32(); + result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); return result; } -- cgit v1.2.3 From c03c7eaa460e097093304177d9ba23e9af57a959 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 6 Mar 2012 14:10:16 -0500 Subject: SH-2970 WIP - framework for tracking various phases of avatar rezzing/outfit changing --- indra/newview/llvoavatar.cpp | 42 ++++++++++++++++++++++++++++++++++++++++ indra/newview/llvoavatar.h | 12 ++++++++++++ indra/newview/llvoavatarself.cpp | 1 + 3 files changed, 55 insertions(+) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 47f7ce0f62..9cfc0f2fdd 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -875,6 +875,8 @@ LLVOAvatar::~LLVOAvatar() mAnimationSources.clear(); LLLoadedCallbackEntry::cleanUpCallbackList(&mCallbackTextureList) ; + clearPhases(); + lldebugs << "LLVOAvatar Destructor end" << llendl; } @@ -957,6 +959,46 @@ S32 LLVOAvatar::getRezzedStatus() const return 1; // gray } +LLFrameTimer& LLVOAvatar::getPhaseTimer(const std::string& phase_name) +{ + phase_map_t::iterator iter = mPhases.find(phase_name); + if (iter == mPhases.end()) + { + LLFrameTimer timer; + mPhases[phase_name] = timer; + } + LLFrameTimer& timer = mPhases[phase_name]; + return timer; +} + +void LLVOAvatar::startPhase(const std::string& phase_name) +{ + LLFrameTimer& timer = getPhaseTimer(phase_name); + timer.unpause(); +} + +void LLVOAvatar::stopPhase(const std::string& phase_name) +{ + LLFrameTimer& timer = getPhaseTimer(phase_name); + timer.pause(); +} + +void LLVOAvatar::clearPhases() +{ + mPhases.clear(); +} + +LLSD LLVOAvatar::dumpPhases() +{ + LLSD result; + for (phase_map_t::iterator iter = mPhases.begin(); iter != mPhases.end(); ++iter) + { + result[iter->first]["completed"] = !(iter->second.getStarted()); + result[iter->first]["elapsed"] = iter->second.getElapsedTimeF32(); + } + return result; +} + void LLVOAvatar::deleteLayerSetCaches(bool clearAll) { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index d4166a66b2..279ddcbe86 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -282,6 +282,13 @@ public: BOOL isFullyTextured() const; BOOL hasGray() const; S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = fully textured. + + // Tracking progress of active/completed phases for activities like outfit changing. + LLFrameTimer& getPhaseTimer(const std::string& phase_name); + void startPhase(const std::string& phase_name); + void stopPhase(const std::string& phase_name); + void clearPhases(); + LLSD dumpPhases(); protected: BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); @@ -296,6 +303,11 @@ private: S32 mVisualComplexity; LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; + typedef std::deque morph_list_t; + + typedef std::map phase_map_t; + phase_map_t mPhases; + protected: LLFrameTimer mInvisibleTimer; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f14b3c2b6b..2c206347bc 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2072,6 +2072,7 @@ LLSD LLVOAvatarSelf::metricsData() result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32(); result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32(); result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); + result["phases"] = dumpPhases(); return result; } -- cgit v1.2.3 From 80e64f26a13a8cbfe32d94b33fff57ddc7f21731 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 6 Mar 2012 15:30:08 -0500 Subject: via richard - fix to keep texture debug console anchored at the top --- indra/llui/llcontainerview.cpp | 18 ++++----- indra/newview/llappearancemgr.cpp | 14 ++++++- indra/newview/lldebugview.cpp | 2 +- indra/newview/lltextureview.cpp | 79 +++++---------------------------------- 4 files changed, 32 insertions(+), 81 deletions(-) (limited to 'indra') diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp index e01e331acf..e08ccb0b78 100644 --- a/indra/llui/llcontainerview.cpp +++ b/indra/llui/llcontainerview.cpp @@ -196,24 +196,24 @@ void LLContainerView::arrange(S32 width, S32 height, BOOL called_from_parent) if (total_height < height) total_height = height; + LLRect my_rect = getRect(); if (followsTop()) { - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast(getRect()).mBottom = getRect().mTop - total_height; + my_rect.mBottom = my_rect.mTop - total_height; } else { - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast(getRect()).mTop = getRect().mBottom + total_height; + my_rect.mTop = my_rect.mBottom + total_height; } - // HACK: casting away const. Should use setRect or some helper function instead. - const_cast(getRect()).mRight = getRect().mLeft + width; + + my_rect.mRight = my_rect.mLeft + width; + setRect(my_rect); top = total_height; if (mShowLabel) - { - top -= 20; - } + { + top -= 20; + } bottom = top; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 83eed6c0c9..c7da1f7b8c 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -344,11 +344,14 @@ LLWearableHoldingPattern::LLWearableHoldingPattern(): } sActiveHoldingPatterns.insert(this); + gAgentAvatarp->clearPhases(); + gAgentAvatarp->startPhase("holding_pattern"); } LLWearableHoldingPattern::~LLWearableHoldingPattern() { sActiveHoldingPatterns.erase(this); + gAgentAvatarp->stopPhase("holding_pattern"); } bool LLWearableHoldingPattern::isMostRecent() @@ -398,7 +401,7 @@ void LLWearableHoldingPattern::checkMissingWearables() // runway why don't we actually skip here? llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } - + std::vector found_by_type(LLWearableType::WT_COUNT,0); std::vector requested_by_type(LLWearableType::WT_COUNT,0); for (found_list_t::iterator it = getFoundList().begin(); it != getFoundList().end(); ++it) @@ -436,6 +439,10 @@ void LLWearableHoldingPattern::checkMissingWearables() } resetTime(60.0F); + if (!isMissingCompleted()) + { + gAgentAvatarp->startPhase("get_missing_wearables"); + } if (!pollMissingWearables()) { doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollMissingWearables,this)); @@ -499,6 +506,8 @@ void LLWearableHoldingPattern::onAllComplete() void LLWearableHoldingPattern::onFetchCompletion() { + gAgentAvatarp->stopPhase("get_wearables"); + if (!isMostRecent()) { // runway skip here? @@ -706,6 +715,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (done) { + gAgentAvatarp->stopPhase("get_missing_wearables"); gAgentAvatarp->debugWearablesLoaded(); // BAP - if we don't call clearCOFLinksForMissingWearables() @@ -1785,6 +1795,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) } } + gAgentAvatarp->startPhase("get_wearables"); + for (LLWearableHoldingPattern::found_list_t::iterator it = holder->getFoundList().begin(); it != holder->getFoundList().end(); ++it) { diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp index bba5d7c459..29b1d23d7d 100644 --- a/indra/newview/lldebugview.cpp +++ b/indra/newview/lldebugview.cpp @@ -115,7 +115,7 @@ void LLDebugView::init() LLTextureView::Params tvp; tvp.name("gTextureView"); tvp.rect(r); - tvp.follows.flags(FOLLOWS_BOTTOM|FOLLOWS_LEFT); + tvp.follows.flags(FOLLOWS_TOP|FOLLOWS_LEFT); tvp.visible(false); gTextureView = LLUICtrlFactory::create(tvp); addChild(gTextureView); diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index 69422bfc5a..d3fcecd9bc 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -511,7 +511,7 @@ void LLGLTexMemBar::draw() F32 cache_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getUsage()) ; F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ; S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f); - S32 v_offset = (S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); + S32 v_offset = 0;//(S32)((texture_bar_height + 2.2f) * mTextureView->mNumTextureBars + 2.0f); F32 total_texture_downloaded = (F32)gTotalTextureBytes / (1024 * 1024); F32 total_object_downloaded = (F32)gTotalObjectBytes / (1024 * 1024); U32 total_http_requests = LLAppViewer::getTextureFetch()->getTotalNumHTTPRequests() ; @@ -538,67 +538,7 @@ void LLGLTexMemBar::draw() LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3, text_color, LLFontGL::LEFT, LLFontGL::TOP); - //---------------------------------------------------------------------------- -#if 0 - S32 bar_left = 400; - S32 bar_width = 200; - S32 top = line_height*3 - 2 + v_offset; - S32 bottom = top - 6; - S32 left = bar_left; - S32 right = left + bar_width; - F32 bar_scale; - - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - - // GL Mem Bar - - left = bar_left; - text = "GL"; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, line_height*3, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - - left = bar_left+20; - right = left + bar_width; - - gGL.color4f(0.5f, 0.5f, 0.5f, 0.75f); // grey - gl_rect_2d(left, top, right, bottom); - - bar_scale = (F32)bar_width / (max_total_mem * 1.5f); - right = left + llfloor(total_mem * bar_scale); - right = llclamp(right, bar_left, bar_left + bar_width); - - color = (total_mem < llfloor(max_total_mem * texmem_lower_bound_scale)) ? LLColor4::green : - (total_mem < max_total_mem) ? LLColor4::yellow : LLColor4::red; - color[VALPHA] = .75f; - gGL.diffuseColor4fv(color.mV); - - gl_rect_2d(left, top, right, bottom); // red/yellow/green - - // - bar_left += bar_width + bar_space; - //top = bottom - 2; bottom = top - 6; - - // Bound Mem Bar - - left = bar_left; - text = "GL"; - LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, line_height*3, - text_color, LLFontGL::LEFT, LLFontGL::TOP); - left = bar_left + 20; - right = left + bar_width; - - gGL.color4f(0.5f, 0.5f, 0.5f, 0.75f); - gl_rect_2d(left, top, right, bottom); - - color = (bound_mem < llfloor(max_bound_mem * texmem_lower_bound_scale)) ? LLColor4::green : - (bound_mem < max_bound_mem) ? LLColor4::yellow : LLColor4::red; - color[VALPHA] = .75f; - gGL.diffuseColor4fv(color.mV); - - gl_rect_2d(left, top, right, bottom); -#else S32 left = 0 ; -#endif //---------------------------------------------------------------------------- text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d", @@ -667,7 +607,7 @@ BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask) LLRect LLGLTexMemBar::getRequiredRect() { LLRect rect; - //rect.mTop = 50; + rect.mTop = LLFontGL::getFontMonospace()->getLineHeight() * 6; rect.mTop = 0; return rect; } @@ -952,9 +892,11 @@ void LLTextureView::draw() LLRect tmbr; tmbp.name("gl texmem bar"); tmbp.rect(tmbr); + tmbp.follows.flags = FOLLOWS_LEFT|FOLLOWS_TOP; tmbp.texture_view(this); mGLTexMemBar = LLUICtrlFactory::create(tmbp); - addChildInBack(mGLTexMemBar); + addChild(mGLTexMemBar); + sendChildToFront(mGLTexMemBar); LLAvatarTexBar::Params atbp; LLRect atbr; @@ -963,16 +905,13 @@ void LLTextureView::draw() atbp.rect(atbr); mAvatarTexBar = LLUICtrlFactory::create(atbp); addChild(mAvatarTexBar); + sendChildToFront(mAvatarTexBar); reshape(getRect().getWidth(), getRect().getHeight(), TRUE); - /* - count = gTextureList.getNumImages(); - std::string info_string; - info_string = llformat("Global Info:\nTexture Count: %d", count); - mInfoTextp->setText(info_string); - */ - + LLUI::popMatrix(); + LLUI::pushMatrix(); + LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom); for (child_list_const_iter_t child_iter = getChildList()->begin(); child_iter != getChildList()->end(); ++child_iter) -- cgit v1.2.3 From 7bc112ac9f5bf15b35c494a44e8c85767b1994a6 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 6 Mar 2012 16:53:31 -0500 Subject: texture view console tweaks --- indra/llui/llcontainerview.cpp | 0 indra/newview/lltextureview.cpp | 13 ++++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) mode change 100644 => 100755 indra/llui/llcontainerview.cpp (limited to 'indra') diff --git a/indra/llui/llcontainerview.cpp b/indra/llui/llcontainerview.cpp old mode 100644 new mode 100755 diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp index d3fcecd9bc..68dd8cb23b 100755 --- a/indra/newview/lltextureview.cpp +++ b/indra/newview/lltextureview.cpp @@ -525,16 +525,20 @@ void LLGLTexMemBar::draw() LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*6, text_color, LLFontGL::LEFT, LLFontGL::TOP); - text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d", + text = llformat("GL Tot: %d/%d MB Bound: %d/%d MB FBO: %d MB Raw Tot: %d MB Bias: %.2f Cache: %.1f/%.1f MB", total_mem, max_total_mem, bound_mem, max_bound_mem, LLRenderTarget::sBytesAllocated/(1024*1024), LLImageRaw::sGlobalRawMemory >> 20, discard_bias, - cache_usage, cache_max_usage, total_texture_downloaded, total_object_downloaded, total_http_requests); - //, cache_entries, cache_max_entries + cache_usage, cache_max_usage); + LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*4, + text_color, LLFontGL::LEFT, LLFontGL::TOP); + text = llformat("Net Tot Tex: %.1f MB Tot Obj: %.1f MB Tot Htp: %d", + total_texture_downloaded, total_object_downloaded, total_http_requests); + //, cache_entries, cache_max_entries LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3, text_color, LLFontGL::LEFT, LLFontGL::TOP); @@ -607,8 +611,7 @@ BOOL LLGLTexMemBar::handleMouseDown(S32 x, S32 y, MASK mask) LLRect LLGLTexMemBar::getRequiredRect() { LLRect rect; - rect.mTop = LLFontGL::getFontMonospace()->getLineHeight() * 6; - rect.mTop = 0; + rect.mTop = 50; //LLFontGL::getFontMonospace()->getLineHeight() * 6; return rect; } -- cgit v1.2.3 From accc2c6fc88e6de19137cc7a9add219e4eece246 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 7 Mar 2012 09:45:32 -0500 Subject: fix for mac build error --- indra/newview/llvoavatar.h | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 279ddcbe86..143b61b70b 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -303,7 +303,6 @@ private: S32 mVisualComplexity; LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; - typedef std::deque morph_list_t; typedef std::map phase_map_t; phase_map_t mPhases; -- cgit v1.2.3 From 7bc698cbeca5ef3aab93bf7e4b843004dd5a7afb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 8 Mar 2012 17:07:23 -0500 Subject: SH-2970 WIP - more phase tracking --- indra/newview/llagentwearables.cpp | 3 +++ indra/newview/llagentwearablesfetch.cpp | 2 ++ indra/newview/llappearancemgr.cpp | 32 ++++++++++++++++++++++---------- indra/newview/llvoavatarself.cpp | 24 ++++++++++++++++++++++++ indra/newview/llvoavatarself.h | 4 ++++ 5 files changed, 55 insertions(+), 10 deletions(-) mode change 100644 => 100755 indra/newview/llagentwearables.cpp (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp old mode 100644 new mode 100755 index 53ca0a214a..bb6b98096b --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -952,6 +952,8 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs if (isAgentAvatarValid()) { + gAgentAvatarp->clearPhases(); // reset phase timers for outfit loading. + gAgentAvatarp->startPhase("process_initial_wearables_update"); gAgentAvatarp->outputRezTiming("Received initial wearables update"); } @@ -1627,6 +1629,7 @@ void LLAgentWearables::queryWearableCache() { if (isAgentAvatarValid()) { + selfStartPhase("fetch_texture_cache_entries"); gAgentAvatarp->outputRezTiming("Fetching textures from cache"); } diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 8cba54347e..2735c7ef39 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -89,6 +89,7 @@ LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) : { if (isAgentAvatarValid()) { + gAgentAvatarp->startPhase("initial_wearables_fetch"); gAgentAvatarp->outputRezTiming("Initial wearables fetch started"); } } @@ -107,6 +108,7 @@ void LLInitialWearablesFetch::done() doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this)); if (isAgentAvatarValid()) { + gAgentAvatarp->stopPhase("initial_wearables_fetch"); gAgentAvatarp->outputRezTiming("Initial wearables fetch done"); } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c7da1f7b8c..13f76c0593 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -161,6 +161,8 @@ public: { mCatID = cat_id; mAppend = append; + + selfStartPhase("wear_inventory_category_callback"); } void fire(const LLUUID& item_id) { @@ -172,6 +174,7 @@ public: * after the last item has fired the event and dereferenced it -- if all * the events actually fire! */ + selfStopPhase("wear_inventory_category_callback"); } protected: @@ -217,11 +220,14 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit mFireCount(0), mUpdateBaseOrder(update_base_outfit_ordering) { + selfStartPhase("update_appearance_on_destroy"); } LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() { llinfos << self_av_string() << "done update appearance on destroy" << llendl; + + selfStopPhase("update_appearance_on_destroy"); if (!LLApp::isExiting()) { @@ -344,14 +350,16 @@ LLWearableHoldingPattern::LLWearableHoldingPattern(): } sActiveHoldingPatterns.insert(this); - gAgentAvatarp->clearPhases(); - gAgentAvatarp->startPhase("holding_pattern"); + selfStartPhase("holding_pattern"); } LLWearableHoldingPattern::~LLWearableHoldingPattern() { sActiveHoldingPatterns.erase(this); - gAgentAvatarp->stopPhase("holding_pattern"); + if (isMostRecent()) + { + selfStopPhase("holding_pattern"); + } } bool LLWearableHoldingPattern::isMostRecent() @@ -439,10 +447,8 @@ void LLWearableHoldingPattern::checkMissingWearables() } resetTime(60.0F); - if (!isMissingCompleted()) - { - gAgentAvatarp->startPhase("get_missing_wearables"); - } + + selfStartPhase("get_missing_wearables"); if (!pollMissingWearables()) { doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollMissingWearables,this)); @@ -506,7 +512,7 @@ void LLWearableHoldingPattern::onAllComplete() void LLWearableHoldingPattern::onFetchCompletion() { - gAgentAvatarp->stopPhase("get_wearables"); + selfStopPhase("get_wearables"); if (!isMostRecent()) { @@ -715,7 +721,8 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (done) { - gAgentAvatarp->stopPhase("get_missing_wearables"); + selfStopPhase("get_missing_wearables"); + gAgentAvatarp->debugWearablesLoaded(); // BAP - if we don't call clearCOFLinksForMissingWearables() @@ -1701,6 +1708,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) return; } + selfStartPhase("update_appearance_from_cof"); + BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); llinfos << self_av_string() << "starting" << llendl; @@ -1795,7 +1804,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) } } - gAgentAvatarp->startPhase("get_wearables"); + selfStartPhase("get_wearables"); for (LLWearableHoldingPattern::found_list_t::iterator it = holder->getFoundList().begin(); it != holder->getFoundList().end(); ++it) @@ -1874,6 +1883,9 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool { if(!category) return; + selfClearPhases(); + selfStartPhase("wear_inventory_category"); + gAgentWearables.notifyLoadingStarted(); llinfos << self_av_string() << "wearInventoryCategory( " << category->getName() diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 2c206347bc..ed3295c43c 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -74,6 +74,30 @@ BOOL isAgentAvatarValid() (!gAgentAvatarp->isDead())); } +void selfStartPhase(const std::string& phase_name) +{ + if (isAgentAvatarValid()) + { + gAgentAvatarp->startPhase(phase_name); + } +} + +void selfStopPhase(const std::string& phase_name) +{ + if (isAgentAvatarValid()) + { + gAgentAvatarp->stopPhase(phase_name); + } +} + +void selfClearPhases() +{ + if (isAgentAvatarValid()) + { + gAgentAvatarp->clearPhases(); + } +} + using namespace LLVOAvatarDefines; /********************************************************************************* diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index aaceff933a..9ac4306419 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -388,4 +388,8 @@ extern LLVOAvatarSelf *gAgentAvatarp; BOOL isAgentAvatarValid(); +void selfStartPhase(const std::string& phase_name); +void selfStopPhase(const std::string& phase_name); +void selfClearPhases(); + #endif // LL_VO_AVATARSELF_H -- cgit v1.2.3 From bcc2547911fe6bd3ab433118dcdbfd84b3f024ec Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 9 Mar 2012 16:34:17 -0500 Subject: SH-2970 WIP - more phase tracking --- indra/newview/llvoavatar.cpp | 9 +++++++++ indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 8 ++++++++ indra/newview/llvoavatarself.h | 1 + 4 files changed, 19 insertions(+) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 9cfc0f2fdd..2dbf3ac698 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -983,6 +983,15 @@ void LLVOAvatar::stopPhase(const std::string& phase_name) timer.pause(); } +void LLVOAvatar::stopAllPhases() +{ + for (phase_map_t::iterator iter = mPhases.begin(); + iter != mPhases.end(); ++iter) + { + iter->second.pause(); + } +} + void LLVOAvatar::clearPhases() { mPhases.clear(); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 143b61b70b..df9d8143b1 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -287,6 +287,7 @@ public: LLFrameTimer& getPhaseTimer(const std::string& phase_name); void startPhase(const std::string& phase_name); void stopPhase(const std::string& phase_name); + void stopAllPhases(); void clearPhases(); LLSD dumpPhases(); protected: diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index ed3295c43c..27d499b9c4 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -98,6 +98,14 @@ void selfClearPhases() } } +void selfStopAllPhases() +{ + if (isAgentAvatarValid()) + { + gAgentAvatarp->stopAllPhases(); + } +} + using namespace LLVOAvatarDefines; /********************************************************************************* diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 9ac4306419..c9098f174c 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -390,6 +390,7 @@ BOOL isAgentAvatarValid(); void selfStartPhase(const std::string& phase_name); void selfStopPhase(const std::string& phase_name); +void selfStopAllPhases(); void selfClearPhases(); #endif // LL_VO_AVATARSELF_H -- cgit v1.2.3 From 2f4cb7c534852c7cec142d102520b01a4a7b5c0d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 12 Mar 2012 18:24:06 -0400 Subject: SH-2970 WIP - send per-appearance-change metrics packet (disabled) --- indra/newview/llagent.cpp | 1 + indra/newview/llvoavatarself.cpp | 48 ++++++++++++++++++++++++++++++++++++++++ indra/newview/llvoavatarself.h | 1 + 3 files changed, 50 insertions(+) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index af3a409944..9f764c6e41 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3779,6 +3779,7 @@ void LLAgent::sendAgentSetAppearance() return; } + gAgentAvatarp->sendAppearanceChangeMetrics(); llinfos << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << llendl; //dumpAvatarTEs( "sendAgentSetAppearance()" ); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 27d499b9c4..4e75582a93 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2089,6 +2089,7 @@ const std::string LLVOAvatarSelf::debugDumpAllLocalTextureDataInfo() const // Dump avatar metrics data. LLSD LLVOAvatarSelf::metricsData() { + // runway - add region info LLSD result; result["id"] = getID(); result["rez_status"] = getRezzedStatus(); @@ -2109,6 +2110,53 @@ LLSD LLVOAvatarSelf::metricsData() return result; } +class ViewerAppearanceChangeMetricsResponder: public LLCurl::Responder +{ +public: + ViewerAppearanceChangeMetricsResponder() + { + } + + virtual void completed(U32 status, + const std::string& reason, + const LLSD& content) + { + if (isGoodStatus(status)) + { + llinfos << "OK" << llendl; + result(content); + } + else + { + llwarns << "Failed " << status << " reason " << reason << llendl; + error(status,reason); + } + } +}; + +void LLVOAvatarSelf::sendAppearanceChangeMetrics() +{ + gAgentAvatarp->stopAllPhases(); + + LLSD msg = metricsData(); + msg["message"] = "ViewerAppearanceChangeMetrics"; + + llinfos << "message: " << msg << llendl; + std::string caps_url; + if (getRegion()) + { + // runway - change here to activate. + caps_url = "";//getRegion()->getCapability("ViewerMetrics"); + } + if (!caps_url.empty()) + { + LLCurlRequest::headers_t headers; + LLHTTPClient::post(caps_url, + msg, + new ViewerAppearanceChangeMetricsResponder); + } +} + const LLUUID& LLVOAvatarSelf::grabBakedTexture(EBakedTextureIndex baked_index) const { if (canGrabBakedTexture(baked_index)) diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index c9098f174c..fc1b602764 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -370,6 +370,7 @@ public: const std::string debugDumpLocalTextureDataInfo(const LLTexLayerSet* layerset) const; // Lists out state of this particular baked texture layer const std::string debugDumpAllLocalTextureDataInfo() const; // Lists out which baked textures are at highest LOD LLSD metricsData(); + void sendAppearanceChangeMetrics(); // send data associated with completing a change. private: LLFrameTimer mDebugSelfLoadTimer; F32 mDebugTimeWearablesLoaded; -- cgit v1.2.3 From ee758c1da0cf0c2436034109868003da56060e6c Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 12 Mar 2012 18:55:30 -0400 Subject: SH-2970 WIP - scoped phase tweaking, removed auto-phase-stop on metrics send --- indra/newview/llagent.cpp | 4 ++++ indra/newview/llappearancemgr.cpp | 2 +- indra/newview/llvoavatar.h | 18 ++++++++++++++++++ indra/newview/llvoavatarself.cpp | 2 +- 4 files changed, 24 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9f764c6e41..6e350a5b1d 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3257,6 +3257,10 @@ void LLAgent::processControlRelease(LLMessageSystem *msg, void **) void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void **user_data) { gAgentQueryManager.mNumPendingQueries--; + if (gAgentQueryManager.mNumPendingQueries == 0) + { + selfStopPhase("fetch_texture_cache_entries"); + } if (!isAgentAvatarValid() || gAgentAvatarp->isDead()) { diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 13f76c0593..fe0b3ff676 100755 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1708,7 +1708,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) return; } - selfStartPhase("update_appearance_from_cof"); + LLVOAvatar::ScopedPhaseSetter(gAgentAvatarp,"update_appearance_from_cof"); BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index df9d8143b1..76261c0dc8 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -290,6 +290,24 @@ public: void stopAllPhases(); void clearPhases(); LLSD dumpPhases(); + + class ScopedPhaseSetter + { + public: + ScopedPhaseSetter(LLVOAvatar* avatar, std::string phase_name): + mAvatar(avatar),mPhaseName(phase_name) + { + if (mAvatar) { mAvatar->startPhase(mPhaseName); } + } + ~ScopedPhaseSetter() + { + if (mAvatar) { mAvatar->stopPhase(mPhaseName); } + } + private: + std::string mPhaseName; + LLVOAvatar* mAvatar; + }; + protected: BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4e75582a93..33f33b202f 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2136,7 +2136,7 @@ public: void LLVOAvatarSelf::sendAppearanceChangeMetrics() { - gAgentAvatarp->stopAllPhases(); + // gAgentAvatarp->stopAllPhases(); LLSD msg = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; -- cgit v1.2.3 From b4b0800bfd8e4a92a9e7ccbfbf24be2a0b4bef4a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 14 Mar 2012 17:46:44 -0400 Subject: SH-2970 FIX - per-region logging of basic avatar stats --- indra/newview/CMakeLists.txt | 0 indra/newview/llappviewer.cpp | 1 + indra/newview/llviewerassetstats.cpp | 29 +++++++++++++++++++++++++ indra/newview/llviewerassetstats.h | 8 ++++++- indra/newview/llvoavatarself.cpp | 2 +- indra/newview/tests/llviewerassetstats_test.cpp | 9 ++++++++ 6 files changed, 47 insertions(+), 2 deletions(-) mode change 100644 => 100755 indra/newview/CMakeLists.txt mode change 100644 => 100755 indra/newview/llviewerassetstats.cpp mode change 100644 => 100755 indra/newview/llviewerassetstats.h mode change 100644 => 100755 indra/newview/tests/llviewerassetstats_test.cpp (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3f511748ea..bea8303d69 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4197,6 +4197,7 @@ void LLAppViewer::idle() // The 5-second interval is nice for this purpose. If the object debug // bit moves or is disabled, please give this a suitable home. LLViewerAssetStatsFF::record_fps_main(gFPSClamped); + LLViewerAssetStatsFF::record_avatar_stats(); } } diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp old mode 100644 new mode 100755 index e621cf647e..4928f93a51 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -30,6 +30,7 @@ #include "llregionhandle.h" #include "stdtypes.h" +#include "llvoavatar.h" /* * Classes and utility functions for per-thread and per-region @@ -126,6 +127,8 @@ LLViewerAssetStats::PerRegionStats::merge(const LLViewerAssetStats::PerRegionSta mFPS.merge(src.mFPS); } + // Avatar stats - data all comes from main thread, so leave alone. + // Requests for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i) { @@ -133,6 +136,7 @@ LLViewerAssetStats::PerRegionStats::merge(const LLViewerAssetStats::PerRegionSta mRequests[i].mDequeued.merge(src.mRequests[i].mDequeued); mRequests[i].mResponse.merge(src.mRequests[i].mResponse); } + } @@ -252,6 +256,14 @@ LLViewerAssetStats::recordFPS(F32 fps) mCurRegionStats->mFPS.record(fps); } +void +LLViewerAssetStats::recordAvatarStats() +{ + std::vector rez_counts; + LLVOAvatar::getNearbyRezzedStats(rez_counts); + mCurRegionStats->mAvatarRezStates = rez_counts; +} + LLSD LLViewerAssetStats::asLLSD(bool compact_output) { @@ -282,6 +294,10 @@ LLViewerAssetStats::asLLSD(bool compact_output) static const LLSD::String max_tag("max"); static const LLSD::String mean_tag("mean"); + // Avatar sub-tags + static const LLSD::String avatar_tag("avatar"); + static const LLSD::String avatar_nearby_tag("nearby"); + const duration_t now = LLViewerAssetStatsFF::get_timestamp(); mCurRegionStats->accumulateTime(now); @@ -329,6 +345,11 @@ LLViewerAssetStats::asLLSD(bool compact_output) slot[max_tag] = LLSD(F64(stats.mFPS.getMax())); slot[mean_tag] = LLSD(F64(stats.mFPS.getMean())); } + reg_stat[avatar_tag][avatar_nearby_tag] = LLSD::emptyArray(); + for (S32 j = 0; j < stats.mAvatarRezStates.size(); ++j) + { + reg_stat[avatar_tag][avatar_nearby_tag].append(stats.mAvatarRezStates[j]); + } U32 grid_x(0), grid_y(0); grid_from_region_handle(it->first, &grid_x, &grid_y); @@ -439,6 +460,14 @@ record_fps_main(F32 fps) gViewerAssetStatsMain->recordFPS(fps); } +void +record_avatar_stats() +{ + if (! gViewerAssetStatsMain) + return; + + gViewerAssetStatsMain->recordAvatarStats(); +} // 'thread1' - should be for TextureFetch thread diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h old mode 100644 new mode 100755 index 73ec5974b2..6cb0cc4060 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -125,7 +125,8 @@ public: mRegionHandle(src.mRegionHandle), mTotalTime(src.mTotalTime), mStartTimestamp(src.mStartTimestamp), - mFPS(src.mFPS) + mFPS(src.mFPS), + mAvatarRezStates(src.mAvatarRezStates) { for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i) { @@ -148,6 +149,7 @@ public: duration_t mTotalTime; duration_t mStartTimestamp; LLSimpleStatMMM<> mFPS; + std::vector mAvatarRezStates; struct prs_group { @@ -181,6 +183,9 @@ public: // Frames-Per-Second Samples void recordFPS(F32 fps); + // Avatar-related statistics + void recordAvatarStats(); + // Merge a source instance into a destination instance. This is // conceptually an 'operator+=()' method: // - counts are added @@ -310,6 +315,7 @@ void record_response_main(LLViewerAssetType::EType at, bool with_http, bool is_t void record_fps_main(F32 fps); +void record_avatar_stats(); /** * Region context, event and duration loggers for Thread 1. diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 33f33b202f..27de7df51c 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2141,7 +2141,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() LLSD msg = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; - llinfos << "message: " << msg << llendl; + llinfos << avString() << "message: " << msg << llendl; std::string caps_url; if (getRegion()) { diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp old mode 100644 new mode 100755 index 3faddc13c1..5e18f91b23 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -35,6 +35,15 @@ #include "lluuid.h" #include "llsdutil.h" #include "llregionhandle.h" +#include "../llvoavatar.h" + +void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) +{ + counts.resize(3); + counts[0] = 0; + counts[1] = 0; + counts[2] = 1; +} static const char * all_keys[] = { -- cgit v1.2.3 From 3672956f0da4020335fc8c3066f1099c1ceaa00d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 15 Mar 2012 11:57:29 -0700 Subject: added stats tracking for texture/object cache hit rates and texture cache read latency --- indra/llui/llstatbar.cpp | 2 +- indra/newview/lltexturefetch.cpp | 17 ++++++++- indra/newview/lltexturefetch.h | 3 ++ indra/newview/llviewerobjectlist.cpp | 5 ++- indra/newview/llviewerobjectlist.h | 2 ++ .../newview/skins/default/xui/en/floater_stats.xml | 41 +++++++++++++++++++++- 6 files changed, 66 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/llui/llstatbar.cpp b/indra/llui/llstatbar.cpp index ec4db14790..04cce7878e 100644 --- a/indra/llui/llstatbar.cpp +++ b/indra/llui/llstatbar.cpp @@ -272,7 +272,7 @@ LLRect LLStatBar::getRequiredRect() { if (mDisplayHistory) { - rect.mTop = 67; + rect.mTop = 35 + mStatp->getNumBins(); } else { diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f18aa8b4e6..92e88fcfe7 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -53,6 +53,9 @@ #include "llviewerassetstats.h" #include "llworld.h" +LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128); +LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128); + ////////////////////////////////////////////////////////////////////////////// class LLTextureFetchWorker : public LLWorkerClass { @@ -242,6 +245,8 @@ private: S32 mDecodedDiscard; LLFrameTimer mRequestedTimer; LLFrameTimer mFetchTimer; + LLTimer mCacheReadTimer; + F32 mCacheReadTime; LLTextureCache::handle_t mCacheReadHandle; LLTextureCache::handle_t mCacheWriteHandle; U8* mBuffer; @@ -653,6 +658,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mRequestedDiscard(-1), mLoadedDiscard(-1), mDecodedDiscard(-1), + mCacheReadTime(0.f), mCacheReadHandle(LLTextureCache::nullHandle()), mCacheWriteHandle(LLTextureCache::nullHandle()), mBuffer(NULL), @@ -926,6 +932,7 @@ bool LLTextureFetchWorker::doWork(S32 param) CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage); mCacheReadHandle = mFetcher->mTextureCache->readFromCache(filename, mID, cache_priority, offset, size, responder); + mCacheReadTimer.reset(); } else if (mUrl.empty()) { @@ -934,6 +941,7 @@ bool LLTextureFetchWorker::doWork(S32 param) CacheReadResponder* responder = new CacheReadResponder(mFetcher, mID, mFormattedImage); mCacheReadHandle = mFetcher->mTextureCache->readFromCache(mID, cache_priority, offset, size, responder); + mCacheReadTimer.reset(); } else if(mCanUseHTTP) { @@ -986,7 +994,7 @@ bool LLTextureFetchWorker::doWork(S32 param) LL_DEBUGS("Texture") << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize() << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight()) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; - // fall through + LLTextureFetch::sCacheHitRate.addValue(100.f); } else { @@ -1002,6 +1010,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mState = LOAD_FROM_NETWORK; } // fall through + LLTextureFetch::sCacheHitRate.addValue(0.f); } } @@ -1780,6 +1789,7 @@ void LLTextureFetchWorker::callbackDecoded(bool success, LLImageRaw* raw, LLImag mDecoded = TRUE; // llinfos << mID << " : DECODE COMPLETE " << llendl; setPriority(LLWorkerThread::PRIORITY_HIGH | mWorkPriority); + mCacheReadTime = mCacheReadTimer.getElapsedTimeF32(); } ////////////////////////////////////////////////////////////////////////////// @@ -2092,6 +2102,11 @@ bool LLTextureFetch::getRequestFinished(const LLUUID& id, S32& discard_level, discard_level = worker->mDecodedDiscard; raw = worker->mRawImage; aux = worker->mAuxImage; + F32 cache_read_time = worker->mCacheReadTime; + if (cache_read_time != 0.f) + { + sCacheReadLatency.addValue(cache_read_time * 1000.f); + } res = true; LL_DEBUGS("Texture") << id << ": Request Finished. State: " << worker->mState << " Discard: " << discard_level << LL_ENDL; worker->unlockWorkMutex(); diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 35df7d816f..710dd67e99 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -164,6 +164,9 @@ private: LLMutex mQueueMutex; //to protect mRequestMap and mCommands only LLMutex mNetworkQueueMutex; //to protect mNetworkQueue, mHTTPTextureQueue and mCancelQueue. + static LLStat sCacheHitRate; + static LLStat sCacheReadLatency; + LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; LLCurlRequest* mCurlGetRequest; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 6912faa9ec..54ccfb9aae 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -91,8 +91,9 @@ extern LLPipeline gPipeline; // Statics for object lookup tables. U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check. -std::map LLViewerObjectList::sIPAndPortToIndex; +std::map LLViewerObjectList::sIPAndPortToIndex; std::map LLViewerObjectList::sIndexAndLocalIDToUUID; +LLStat LLViewerObjectList::sCacheHitRate("object_cache_hits", 128); LLViewerObjectList::LLViewerObjectList() { @@ -542,6 +543,8 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, } justCreated = TRUE; mNumNewObjects++; + sCacheHitRate.addValue(cached ? 100.f : 0.f); + } diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index c5f2a2c1ee..64925f46ae 100644 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -192,6 +192,8 @@ protected: std::vector mOrphanChildren; // UUID's of orphaned objects S32 mNumOrphans; + static LLStat sCacheHitRate; + typedef std::vector > vobj_list_t; vobj_list_t mObjects; diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index 2fd932786b..9400f7b94f 100644 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -149,13 +149,52 @@ show_per_sec="true" show_bar="false"> + + - + + + + Date: Thu, 15 Mar 2012 13:01:14 -0700 Subject: SH-3047 : Read the number of levels from the j2c image header instead of relying on hacked computation based on width / height. --- indra/integration_tests/llimage_libtest/llimage_libtest.cpp | 6 +++--- indra/llimage/llimage.cpp | 3 ++- indra/llimage/llimage.h | 5 ++++- indra/llimage/llimagej2c.cpp | 3 +++ indra/llkdu/llimagej2ckdu.cpp | 10 ++++++---- 5 files changed, 18 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index 48e876429d..9d524367ed 100644 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -104,9 +104,9 @@ void output_image_stats(LLPointer image, const std::string &fi // Print out some statistical data on the image std::cout << "Image stats for : " << filename << ", extension : " << image->getExtension() << std::endl; - std::cout << " with : " << (int)(image->getWidth()) << ", height : " << (int)(image->getHeight()) << std::endl; - std::cout << " comp : " << (int)(image->getComponents()) << ", levels : " << (int)(image->getDiscardLevel()) << std::endl; - std::cout << " head : " << (int)(image->calcHeaderSize()) << ", data : " << (int)(image->getDataSize()) << std::endl; + std::cout << " with : " << (int)(image->getWidth()) << ", height : " << (int)(image->getHeight()) << std::endl; + std::cout << " comp : " << (int)(image->getComponents()) << ", levels : " << (int)(image->getLevels()) << std::endl; + std::cout << " head : " << (int)(image->calcHeaderSize()) << ", data : " << (int)(image->getDataSize()) << std::endl; return; } diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 56e01ac851..091e78e358 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1334,7 +1334,8 @@ LLImageFormatted::LLImageFormatted(S8 codec) mCodec(codec), mDecoding(0), mDecoded(0), - mDiscardLevel(-1) + mDiscardLevel(-1), + mLevels(0) { mMemType = LLMemType::MTYPE_IMAGEFORMATTED; } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 4469c9e860..847ba8c11c 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -313,6 +313,8 @@ public: BOOL isDecoded() const { return mDecoded ? TRUE : FALSE; } void setDiscardLevel(S8 discard_level) { mDiscardLevel = discard_level; } S8 getDiscardLevel() const { return mDiscardLevel; } + S8 getLevels() const { return mLevels; } + void setLevels(S8 nlevels) { mLevels = nlevels; } // setLastError needs to be deferred for J2C images since it may be called from a DLL virtual void resetLastError(); @@ -325,7 +327,8 @@ protected: S8 mCodec; S8 mDecoding; S8 mDecoded; // unused, but changing LLImage layout requires recompiling static Mac/Linux libs. 2009-01-30 JC - S8 mDiscardLevel; + S8 mDiscardLevel; // Current resolution level worked on. 0 = full res, 1 = half res, 2 = quarter res, etc... + S8 mLevels; // Number of resolution levels in that image. Min is 1. 0 means unknown. public: static S32 sGlobalFormattedMemory; diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index cc8cb66d73..fbf4b769e1 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -142,6 +142,7 @@ BOOL LLImageJ2C::updateData() BOOL LLImageJ2C::initDecode(LLImageRaw &raw_image, int discard_level, int* region) { + setDiscardLevel(discard_level != -1 ? discard_level : 0); return mImpl->initDecode(*this,raw_image,discard_level,region); } @@ -286,6 +287,8 @@ S32 LLImageJ2C::calcHeaderSize() // calcDataSize() returns how many bytes to read // to load discard_level (including header and higher discard levels) +// *TODO: This is deeply wrong. That size should be taken from the image file header or other +// relevant infos. In any case, this is only an approximation. S32 LLImageJ2C::calcDataSize(S32 discard_level) { discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL); diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index c156ed0cef..eed4139f3f 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -291,8 +291,13 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECod } } - base.setSize(dims.size.x, dims.size.y, components); + // Get the number of resolution levels in that image + mLevels = mCodeStreamp->get_min_dwt_levels(); + // Set the base dimensions + base.setSize(dims.size.x, dims.size.y, components); + base.setLevels(mLevels); + if (!keep_codestream) { mCodeStreamp->destroy(); @@ -394,12 +399,9 @@ BOOL LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco // Resize raw_image according to the image to be decoded kdu_dims dims; mCodeStreamp->get_dims(0,dims); - // *TODO: Use the real number of levels read from the file throughout the code instead of relying on an infered value from dimensions - //S32 levels = mCodeStreamp->get_min_dwt_levels(); S32 channels = base.getComponents() - first_channel; channels = llmin(channels,max_channel_count); raw_image.resize(dims.size.x, dims.size.y, channels); - //llinfos << "j2c image dimension: width = " << dims.size.x << ", height = " << dims.size.y << ", channels = " << channels << ", levels = " << levels << llendl; if (!mTileIndicesp) { -- cgit v1.2.3 From fe7a4d0183bfb19784b61124ef4c377c9a5d42d2 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 15 Mar 2012 14:07:54 -0700 Subject: SH-3047 : Add a load_size argument to llimage_libtest and allow partial image file to be loaded. --- .../llimage_libtest/llimage_libtest.cpp | 28 +++++++++++++++++++--- indra/llimage/llimage.cpp | 15 ++++++++---- indra/llimage/llimage.h | 2 +- 3 files changed, 36 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index 9d524367ed..50dde971af 100644 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -54,6 +54,11 @@ static const char USAGE[] = "\n" " -o, --output OR \n" " List of image files to create (assumes same order as for input files)\n" " OR 3 letters file type extension to convert each input file into.\n" +" -load, --load_size \n" +" Portion of the input image to load, in bytes." +" Will load the whole image if 0 or if the size requested is more than the file size." +" This parameter will be applied to any input image type but really makes sense only" +" for j2c images." " -r, --region \n" " Crop region applied to the input files in pixels.\n" " Only used for j2c images. Default is no region cropping.\n" @@ -112,12 +117,12 @@ void output_image_stats(LLPointer image, const std::string &fi } // Load an image from file and return a raw (decompressed) instance of its data -LLPointer load_image(const std::string &src_filename, int discard_level, int* region, bool output_stats) +LLPointer load_image(const std::string &src_filename, int discard_level, int* region, int load_size, bool output_stats) { LLPointer image = create_image(src_filename); // This just loads the image file stream into a buffer. No decoding done. - if (!image->load(src_filename)) + if (!image->load(src_filename, load_size)) { return NULL; } @@ -310,6 +315,7 @@ int main(int argc, char** argv) bool image_stats = false; int* region = NULL; int discard_level = -1; + int load_size = 0; int precincts_size = -1; int blocks_size = -1; int levels = 0; @@ -396,6 +402,22 @@ int main(int argc, char** argv) discard_level = llclamp(discard_level,0,5); } } + else if (!strcmp(argv[arg], "--load_size") || !strcmp(argv[arg], "-load")) + { + std::string value_str; + if ((arg + 1) < argc) + { + value_str = argv[arg+1]; + } + if (((arg + 1) >= argc) || (value_str[0] == '-')) + { + std::cout << "No valid --load_size argument given, load_size ignored" << std::endl; + } + else + { + load_size = atoi(value_str.c_str()); + } + } else if (!strcmp(argv[arg], "--precincts") || !strcmp(argv[arg], "-p")) { std::string value_str; @@ -510,7 +532,7 @@ int main(int argc, char** argv) for (; in_file != in_end; ++in_file, ++out_file) { // Load file - LLPointer raw_image = load_image(*in_file, discard_level, region, image_stats); + LLPointer raw_image = load_image(*in_file, discard_level, region, load_size, image_stats); if (!raw_image) { std::cout << "Error: Image " << *in_file << " could not be loaded" << std::endl; diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 091e78e358..937655a22d 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1562,7 +1562,7 @@ void LLImageFormatted::appendData(U8 *data, S32 size) //---------------------------------------------------------------------------- -BOOL LLImageFormatted::load(const std::string &filename) +BOOL LLImageFormatted::load(const std::string &filename, int load_size) { resetLastError(); @@ -1581,14 +1581,19 @@ BOOL LLImageFormatted::load(const std::string &filename) return FALSE; } + // Constrain the load size to acceptable values + if ((load_size == 0) || (load_size > file_size)) + { + load_size = file_size; + } BOOL res; - U8 *data = allocateData(file_size); - apr_size_t bytes_read = file_size; + U8 *data = allocateData(load_size); + apr_size_t bytes_read = load_size; apr_status_t s = apr_file_read(apr_file, data, &bytes_read); // modifies bytes_read - if (s != APR_SUCCESS || (S32) bytes_read != file_size) + if (s != APR_SUCCESS || (S32) bytes_read != load_size) { deleteData(); - setLastError("Unable to read entire file",filename); + setLastError("Unable to read file",filename); res = FALSE; } else diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 847ba8c11c..eba8362f1c 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -294,7 +294,7 @@ public: // getRawDiscardLevel() by default returns mDiscardLevel, but may be overridden (LLImageJ2C) virtual S8 getRawDiscardLevel() { return mDiscardLevel; } - BOOL load(const std::string& filename); + BOOL load(const std::string& filename, int load_size = 0); BOOL save(const std::string& filename); virtual BOOL updateData() = 0; // pure virtual -- cgit v1.2.3 From b98b4ee16827f0ae5370b301f1b6c3f50842ed0d Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 15 Mar 2012 17:10:31 -0400 Subject: SH-2970 WIP - pretty-print some metrics for more readable log --- indra/newview/lltexturefetch.cpp | 3 ++- indra/newview/llvoavatar.cpp | 4 +++- indra/newview/llvoavatarself.cpp | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) mode change 100644 => 100755 indra/newview/lltexturefetch.cpp (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp old mode 100644 new mode 100755 index f18aa8b4e6..dc76131c91 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -52,6 +52,7 @@ #include "llviewerstats.h" #include "llviewerassetstats.h" #include "llworld.h" +#include "llsdutil.h" ////////////////////////////////////////////////////////////////////////////// class LLTextureFetchWorker : public LLWorkerClass @@ -2959,7 +2960,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) // In QA mode, Metrics submode, log the result for ease of testing if (fetcher->isQAMode()) { - LL_INFOS("Textures") << merged_llsd << LL_ENDL; + LL_INFOS("Textures") << ll_pretty_print_sd(merged_llsd) << LL_ENDL; } gViewerAssetStatsThread1->reset(); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2dbf3ac698..900ccd3fbd 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -101,6 +101,8 @@ #include "llvoicevisualizer.h" // Ventrella #include "lldebugmessagebox.h" +#include "llsdutil.h" + extern F32 SPEED_ADJUST_MAX; extern F32 SPEED_ADJUST_MAX_SEC; extern F32 ANIM_SPEED_MAX; @@ -800,7 +802,7 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c if (gAgentAvatarp && !gAgentAvatarp->isDead()) // not safe to call during ~LLVOAvatarself { LLSD metrics = gAgentAvatarp->metricsData(); - llinfos << gAgentAvatarp->avString() << " metrics " << metrics << llendl; + llinfos << gAgentAvatarp->avString() << " metrics " << ll_pretty_print_sd(metrics) << llendl; } if (gSavedSettings.getBOOL("DebugAvatarRezTime")) diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 27de7df51c..4ff6db9b63 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -58,6 +58,7 @@ #include "llappearancemgr.h" #include "llmeshrepository.h" #include "llvovolume.h" +#include "llsdutil.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -2141,7 +2142,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() LLSD msg = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; - llinfos << avString() << "message: " << msg << llendl; + llinfos << avString() << "message: " << ll_pretty_print_sd(msg) << llendl; std::string caps_url; if (getRegion()) { -- cgit v1.2.3 From 4f19eb3951366ca6a3db9de4a72cb0c1f8bc89d1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 15 Mar 2012 21:59:37 -0700 Subject: EXP-3049 : Implement partial loading using the calcDataSize(discard_level) computation found in the viewer. --- .../llimage_libtest/llimage_libtest.cpp | 44 ++++++++++++++++++---- 1 file changed, 37 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp index 50dde971af..36c5b67826 100644 --- a/indra/integration_tests/llimage_libtest/llimage_libtest.cpp +++ b/indra/integration_tests/llimage_libtest/llimage_libtest.cpp @@ -55,10 +55,10 @@ static const char USAGE[] = "\n" " List of image files to create (assumes same order as for input files)\n" " OR 3 letters file type extension to convert each input file into.\n" " -load, --load_size \n" -" Portion of the input image to load, in bytes." -" Will load the whole image if 0 or if the size requested is more than the file size." -" This parameter will be applied to any input image type but really makes sense only" -" for j2c images." +" Portion of the input file to load, in bytes." +" If (load == 0), it will load the whole file." +" If (load == -1), it will load the size relevant to reach the requested discard level (see -d)." +" Only valid for j2c images. Default is 0 (load whole file).\n" " -r, --region \n" " Crop region applied to the input files in pixels.\n" " Only used for j2c images. Default is no region cropping.\n" @@ -121,10 +121,40 @@ LLPointer load_image(const std::string &src_filename, int discard_le { LLPointer image = create_image(src_filename); - // This just loads the image file stream into a buffer. No decoding done. - if (!image->load(src_filename, load_size)) + // We support partial loading only for j2c images + if (image->getCodec() == IMG_CODEC_J2C) { - return NULL; + // Load the header + if (!image->load(src_filename, 600)) + { + return NULL; + } + S32 h = ((LLImageJ2C*)(image.get()))->calcHeaderSize(); + S32 d = (load_size > 0 ? ((LLImageJ2C*)(image.get()))->calcDiscardLevelBytes(load_size) : 0); + S8 r = ((LLImageJ2C*)(image.get()))->getRawDiscardLevel(); + std::cout << "Merov debug : header = " << h << ", load_size = " << load_size << ", discard level = " << d << ", raw discard level = " << r << std::endl; + for (d = 0; d < MAX_DISCARD_LEVEL; d++) + { + S32 data_size = ((LLImageJ2C*)(image.get()))->calcDataSize(d); + std::cout << "Merov debug : discard_level = " << d << ", data_size = " << data_size << std::endl; + } + if (load_size < 0) + { + load_size = (discard_level != -1 ? ((LLImageJ2C*)(image.get()))->calcDataSize(discard_level) : 0); + } + // Load the requested byte range + if (!image->load(src_filename, load_size)) + { + return NULL; + } + } + else + { + // This just loads the image file stream into a buffer. No decoding done. + if (!image->load(src_filename)) + { + return NULL; + } } if( (image->getComponents() != 3) && (image->getComponents() != 4) ) -- cgit v1.2.3 From 3f4bca6887116a236757ffef82e5ff70e10aabdc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 16 Mar 2012 10:31:15 -0400 Subject: SH-3044 - tag avatar log messages LL_INFOS(Avatar) --- indra/newview/llagent.cpp | 6 ++-- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llappearancemgr.cpp | 68 +++++++++++++++++++------------------- indra/newview/lltexlayer.cpp | 4 +-- indra/newview/llvoavatar.cpp | 44 ++++++++++++------------ indra/newview/llvoavatarself.cpp | 6 ++-- 6 files changed, 65 insertions(+), 65 deletions(-) mode change 100755 => 100644 indra/newview/llagent.cpp mode change 100755 => 100644 indra/newview/llagentwearables.cpp mode change 100755 => 100644 indra/newview/llappearancemgr.cpp mode change 100755 => 100644 indra/newview/lltexlayer.cpp mode change 100755 => 100644 indra/newview/llvoavatar.cpp (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp old mode 100755 new mode 100644 index 6e350a5b1d..b8f5b5af58 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3784,7 +3784,7 @@ void LLAgent::sendAgentSetAppearance() } gAgentAvatarp->sendAppearanceChangeMetrics(); - llinfos << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << llendl; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; //dumpAvatarTEs( "sendAgentSetAppearance()" ); LLMessageSystem* msg = gMessageSystem; @@ -3831,14 +3831,14 @@ void LLAgent::sendAgentSetAppearance() // only update cache entries if we have all our baked textures if (textures_current) { - llinfos << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << llendl; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { BOOL generate_valid_hash = TRUE; if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLVOAvatarDefines::EBakedTextureIndex)baked_index)) { generate_valid_hash = FALSE; - llinfos << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << llendl; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL; } const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp old mode 100755 new mode 100644 index bb6b98096b..e1176fed3a --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1633,7 +1633,7 @@ void LLAgentWearables::queryWearableCache() gAgentAvatarp->outputRezTiming("Fetching textures from cache"); } - llinfos << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << llendl; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); gAgentQueryManager.mNumPendingQueries++; gAgentQueryManager.mWearablesCacheQueryID++; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp old mode 100755 new mode 100644 index fe0b3ff676..b98bcdc622 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -180,7 +180,7 @@ public: protected: ~LLWearInventoryCategoryCallback() { - llinfos << self_av_string() << "done all inventory callbacks" << llendl; + LL_INFOS("Avatar") << self_av_string() << "done all inventory callbacks" << LL_ENDL; // Is the destructor called by ordinary dereference, or because the app's shutting down? // If the inventory callback manager goes away, we're shutting down, no longer want the callback. @@ -225,7 +225,7 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() { - llinfos << self_av_string() << "done update appearance on destroy" << llendl; + LL_INFOS("Avatar") << self_av_string() << "done update appearance on destroy" << LL_ENDL; selfStopPhase("update_appearance_on_destroy"); @@ -240,7 +240,7 @@ void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item) LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item); const std::string item_name = item ? item->getName() : "ITEM NOT FOUND"; #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << llendl; + LL_INFOS("Avatar") << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << LL_ENDL; #endif mFireCount++; } @@ -471,7 +471,7 @@ void LLWearableHoldingPattern::onAllComplete() // Activate all gestures in this folder if (mGestItems.count() > 0) { - llinfos << self_av_string() << "Activating " << mGestItems.count() << " gestures" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Activating " << mGestItems.count() << " gestures" << LL_ENDL; LLGestureMgr::instance().activateGestures(mGestItems); @@ -488,13 +488,13 @@ void LLWearableHoldingPattern::onAllComplete() } // Update wearables. - llinfos << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << llendl; + LL_INFOS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; LLAppearanceMgr::instance().updateAgentWearables(this, false); // Update attachments to match those requested. if (isAgentAvatarValid()) { - llinfos << self_av_string() << "Updating " << mObjItems.count() << " attachments" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; LLAgentWearables::userUpdateAttachments(mObjItems); } @@ -538,8 +538,8 @@ bool LLWearableHoldingPattern::pollFetchCompletion() if (done) { - llinfos << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out - << " elapsed " << mWaitTime.getElapsedTimeF32() << llendl; + LL_INFOS("Avatar") << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out + << " elapsed " << mWaitTime.getElapsedTimeF32() << LL_ENDL; mFired = true; @@ -625,7 +625,7 @@ public: llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } - llinfos << self_av_string() << "Recovered item for type " << mType << llendl; + LL_INFOS("Avatar") << self_av_string() << "Recovered item for type " << mType << LL_ENDL; LLViewerInventoryItem *itemp = gInventory.getItem(item_id); mWearable->setItemID(item_id); LLPointer cb = new RecoveredItemLinkCB(mType,mWearable,mHolder); @@ -692,7 +692,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable)) { // Wearable link that was never resolved; remove links to it from COF - llinfos << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << llendl; + LL_INFOS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false); } } @@ -712,11 +712,11 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (!done) { - llinfos << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() + LL_INFOS("Avatar") << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() << " links " << mTypesToLink.size() << " wearables, timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() - << " done " << done << llendl; + << " done " << done << LL_ENDL; } if (done) @@ -759,7 +759,7 @@ void LLWearableHoldingPattern::handleLateArrivals() llwarns << self_av_string() << "Late arrivals not handled - in middle of missing wearables processing" << llendl; } - llinfos << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL; // Update mFoundList using late-arriving wearables. std::set replaced_types; @@ -839,7 +839,7 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) } mResolved += 1; // just counting callbacks, not successes. - llinfos << self_av_string() << "resolved " << mResolved << "/" << getFoundList().size() << llendl; + LL_INFOS("Avatar") << self_av_string() << "resolved " << mResolved << "/" << getFoundList().size() << LL_ENDL; if (!wearable) { llwarns << self_av_string() << "no wearable found" << llendl; @@ -1438,7 +1438,7 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid); const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << llendl; + LL_INFOS("Avatar") << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << LL_ENDL; #endif } } @@ -1446,7 +1446,7 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); - llinfos << self_av_string() << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << llendl; + LL_INFOS("Avatar") << self_av_string() << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << LL_ENDL; const LLUUID cof = getCOF(); @@ -1508,26 +1508,26 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) gInventory.notifyObservers(); // Create links to new COF contents. - llinfos << self_av_string() << "creating LLUpdateAppearanceOnDestroy" << llendl; + LL_INFOS("Avatar") << self_av_string() << "creating LLUpdateAppearanceOnDestroy" << LL_ENDL; LLPointer link_waiter = new LLUpdateAppearanceOnDestroy(!append); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << self_av_string() << "Linking body items" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Linking body items" << LL_ENDL; #endif linkAll(cof, body_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << self_av_string() << "Linking wear items" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Linking wear items" << LL_ENDL; #endif linkAll(cof, wear_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << self_av_string() << "Linking obj items" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Linking obj items" << LL_ENDL; #endif linkAll(cof, obj_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - llinfos << self_av_string() << "Linking gesture items" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Linking gesture items" << LL_ENDL; #endif linkAll(cof, gest_items, link_waiter); @@ -1536,7 +1536,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { createBaseOutfitLink(category, link_waiter); } - llinfos << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << llendl; + LL_INFOS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } void LLAppearanceMgr::updatePanelOutfitName(const std::string& name) @@ -1693,7 +1693,7 @@ void LLAppearanceMgr::enforceItemRestrictions() ++it) { LLViewerInventoryItem *item = *it; - llinfos << self_av_string() << "purging duplicate or excess item " << item->getName() << llendl; + LL_INFOS("Avatar") << self_av_string() << "purging duplicate or excess item " << item->getName() << LL_ENDL; gInventory.purgeObject(item->getUUID()); } gInventory.notifyObservers(); @@ -1712,7 +1712,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); - llinfos << self_av_string() << "starting" << llendl; + LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) @@ -1888,8 +1888,8 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool gAgentWearables.notifyLoadingStarted(); - llinfos << self_av_string() << "wearInventoryCategory( " << category->getName() - << " )" << llendl; + LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName() + << " )" << LL_ENDL; callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, &LLAppearanceMgr::instance(), @@ -1898,7 +1898,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) { - llinfos << self_av_string() << "starting" << llendl; + LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; // We now have an outfit ready to be copied to agent inventory. Do // it, and wear that outfit normally. @@ -1981,8 +1981,8 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego // wearables being dirty. if(!category) return; - llinfos << self_av_string() << "wearInventoryCategoryOnAvatar( " << category->getName() - << " )" << llendl; + LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategoryOnAvatar( " << category->getName() + << " )" << LL_ENDL; if (gAgentCamera.cameraCustomizeAvatar()) { @@ -1995,7 +1995,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego void LLAppearanceMgr::wearOutfitByName(const std::string& name) { - llinfos << self_av_string() << "Wearing category " << name << llendl; + LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; //inc_busy_count(); LLInventoryModel::cat_array_t cat_array; @@ -2318,7 +2318,7 @@ const std::string OTHER_GESTURES_FOLDER = "Other Gestures"; void LLAppearanceMgr::copyLibraryGestures() { - llinfos << self_av_string() << "Copying library gestures" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Copying library gestures" << LL_ENDL; // Copy gestures LLUUID lib_gesture_cat_id = @@ -2378,7 +2378,7 @@ void LLAppearanceMgr::copyLibraryGestures() } else { - llinfos << self_av_string() << "initiating fetch and copy for " << folder_name << " cat_id " << cat_id << llendl; + LL_INFOS("Avatar") << self_av_string() << "initiating fetch and copy for " << folder_name << " cat_id " << cat_id << LL_ENDL; callAfterCategoryFetch(cat_id, boost::bind(&LLAppearanceMgr::shallowCopyCategory, &LLAppearanceMgr::instance(), @@ -2392,7 +2392,7 @@ void LLAppearanceMgr::autopopulateOutfits() // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account) // then auto-populate outfits from the library into the My Outfits folder. - llinfos << self_av_string() << "avatar fully visible" << llendl; + LL_INFOS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL; static bool check_populate_my_outfits = true; if (check_populate_my_outfits && @@ -2779,7 +2779,7 @@ void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items, { asset_id = linked_item->getAssetUUID(); } - llinfos << self_av_string() << msg << " " << i <<" " << (item ? item->getName() : "(nullitem)") << " " << asset_id.asString() << llendl; + LL_INFOS("Avatar") << self_av_string() << msg << " " << i <<" " << (item ? item->getName() : "(nullitem)") << " " << asset_id.asString() << LL_ENDL; } } diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp old mode 100755 new mode 100644 index 0802abd005..c9aaf40f9d --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -580,7 +580,7 @@ void LLTexLayerSetBuffer::doUpload() args["BODYREGION"] = mTexLayerSet->getBodyRegionName(); args["RESOLUTION"] = lod_str; LLNotificationsUtil::add("AvatarRezSelfBakedTextureUploadNotification",args); - llinfos << self_av_string() << "Uploading [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Uploading [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << LL_ENDL; } } else @@ -634,7 +634,7 @@ void LLTexLayerSetBuffer::doUpdate() args["BODYREGION"] = mTexLayerSet->getBodyRegionName(); args["RESOLUTION"] = lod_str; LLNotificationsUtil::add("AvatarRezSelfBakedTextureUpdateNotification",args); - llinfos << self_av_string() << "Locally updating [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUpdateTimer.getElapsedTimeF32() << " ]" << llendl; + LL_INFOS("Avatar") << self_av_string() << "Locally updating [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUpdateTimer.getElapsedTimeF32() << " ]" << LL_ENDL; } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp old mode 100755 new mode 100644 index 900ccd3fbd..76d320ae9c --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -802,7 +802,7 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c if (gAgentAvatarp && !gAgentAvatarp->isDead()) // not safe to call during ~LLVOAvatarself { LLSD metrics = gAgentAvatarp->metricsData(); - llinfos << gAgentAvatarp->avString() << " metrics " << ll_pretty_print_sd(metrics) << llendl; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << " metrics " << ll_pretty_print_sd(metrics) << LL_ENDL; } if (gSavedSettings.getBOOL("DebugAvatarRezTime")) @@ -2910,13 +2910,13 @@ void LLVOAvatar::idleUpdateLoadingEffect() { if (isFullyLoaded() && mFirstFullyVisible && isSelf()) { - llinfos << avString() << "self isFullyLoaded, mFirstFullyVisible" << llendl; + LL_INFOS("Avatar") << avString() << "self isFullyLoaded, mFirstFullyVisible" << LL_ENDL; mFirstFullyVisible = FALSE; LLAppearanceMgr::instance().onFirstFullyVisible(); } if (isFullyLoaded() && mFirstFullyVisible && !isSelf()) { - llinfos << avString() << "other isFullyLoaded, mFirstFullyVisible" << llendl; + LL_INFOS("Avatar") << avString() << "other isFullyLoaded, mFirstFullyVisible" << LL_ENDL; mFirstFullyVisible = FALSE; } if (isFullyLoaded()) @@ -4087,7 +4087,7 @@ void LLVOAvatar::updateVisibility() LLNameValue* firstname = getNVPair("FirstName"); if (firstname) { - llinfos << avString() << " updating visibility" << llendl; + LL_INFOS("Avatar") << avString() << " updating visibility" << LL_ENDL; } else { @@ -4299,7 +4299,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) LLNameValue* firstname = getNVPair("FirstName"); if (firstname) { - llinfos << avString() << " in render" << llendl; + LL_INFOS("Avatar") << avString() << " in render" << LL_ENDL; } else { @@ -6563,13 +6563,13 @@ void LLVOAvatar::updateRuthTimer(bool loading) const F32 LOADING_TIMEOUT__SECONDS = 120.f; if (mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT__SECONDS) { - llinfos << avString() + LL_INFOS("Avatar") << avString() << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' " << "( Params loaded : " << !visualParamWeightsAreDefault() << " ) " << "( Lower : " << isTextureDefined(TEX_LOWER_BAKED) << " ) " << "( Upper : " << isTextureDefined(TEX_UPPER_BAKED) << " ) " << "( Head : " << isTextureDefined(TEX_HEAD_BAKED) << " )." - << llendl; + << LL_ENDL; LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID()); mRuthTimer.reset(); @@ -7032,7 +7032,7 @@ LLColor4 LLVOAvatar::getDummyColor() void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const { - llinfos << avString() << (isSelf() ? "Self: " : "Other: ") << context << llendl; + LL_INFOS("Avatar") << avString() << (isSelf() ? "Self: " : "Other: ") << context << LL_ENDL; for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); ++iter) @@ -7042,23 +7042,23 @@ void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const const LLViewerTexture* te_image = getImage(iter->first,0); if( !te_image ) { - llinfos << avString() << " " << texture_dict->mName << ": null ptr" << llendl; + LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": null ptr" << LL_ENDL; } else if( te_image->getID().isNull() ) { - llinfos << avString() << " " << texture_dict->mName << ": null UUID" << llendl; + LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": null UUID" << LL_ENDL; } else if( te_image->getID() == IMG_DEFAULT ) { - llinfos << avString() << " " << texture_dict->mName << ": IMG_DEFAULT" << llendl; + LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT" << LL_ENDL; } else if( te_image->getID() == IMG_DEFAULT_AVATAR ) { - llinfos << avString() << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << llendl; + LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << LL_ENDL; } else { - llinfos << avString() << " " << texture_dict->mName << ": " << te_image->getID() << llendl; + LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": " << te_image->getID() << LL_ENDL; } } } @@ -7189,7 +7189,7 @@ void LLVOAvatar::rebuildHUD() //----------------------------------------------------------------------------- void LLVOAvatar::onFirstTEMessageReceived() { - llinfos << avString() << llendl; + LL_INFOS("Avatar") << avString() << LL_ENDL; if( !mFirstTEMessageReceived ) { mFirstTEMessageReceived = TRUE; @@ -7218,7 +7218,7 @@ void LLVOAvatar::onFirstTEMessageReceived() image->setLoadedCallback( onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID ), src_callback_list, paused); } - llinfos << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << llendl; + LL_INFOS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL; image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); } @@ -7280,8 +7280,8 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; mFirstAppearanceMessageReceived = TRUE; - llinfos << avString() << "processAvatarAppearance start " << mID - << " first? " << is_first_appearance_message << " self? " << isSelf() << llendl; + LL_INFOS("Avatar") << avString() << "processAvatarAppearance start " << mID + << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; if( isSelf() ) @@ -7338,7 +7338,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing if( num_blocks > 1 && !drop_visual_params_debug) { - llinfos << avString() << " handle visual params, num_blocks " << num_blocks << llendl; + LL_INFOS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL; BOOL params_changed = FALSE; BOOL interp_params = FALSE; @@ -7411,7 +7411,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) else { // AvatarAppearance message arrived without visual params - llinfos << avString() << "no visual params" << llendl; + LL_INFOS("Avatar") << avString() << "no visual params" << LL_ENDL; if (drop_visual_params_debug) { llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl; @@ -7571,7 +7571,7 @@ void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTextu if (selfp) { - llinfos << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << llendl; + LL_INFOS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL; } if (!success && selfp) @@ -7596,7 +7596,7 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); if (selfp) { - llinfos << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << llendl; + LL_INFOS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << LL_ENDL; } if (selfp && !success) @@ -7631,7 +7631,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 ); if (id == image_baked->getID()) { - llinfos << avString() << " i " << i << " id " << id << llendl; + LL_INFOS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL; mBakedTextureDatas[i].mIsLoaded = true; mBakedTextureDatas[i].mLastTextureIndex = id; mBakedTextureDatas[i].mIsUsed = true; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 4ff6db9b63..6a21826fd7 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2142,7 +2142,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() LLSD msg = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; - llinfos << avString() << "message: " << ll_pretty_print_sd(msg) << llendl; + LL_INFOS("Avatar") << avString() << "message: " << ll_pretty_print_sd(msg) << LL_ENDL; std::string caps_url; if (getRegion()) { @@ -2442,10 +2442,10 @@ void LLVOAvatarSelf::outputRezDiagnostics() const void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const { - llinfos + LL_INFOS("Avatar") << avString() << llformat("%s. Time from avatar creation: %.2f", msg.c_str(), mDebugSelfLoadTimer.getElapsedTimeF32()) - << llendl; + << LL_ENDL; } void LLVOAvatarSelf::reportAvatarRezTime() const -- cgit v1.2.3 From 131fb9219e7e42e6cac5a7044c7fe81fbb4e9d52 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 16 Mar 2012 10:55:42 -0400 Subject: SH-3044 FIX - change avatar log message to LL_DEBUGS to allow effective toggling when default is INFO --- indra/newview/app_settings/logcontrol.xml | 1 + indra/newview/llagent.cpp | 6 ++-- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llappearancemgr.cpp | 60 +++++++++++++++---------------- indra/newview/lltexlayer.cpp | 4 +-- indra/newview/llvoavatar.cpp | 40 ++++++++++----------- indra/newview/llvoavatarself.cpp | 4 +-- 7 files changed, 59 insertions(+), 58 deletions(-) mode change 100644 => 100755 indra/newview/app_settings/logcontrol.xml mode change 100755 => 100644 indra/newview/llvoavatarself.cpp (limited to 'indra') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml old mode 100644 new mode 100755 index a76eb3cd37..39f80cda34 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,6 +42,7 @@ tags + Avatar diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index b8f5b5af58..8aba2e76a2 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3784,7 +3784,7 @@ void LLAgent::sendAgentSetAppearance() } gAgentAvatarp->sendAppearanceChangeMetrics(); - LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; + LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; //dumpAvatarTEs( "sendAgentSetAppearance()" ); LLMessageSystem* msg = gMessageSystem; @@ -3831,14 +3831,14 @@ void LLAgent::sendAgentSetAppearance() // only update cache entries if we have all our baked textures if (textures_current) { - LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; + LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { BOOL generate_valid_hash = TRUE; if (isAgentAvatarValid() && !gAgentAvatarp->isBakedTextureFinal((LLVOAvatarDefines::EBakedTextureIndex)baked_index)) { generate_valid_hash = FALSE; - LL_INFOS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL; + LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Not caching baked texture upload for " << (U32)baked_index << " due to being uploaded at low resolution." << LL_ENDL; } const LLUUID hash = gAgentWearables.computeBakedTextureHash((EBakedTextureIndex) baked_index, generate_valid_hash); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index e1176fed3a..bd418ca2b3 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1633,7 +1633,7 @@ void LLAgentWearables::queryWearableCache() gAgentAvatarp->outputRezTiming("Fetching textures from cache"); } - LL_INFOS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; + LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); gAgentQueryManager.mNumPendingQueries++; gAgentQueryManager.mWearablesCacheQueryID++; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index b98bcdc622..11f6aa1013 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -180,7 +180,7 @@ public: protected: ~LLWearInventoryCategoryCallback() { - LL_INFOS("Avatar") << self_av_string() << "done all inventory callbacks" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "done all inventory callbacks" << LL_ENDL; // Is the destructor called by ordinary dereference, or because the app's shutting down? // If the inventory callback manager goes away, we're shutting down, no longer want the callback. @@ -225,7 +225,7 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() { - LL_INFOS("Avatar") << self_av_string() << "done update appearance on destroy" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "done update appearance on destroy" << LL_ENDL; selfStopPhase("update_appearance_on_destroy"); @@ -240,7 +240,7 @@ void LLUpdateAppearanceOnDestroy::fire(const LLUUID& inv_item) LLViewerInventoryItem* item = (LLViewerInventoryItem*)gInventory.getItem(inv_item); const std::string item_name = item ? item->getName() : "ITEM NOT FOUND"; #ifndef LL_RELEASE_FOR_DOWNLOAD - LL_INFOS("Avatar") << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "callback fired [ name:" << item_name << " UUID:" << inv_item << " count:" << mFireCount << " ] " << LL_ENDL; #endif mFireCount++; } @@ -471,7 +471,7 @@ void LLWearableHoldingPattern::onAllComplete() // Activate all gestures in this folder if (mGestItems.count() > 0) { - LL_INFOS("Avatar") << self_av_string() << "Activating " << mGestItems.count() << " gestures" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Activating " << mGestItems.count() << " gestures" << LL_ENDL; LLGestureMgr::instance().activateGestures(mGestItems); @@ -488,13 +488,13 @@ void LLWearableHoldingPattern::onAllComplete() } // Update wearables. - LL_INFOS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; LLAppearanceMgr::instance().updateAgentWearables(this, false); // Update attachments to match those requested. if (isAgentAvatarValid()) { - LL_INFOS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Updating " << mObjItems.count() << " attachments" << LL_ENDL; LLAgentWearables::userUpdateAttachments(mObjItems); } @@ -538,7 +538,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() if (done) { - LL_INFOS("Avatar") << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out + LL_DEBUGS("Avatar") << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() << LL_ENDL; mFired = true; @@ -625,7 +625,7 @@ public: llwarns << self_av_string() << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; } - LL_INFOS("Avatar") << self_av_string() << "Recovered item for type " << mType << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Recovered item for type " << mType << LL_ENDL; LLViewerInventoryItem *itemp = gInventory.getItem(item_id); mWearable->setItemID(item_id); LLPointer cb = new RecoveredItemLinkCB(mType,mWearable,mHolder); @@ -692,7 +692,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable)) { // Wearable link that was never resolved; remove links to it from COF - LL_INFOS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false); } } @@ -712,7 +712,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (!done) { - LL_INFOS("Avatar") << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() + LL_DEBUGS("Avatar") << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() << " links " << mTypesToLink.size() << " wearables, timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() @@ -759,7 +759,7 @@ void LLWearableHoldingPattern::handleLateArrivals() llwarns << self_av_string() << "Late arrivals not handled - in middle of missing wearables processing" << llendl; } - LL_INFOS("Avatar") << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL; // Update mFoundList using late-arriving wearables. std::set replaced_types; @@ -839,7 +839,7 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) } mResolved += 1; // just counting callbacks, not successes. - LL_INFOS("Avatar") << self_av_string() << "resolved " << mResolved << "/" << getFoundList().size() << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "resolved " << mResolved << "/" << getFoundList().size() << LL_ENDL; if (!wearable) { llwarns << self_av_string() << "no wearable found" << llendl; @@ -1438,7 +1438,7 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_uuid); const std::string cat_name = cat ? cat->getName() : "CAT NOT FOUND"; #ifndef LL_RELEASE_FOR_DOWNLOAD - LL_INFOS("Avatar") << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Linking Item [ name:" << item->getName() << " UUID:" << item->getUUID() << " ] to Category [ name:" << cat_name << " UUID:" << cat_uuid << " ] " << LL_ENDL; #endif } } @@ -1446,7 +1446,7 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); - LL_INFOS("Avatar") << self_av_string() << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << LL_ENDL; const LLUUID cof = getCOF(); @@ -1508,26 +1508,26 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) gInventory.notifyObservers(); // Create links to new COF contents. - LL_INFOS("Avatar") << self_av_string() << "creating LLUpdateAppearanceOnDestroy" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "creating LLUpdateAppearanceOnDestroy" << LL_ENDL; LLPointer link_waiter = new LLUpdateAppearanceOnDestroy(!append); #ifndef LL_RELEASE_FOR_DOWNLOAD - LL_INFOS("Avatar") << self_av_string() << "Linking body items" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Linking body items" << LL_ENDL; #endif linkAll(cof, body_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - LL_INFOS("Avatar") << self_av_string() << "Linking wear items" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Linking wear items" << LL_ENDL; #endif linkAll(cof, wear_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - LL_INFOS("Avatar") << self_av_string() << "Linking obj items" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Linking obj items" << LL_ENDL; #endif linkAll(cof, obj_items, link_waiter); #ifndef LL_RELEASE_FOR_DOWNLOAD - LL_INFOS("Avatar") << self_av_string() << "Linking gesture items" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Linking gesture items" << LL_ENDL; #endif linkAll(cof, gest_items, link_waiter); @@ -1536,7 +1536,7 @@ void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { createBaseOutfitLink(category, link_waiter); } - LL_INFOS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "waiting for LLUpdateAppearanceOnDestroy" << LL_ENDL; } void LLAppearanceMgr::updatePanelOutfitName(const std::string& name) @@ -1693,7 +1693,7 @@ void LLAppearanceMgr::enforceItemRestrictions() ++it) { LLViewerInventoryItem *item = *it; - LL_INFOS("Avatar") << self_av_string() << "purging duplicate or excess item " << item->getName() << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "purging duplicate or excess item " << item->getName() << LL_ENDL; gInventory.purgeObject(item->getUUID()); } gInventory.notifyObservers(); @@ -1712,7 +1712,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); - LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) @@ -1888,7 +1888,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool gAgentWearables.notifyLoadingStarted(); - LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName() + LL_DEBUGS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName() << " )" << LL_ENDL; callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, @@ -1898,7 +1898,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) { - LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; // We now have an outfit ready to be copied to agent inventory. Do // it, and wear that outfit normally. @@ -1981,7 +1981,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego // wearables being dirty. if(!category) return; - LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategoryOnAvatar( " << category->getName() + LL_DEBUGS("Avatar") << self_av_string() << "wearInventoryCategoryOnAvatar( " << category->getName() << " )" << LL_ENDL; if (gAgentCamera.cameraCustomizeAvatar()) @@ -1995,7 +1995,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego void LLAppearanceMgr::wearOutfitByName(const std::string& name) { - LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; //inc_busy_count(); LLInventoryModel::cat_array_t cat_array; @@ -2318,7 +2318,7 @@ const std::string OTHER_GESTURES_FOLDER = "Other Gestures"; void LLAppearanceMgr::copyLibraryGestures() { - LL_INFOS("Avatar") << self_av_string() << "Copying library gestures" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Copying library gestures" << LL_ENDL; // Copy gestures LLUUID lib_gesture_cat_id = @@ -2378,7 +2378,7 @@ void LLAppearanceMgr::copyLibraryGestures() } else { - LL_INFOS("Avatar") << self_av_string() << "initiating fetch and copy for " << folder_name << " cat_id " << cat_id << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "initiating fetch and copy for " << folder_name << " cat_id " << cat_id << LL_ENDL; callAfterCategoryFetch(cat_id, boost::bind(&LLAppearanceMgr::shallowCopyCategory, &LLAppearanceMgr::instance(), @@ -2392,7 +2392,7 @@ void LLAppearanceMgr::autopopulateOutfits() // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account) // then auto-populate outfits from the library into the My Outfits folder. - LL_INFOS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL; static bool check_populate_my_outfits = true; if (check_populate_my_outfits && @@ -2779,7 +2779,7 @@ void LLAppearanceMgr::dumpItemArray(const LLInventoryModel::item_array_t& items, { asset_id = linked_item->getAssetUUID(); } - LL_INFOS("Avatar") << self_av_string() << msg << " " << i <<" " << (item ? item->getName() : "(nullitem)") << " " << asset_id.asString() << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << msg << " " << i <<" " << (item ? item->getName() : "(nullitem)") << " " << asset_id.asString() << LL_ENDL; } } diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index c9aaf40f9d..1693cfc9e2 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -580,7 +580,7 @@ void LLTexLayerSetBuffer::doUpload() args["BODYREGION"] = mTexLayerSet->getBodyRegionName(); args["RESOLUTION"] = lod_str; LLNotificationsUtil::add("AvatarRezSelfBakedTextureUploadNotification",args); - LL_INFOS("Avatar") << self_av_string() << "Uploading [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Uploading [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUploadTimer.getElapsedTimeF32() << " ]" << LL_ENDL; } } else @@ -634,7 +634,7 @@ void LLTexLayerSetBuffer::doUpdate() args["BODYREGION"] = mTexLayerSet->getBodyRegionName(); args["RESOLUTION"] = lod_str; LLNotificationsUtil::add("AvatarRezSelfBakedTextureUpdateNotification",args); - LL_INFOS("Avatar") << self_av_string() << "Locally updating [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUpdateTimer.getElapsedTimeF32() << " ]" << LL_ENDL; + LL_DEBUGS("Avatar") << self_av_string() << "Locally updating [ name: " << mTexLayerSet->getBodyRegionName() << " res:" << lod_str << " time:" << (U32)mNeedsUpdateTimer.getElapsedTimeF32() << " ]" << LL_ENDL; } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 76d320ae9c..e928d9d0dc 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -802,7 +802,7 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c if (gAgentAvatarp && !gAgentAvatarp->isDead()) // not safe to call during ~LLVOAvatarself { LLSD metrics = gAgentAvatarp->metricsData(); - LL_INFOS("Avatar") << gAgentAvatarp->avString() << " metrics " << ll_pretty_print_sd(metrics) << LL_ENDL; + LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << " metrics " << ll_pretty_print_sd(metrics) << LL_ENDL; } if (gSavedSettings.getBOOL("DebugAvatarRezTime")) @@ -2910,13 +2910,13 @@ void LLVOAvatar::idleUpdateLoadingEffect() { if (isFullyLoaded() && mFirstFullyVisible && isSelf()) { - LL_INFOS("Avatar") << avString() << "self isFullyLoaded, mFirstFullyVisible" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "self isFullyLoaded, mFirstFullyVisible" << LL_ENDL; mFirstFullyVisible = FALSE; LLAppearanceMgr::instance().onFirstFullyVisible(); } if (isFullyLoaded() && mFirstFullyVisible && !isSelf()) { - LL_INFOS("Avatar") << avString() << "other isFullyLoaded, mFirstFullyVisible" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "other isFullyLoaded, mFirstFullyVisible" << LL_ENDL; mFirstFullyVisible = FALSE; } if (isFullyLoaded()) @@ -4087,7 +4087,7 @@ void LLVOAvatar::updateVisibility() LLNameValue* firstname = getNVPair("FirstName"); if (firstname) { - LL_INFOS("Avatar") << avString() << " updating visibility" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " updating visibility" << LL_ENDL; } else { @@ -4299,7 +4299,7 @@ U32 LLVOAvatar::renderSkinned(EAvatarRenderPass pass) LLNameValue* firstname = getNVPair("FirstName"); if (firstname) { - LL_INFOS("Avatar") << avString() << " in render" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " in render" << LL_ENDL; } else { @@ -6563,7 +6563,7 @@ void LLVOAvatar::updateRuthTimer(bool loading) const F32 LOADING_TIMEOUT__SECONDS = 120.f; if (mRuthTimer.getElapsedTimeF32() > LOADING_TIMEOUT__SECONDS) { - LL_INFOS("Avatar") << avString() + LL_DEBUGS("Avatar") << avString() << "Ruth Timer timeout: Missing texture data for '" << getFullname() << "' " << "( Params loaded : " << !visualParamWeightsAreDefault() << " ) " << "( Lower : " << isTextureDefined(TEX_LOWER_BAKED) << " ) " @@ -7032,7 +7032,7 @@ LLColor4 LLVOAvatar::getDummyColor() void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const { - LL_INFOS("Avatar") << avString() << (isSelf() ? "Self: " : "Other: ") << context << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << (isSelf() ? "Self: " : "Other: ") << context << LL_ENDL; for (LLVOAvatarDictionary::Textures::const_iterator iter = LLVOAvatarDictionary::getInstance()->getTextures().begin(); iter != LLVOAvatarDictionary::getInstance()->getTextures().end(); ++iter) @@ -7042,23 +7042,23 @@ void LLVOAvatar::dumpAvatarTEs( const std::string& context ) const const LLViewerTexture* te_image = getImage(iter->first,0); if( !te_image ) { - LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": null ptr" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": null ptr" << LL_ENDL; } else if( te_image->getID().isNull() ) { - LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": null UUID" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": null UUID" << LL_ENDL; } else if( te_image->getID() == IMG_DEFAULT ) { - LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT" << LL_ENDL; } else if( te_image->getID() == IMG_DEFAULT_AVATAR ) { - LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": IMG_DEFAULT_AVATAR" << LL_ENDL; } else { - LL_INFOS("Avatar") << avString() << " " << texture_dict->mName << ": " << te_image->getID() << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " " << texture_dict->mName << ": " << te_image->getID() << LL_ENDL; } } } @@ -7189,7 +7189,7 @@ void LLVOAvatar::rebuildHUD() //----------------------------------------------------------------------------- void LLVOAvatar::onFirstTEMessageReceived() { - LL_INFOS("Avatar") << avString() << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << LL_ENDL; if( !mFirstTEMessageReceived ) { mFirstTEMessageReceived = TRUE; @@ -7218,7 +7218,7 @@ void LLVOAvatar::onFirstTEMessageReceived() image->setLoadedCallback( onBakedTextureMasksLoaded, MORPH_MASK_REQUESTED_DISCARD, TRUE, TRUE, new LLTextureMaskData( mID ), src_callback_list, paused); } - LL_INFOS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "layer_baked, setting onInitialBakedTextureLoaded as callback" << LL_ENDL; image->setLoadedCallback( onInitialBakedTextureLoaded, MAX_DISCARD_LEVEL, FALSE, FALSE, new LLUUID( mID ), src_callback_list, paused ); } @@ -7280,7 +7280,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; mFirstAppearanceMessageReceived = TRUE; - LL_INFOS("Avatar") << avString() << "processAvatarAppearance start " << mID + LL_DEBUGS("Avatar") << avString() << "processAvatarAppearance start " << mID << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; @@ -7338,7 +7338,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing if( num_blocks > 1 && !drop_visual_params_debug) { - LL_INFOS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " handle visual params, num_blocks " << num_blocks << LL_ENDL; BOOL params_changed = FALSE; BOOL interp_params = FALSE; @@ -7411,7 +7411,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) else { // AvatarAppearance message arrived without visual params - LL_INFOS("Avatar") << avString() << "no visual params" << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << "no visual params" << LL_ENDL; if (drop_visual_params_debug) { llinfos << "Debug-faked lack of parameters on AvatarAppearance for object: " << getID() << llendl; @@ -7571,7 +7571,7 @@ void LLVOAvatar::onInitialBakedTextureLoaded( BOOL success, LLViewerFetchedTextu if (selfp) { - LL_INFOS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL; + LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << LL_ENDL; } if (!success && selfp) @@ -7596,7 +7596,7 @@ void LLVOAvatar::onBakedTextureLoaded(BOOL success, LLVOAvatar *selfp = (LLVOAvatar *)gObjectList.findObject(*avatar_idp); if (selfp) { - LL_INFOS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << LL_ENDL; + LL_DEBUGS("Avatar") << selfp->avString() << "discard_level " << discard_level << " success " << success << " final " << final << " id " << src_vi->getID() << LL_ENDL; } if (selfp && !success) @@ -7631,7 +7631,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) LLViewerTexture* image_baked = getImage( mBakedTextureDatas[i].mTextureIndex, 0 ); if (id == image_baked->getID()) { - LL_INFOS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL; + LL_DEBUGS("Avatar") << avString() << " i " << i << " id " << id << LL_ENDL; mBakedTextureDatas[i].mIsLoaded = true; mBakedTextureDatas[i].mLastTextureIndex = id; mBakedTextureDatas[i].mIsUsed = true; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp old mode 100755 new mode 100644 index 6a21826fd7..6ddeb747f4 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2142,7 +2142,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() LLSD msg = metricsData(); msg["message"] = "ViewerAppearanceChangeMetrics"; - LL_INFOS("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()) { @@ -2442,7 +2442,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const { - LL_INFOS("Avatar") + LL_DEBUGS("Avatar") << avString() << llformat("%s. Time from avatar creation: %.2f", msg.c_str(), mDebugSelfLoadTimer.getElapsedTimeF32()) << LL_ENDL; -- cgit v1.2.3 From 08b59863b86cd9ed13055ec4a6c948a8134c4883 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 16 Mar 2012 10:56:49 -0400 Subject: SH-3044 FIX - updated logcontrol.xml --- indra/newview/app_settings/logcontrol.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 39f80cda34..81e0b5602c 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -20,7 +20,7 @@ tags AppInit - Capabilities + Capabilities SystemInfo TextureCache AppCache -- cgit v1.2.3 From 74394ba57796bed4dc339c2efffb36d43703c531 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 16 Mar 2012 11:09:04 -0400 Subject: SH-3044 FIX - bit more cleanup on log messages --- indra/newview/llvoavatar.cpp | 2 +- indra/newview/llvoavatarself.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) mode change 100644 => 100755 indra/newview/llvoavatar.cpp mode change 100644 => 100755 indra/newview/llvoavatarself.cpp (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp old mode 100644 new mode 100755 index e928d9d0dc..ea771b6d68 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -791,7 +791,7 @@ std::string LLVOAvatar::avString() const void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) { - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ]" << avString() << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp old mode 100644 new mode 100755 index 6ddeb747f4..a39b1cf4bc --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2356,7 +2356,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) if (isAllLocalTextureDataFinal()) { LLNotificationsUtil::add("AvatarRezSelfBakedDoneNotification",args); - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ]" << avString() << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() @@ -2368,7 +2368,7 @@ void LLVOAvatarSelf::setNewBakedTexture( ETextureIndex te, const LLUUID& uuid ) { args["STATUS"] = debugDumpAllLocalTextureDataInfo(); LLNotificationsUtil::add("AvatarRezSelfBakedUpdateNotification",args); - llinfos << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() << "sec ]" << avString() << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() -- cgit v1.2.3 From 193dc112df0a75c2625828e5059e80178ee3d7c8 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 19 Mar 2012 17:17:16 -0400 Subject: enable per-appearance-change metrics sending --- indra/newview/llvoavatarself.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index a39b1cf4bc..20f91811a3 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2147,7 +2147,7 @@ void LLVOAvatarSelf::sendAppearanceChangeMetrics() if (getRegion()) { // runway - change here to activate. - caps_url = "";//getRegion()->getCapability("ViewerMetrics"); + caps_url = getRegion()->getCapability("ViewerMetrics"); } if (!caps_url.empty()) { -- cgit v1.2.3 From e1a10fd81c0d20ead3b14767a8b642338389e7ed Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 20 Mar 2012 17:31:14 -0400 Subject: SH-3040 FIX Inventory caching issues A complete fix for a single cause of caching issues, does not solve all caching issues. Fixes the issue of inventory links that were incorrectly being marked as broken. Broken links get a second chance to see if their base objects exist in inventory now. --- indra/newview/llinventorymodel.cpp | 47 ++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index a71b699fdd..2e4db6fc37 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1664,6 +1664,7 @@ bool LLInventoryModel::loadSkeleton( update_map_t child_counts; cat_array_t categories; item_array_t items; + item_array_t possible_broken_links; cat_set_t invalid_categories; // Used to mark categories that weren't successfully loaded. std::string owner_id_str; owner_id.toString(owner_id_str); @@ -1712,7 +1713,7 @@ bool LLInventoryModel::loadSkeleton( LLViewerInventoryCategory* tcat = *cit; // we can safely ignore anything loaded from file, but - // not sent down in the skeleton. + // not sent down in the skeleton. Must have been removed from inventory. if(cit == not_cached) { continue; @@ -1750,6 +1751,8 @@ bool LLInventoryModel::loadSkeleton( // Add all the items loaded which are parented to a // category with a correctly cached parent S32 bad_link_count = 0; + S32 good_link_count = 0; + S32 recovered_link_count = 0; cat_map_t::iterator unparented = mCategoryMap.end(); for(item_array_t::const_iterator item_iter = items.begin(); item_iter != items.end(); @@ -1766,26 +1769,56 @@ bool LLInventoryModel::loadSkeleton( // This can happen if the linked object's baseobj is removed from the cache but the linked object is still in the cache. if (item->getIsBrokenLink()) { - bad_link_count++; + //bad_link_count++; lldebugs << "Attempted to add cached link item without baseobj present ( name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ). Ignoring and invalidating " << cat->getName() << " . " << llendl; - invalid_categories.insert(cit->second); + possible_broken_links.push_back(item); continue; } + else if (item->getIsLinkType()) + { + good_link_count++; + } addItem(item); cached_item_count += 1; ++child_counts[cat->getUUID()]; } } } - if (bad_link_count > 0) + if (possible_broken_links.size() > 0) { - llinfos << "Attempted to add " << bad_link_count - << " cached link items without baseobj present. " - << "The corresponding categories were invalidated." << llendl; + for(item_array_t::const_iterator item_iter = possible_broken_links.begin(); + item_iter != possible_broken_links.end(); + ++item_iter) + { + LLViewerInventoryItem *item = (*item_iter).get(); + const cat_map_t::iterator cit = mCategoryMap.find(item->getParentUUID()); + const LLViewerInventoryCategory* cat = cit->second.get(); + if (item->getIsBrokenLink()) + { + bad_link_count++; + invalid_categories.insert(cit->second); + //llinfos << "link still broken: " << item->getName() << " in folder " << cat->getName() << llendl; + } + else + { + // was marked as broken because of loading order, its actually fine to load + addItem(item); + cached_item_count += 1; + ++child_counts[cat->getUUID()]; + recovered_link_count++; + } + } + + llinfos << "Attempted to add " << bad_link_count + << " cached link items without baseobj present. " + << good_link_count << " link items were successfully added. " + << recovered_link_count << " links added in recovery. " + << "The corresponding categories were invalidated." << llendl; } + } else { -- cgit v1.2.3 From 11e5c8b322a35d17e75ea57902296de860005c1d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 20 Mar 2012 16:46:08 -0700 Subject: added debug tools for visualizating texel density at various discard levels (current, requested, full) --- indra/newview/llspatialpartition.cpp | 48 +++++++++++++- indra/newview/llviewermenu.cpp | 75 ++++++++++++++++++++++ indra/newview/llviewertexture.cpp | 17 +++++ indra/newview/llviewertexture.h | 12 ++++ indra/newview/pipeline.h | 1 + indra/newview/skins/default/xui/en/menu_viewer.xml | 46 +++++++++++++ 6 files changed, 198 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5d196a465f..5ef71fe6d9 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3647,6 +3647,47 @@ void renderShadowFrusta(LLDrawInfo* params) gGL.setSceneBlendType(LLRender::BT_ALPHA); } +void renderTexelDensity(LLDrawInfo* params) +{ + LLGLEnable _(GL_BLEND); + if (LLViewerTexture::sDebugTexelsMode == LLViewerTexture::DEBUG_TEXELS_OFF + || LLViewerTexture::sCheckerBoardImagep.isNull()) + { + return; + } + LLViewerTexture* texturep = params->mTexture.get(); + LLMatrix4 checkboard_matrix; + S32 discard_level = -1; + switch(LLViewerTexture::sDebugTexelsMode) + { + case LLViewerTexture::DEBUG_TEXELS_CURRENT: + discard_level = -1; + break; + case LLViewerTexture::DEBUG_TEXELS_DESIRED: + { + LLViewerFetchedTexture* fetched_texturep = dynamic_cast(texturep); + discard_level = fetched_texturep ? fetched_texturep->getDesiredDiscardLevel() : -1; + break; + } + default: + case LLViewerTexture::DEBUG_TEXELS_FULL: + discard_level = 0; + break; + } + + checkboard_matrix.initScale(LLVector3(texturep->getWidth(discard_level) / 8, texturep->getHeight(discard_level) / 8, 1.f)); + gGL.getTexUnit(0)->activate(); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*) checkboard_matrix.mMatrix); + + gGL.getTexUnit(0)->bind(LLViewerTexture::sCheckerBoardImagep, TRUE); + + pushVerts(params, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); + + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); +} + void renderLights(LLDrawable* drawablep) { @@ -4097,6 +4138,10 @@ public: { renderShadowFrusta(draw_info); } + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY)) + { + renderTexelDensity(draw_info); + } } } } @@ -4291,7 +4336,8 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_AGENT_TARGET | //LLPipeline::RENDER_DEBUG_BUILD_QUEUE | LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA | - LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY)) + LLPipeline::RENDER_DEBUG_RENDER_COMPLEXITY | + LLPipeline::RENDER_DEBUG_TEXEL_DENSITY)) { return; } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 99540ccce9..6a54bc6e5f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -861,6 +861,73 @@ class LLAdvancedCheckFeature : public view_listener_t } }; +class LLAdvancedCheckDisplayTextureDensity : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string mode = userdata.asString(); + if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY)) + { + return mode == "none"; + } + if (mode == "current") + { + return LLViewerTexture::sDebugTexelsMode == LLViewerTexture::DEBUG_TEXELS_CURRENT; + } + else if (mode == "desired") + { + return LLViewerTexture::sDebugTexelsMode == LLViewerTexture::DEBUG_TEXELS_DESIRED; + } + else if (mode == "full") + { + return LLViewerTexture::sDebugTexelsMode == LLViewerTexture::DEBUG_TEXELS_FULL; + } + return false; + } +}; + +class LLAdvancedSetDisplayTextureDensity : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string mode = userdata.asString(); + if (mode == "none") + { + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == TRUE) + { + gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + } + LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF; + } + else if (mode == "current") + { + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE) + { + gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + } + LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_CURRENT; + } + else if (mode == "desired") + { + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE) + { + gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + } + gPipeline.setRenderDebugFeatureControl(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY, true); + LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_DESIRED; + } + else if (mode == "full") + { + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY) == FALSE) + { + gPipeline.toggleRenderDebug((void*)LLPipeline::RENDER_DEBUG_TEXEL_DENSITY); + } + LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_FULL; + } + return true; + } +}; + ////////////////// // INFO DISPLAY // @@ -975,6 +1042,10 @@ U32 info_display_from_string(std::string info_display) { return LLPipeline::RENDER_DEBUG_WIND_VECTORS; } + else if ("texel density" == info_display) + { + return LLPipeline::RENDER_DEBUG_TEXEL_DENSITY; + } else { return 0; @@ -8120,6 +8191,10 @@ void initialize_menus() //// Advanced > Render > Features view_listener_t::addMenu(new LLAdvancedToggleFeature(), "Advanced.ToggleFeature"); view_listener_t::addMenu(new LLAdvancedCheckFeature(), "Advanced.CheckFeature"); + + view_listener_t::addMenu(new LLAdvancedCheckDisplayTextureDensity(), "Advanced.CheckDisplayTextureDensity"); + view_listener_t::addMenu(new LLAdvancedSetDisplayTextureDensity(), "Advanced.SetDisplayTextureDensity"); + // Advanced > Render > Info Displays view_listener_t::addMenu(new LLAdvancedToggleInfoDisplay(), "Advanced.ToggleInfoDisplay"); view_listener_t::addMenu(new LLAdvancedCheckInfoDisplay(), "Advanced.CheckInfoDisplay"); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 61236edc86..3984e7c433 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -67,6 +67,7 @@ // statics LLPointer LLViewerTexture::sNullImagep = NULL; LLPointer LLViewerTexture::sBlackImagep = NULL; +LLPointer LLViewerTexture::sCheckerBoardImagep = NULL; LLPointer LLViewerFetchedTexture::sMissingAssetImagep = NULL; LLPointer LLViewerFetchedTexture::sWhiteImagep = NULL; LLPointer LLViewerFetchedTexture::sDefaultImagep = NULL; @@ -96,6 +97,7 @@ S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA ; BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE ; F32 LLViewerTexture::sCurrentTime = 0.0f ; BOOL LLViewerTexture::sUseTextureAtlas = FALSE ; +LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF; const F32 desired_discard_bias_min = -2.0f; // -max number of levels to improve image quality by const F32 desired_discard_bias_max = (F32)MAX_DISCARD_LEVEL; // max number of levels to reduce image quality by @@ -347,6 +349,21 @@ void LLViewerTextureManager::init() LLViewerFetchedTexture::sSmokeImagep = LLViewerTextureManager::getFetchedTexture(IMG_SMOKE, TRUE, LLViewerTexture::BOOST_UI); LLViewerFetchedTexture::sSmokeImagep->setNoDelete() ; + image_raw = new LLImageRaw(32,32,3); + data = image_raw->getData(); + + for (S32 i = 0; i < (32*32*3); i+=3) + { + S32 x = (i % (32*3)) / (3*16); + S32 y = i / (32*3*16); + U8 color = ((x + y) % 2) * 255; + data[i] = color; + data[i+1] = color; + data[i+2] = color; + } + + LLViewerTexture::sCheckerBoardImagep = LLViewerTextureManager::getLocalTexture(image_raw.get(), TRUE); + LLViewerTexture::initClass() ; if (LLMetricPerformanceTesterBasic::isMetricLogRequested(sTesterName) && !LLMetricPerformanceTesterBasic::getTester(sTesterName)) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index b96441127d..99053a8ccc 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -139,6 +139,7 @@ public: OTHER, MAX_GL_IMAGE_CATEGORY }; + static S32 getTotalNumOfCategories() ; static S32 getIndexFromCategory(S32 category) ; static S32 getCategoryFromIndex(S32 index) ; @@ -330,8 +331,19 @@ public: static F32 sCurrentTime ; static BOOL sUseTextureAtlas ; + enum EDebugTexels + { + DEBUG_TEXELS_OFF, + DEBUG_TEXELS_CURRENT, + DEBUG_TEXELS_DESIRED, + DEBUG_TEXELS_FULL + }; + + static EDebugTexels sDebugTexelsMode; + static LLPointer sNullImagep; // Null texture for non-textured objects. static LLPointer sBlackImagep; // Texture to show NOTHING (pure black) + static LLPointer sCheckerBoardImagep; // Texture to show NOTHING (pure black) }; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 9c78048c46..670a23ef14 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -461,6 +461,7 @@ public: RENDER_DEBUG_LOD_INFO = 0x04000000, RENDER_DEBUG_RENDER_COMPLEXITY = 0x08000000, RENDER_DEBUG_ATTACHMENT_BYTES = 0x10000000, + RENDER_DEBUG_TEXEL_DENSITY = 0x20000000 }; public: diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index cd8550b00d..64ef343506 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2432,6 +2432,52 @@ function="Advanced.ToggleInfoDisplay" parameter="sculpt" /> + + + + + + + + + + + + + + + + + + Date: Tue, 20 Mar 2012 18:32:58 -0700 Subject: shortened label for texture density display --- indra/newview/skins/default/xui/en/menu_viewer.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 578afc2de5..54b4e59a54 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2412,8 +2412,8 @@ Date: Wed, 21 Mar 2012 13:51:49 -0400 Subject: changed nearby avatar stat metrics to map instead of array --- indra/newview/llviewerassetstats.cpp | 6 ++++-- indra/newview/llvoavatar.cpp | 7 +++++-- indra/newview/llvoavatarself.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index 4928f93a51..0adefbc500 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -346,9 +346,11 @@ LLViewerAssetStats::asLLSD(bool compact_output) slot[mean_tag] = LLSD(F64(stats.mFPS.getMean())); } reg_stat[avatar_tag][avatar_nearby_tag] = LLSD::emptyArray(); - for (S32 j = 0; j < stats.mAvatarRezStates.size(); ++j) + if (stats.mAvatarRezStates.size() > 2) { - reg_stat[avatar_tag][avatar_nearby_tag].append(stats.mAvatarRezStates[j]); + reg_stat[avatar_tag][avatar_nearby_tag]["cloud"] = stats.mAvatarRezStates[0]; + reg_stat[avatar_tag][avatar_nearby_tag]["gray"] = stats.mAvatarRezStates[1]; + reg_stat[avatar_tag][avatar_nearby_tag]["textured"] = stats.mAvatarRezStates[2]; } U32 grid_x(0), grid_y(0); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ea771b6d68..1537435526 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -981,8 +981,11 @@ void LLVOAvatar::startPhase(const std::string& phase_name) void LLVOAvatar::stopPhase(const std::string& phase_name) { - LLFrameTimer& timer = getPhaseTimer(phase_name); - timer.pause(); + phase_map_t::iterator iter = mPhases.find(phase_name); + if (iter != mPhases.end()) + { + iter->second.pause(); + } } void LLVOAvatar::stopAllPhases() diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 20f91811a3..36c2f8b0de 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2097,10 +2097,10 @@ LLSD LLVOAvatarSelf::metricsData() result["is_self"] = isSelf(); std::vector rez_counts; LLVOAvatar::getNearbyRezzedStats(rez_counts); - result["nearby"] = LLSD::emptyArray(); - result["nearby"][0] = rez_counts[0]; - result["nearby"][1] = rez_counts[1]; - result["nearby"][2] = rez_counts[2]; + result["nearby"] = LLSD::emptyMap(); + result["nearby"]["cloud"] = rez_counts[0]; + result["nearby"]["gray"] = rez_counts[1]; + result["nearby"]["textured"] = rez_counts[2]; result["timers"]["debug_existence"] = mDebugExistenceTimer.getElapsedTimeF32(); result["timers"]["ruth_debug"] = mRuthDebugTimer.getElapsedTimeF32(); result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32(); -- cgit v1.2.3 From 1731894cb42fdbf0bb5bd2e96fe20e2252d1026f Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Wed, 21 Mar 2012 17:51:30 -0400 Subject: SH-3041 WIP Utilizing early object update texture data Caching the mapping between baked texture hashes and UUIDs should be able to be avoided if the initial texture data sent down is accuate. This patch will use the first objectupdate message sent for your own avatar to set the baked texture UUIDs for your avatar. These appear to match the UUIDs sent from the hash lookup. Testing needed to verify that you can successfully decloud before the server sends you the hash lookup response, if your bakes are cached locally. --- indra/newview/llvoavatarself.cpp | 49 +++++++++++++++++++++++++++++++++++++++- indra/newview/llvoavatarself.h | 12 ++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 20f91811a3..f73c8b59aa 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -163,7 +163,8 @@ LLVOAvatarSelf::LLVOAvatarSelf(const LLUUID& id, LLVOAvatar(id, pcode, regionp), mScreenp(NULL), mLastRegionHandle(0), - mRegionCrossingCount(0) + mRegionCrossingCount(0), + mInitialBakesLoaded(false) { gAgentWearables.setAvatarObject(this); @@ -196,6 +197,7 @@ void LLVOAvatarSelf::initInstance() { mDebugBakedTextureTimes[i][0] = -1.0f; mDebugBakedTextureTimes[i][1] = -1.0f; + mInitialBakeIDs[i] = LLUUID::null; } status &= buildMenus(); @@ -794,6 +796,39 @@ void LLVOAvatarSelf::stopMotionFromSource(const LLUUID& source_id) } } +//virtual +U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, + void **user_data, + U32 block_num, + const EObjectUpdateType update_type, + LLDataPacker *dp) +{ + U32 retval = LLVOAvatar::processUpdateMessage(mesgsys,user_data,block_num,update_type,dp); + + if (mInitialBakesLoaded == false && retval == 0x0) + { + // call update textures to force the images to be created + updateMeshTextures(); + + // unpack the texture UUIDs to the texture slots + retval = unpackTEMessage(mesgsys, _PREHASH_ObjectData, 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++) + { + const LLVOAvatarDefines::ETextureIndex te = mBakedTextureDatas[i].mTextureIndex; + LLUUID texture_id = getTEImage(te)->getID(); + setNewBakedTexture(te, texture_id); + mInitialBakeIDs[i] = texture_id; + } + + mInitialBakesLoaded = true; + } + + return retval; +} + + void LLVOAvatarSelf::setLocalTextureTE(U8 te, LLViewerTexture* image, U32 index) { if (te >= TEX_NUM_INDICES) @@ -2469,6 +2504,18 @@ void LLVOAvatarSelf::setCachedBakedTexture( ETextureIndex te, const LLUUID& uuid { if ( mBakedTextureDatas[i].mTextureIndex == te && mBakedTextureDatas[i].mTexLayerSet) { + if (mInitialBakeIDs[i] != LLUUID::null) + { + if (mInitialBakeIDs[i] == uuid) + { + llinfos << "baked texture correctly loaded at login! " << i << llendl; + } + else + { + llwarns << "baked texture does not match id loaded at login!" << i << llendl; + } + mInitialBakeIDs[i] = LLUUID::null; + } mBakedTextureDatas[i].mTexLayerSet->cancelUpload(); } } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index fc1b602764..17cdd514cc 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -93,15 +93,27 @@ public: /*virtual*/ void updateVisualParams(); /*virtual*/ void idleUpdateAppearanceAnimation(); + /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys, + void **user_data, + U32 block_num, + const EObjectUpdateType update_type, + LLDataPacker *dp); + private: // helper function. Passed in param is assumed to be in avatar's parameter list. BOOL setParamWeight(LLViewerVisualParam *param, F32 weight, BOOL upload_bake = FALSE ); + /** Initialization ** ** *******************************************************************************/ +private: + LLUUID mInitialBakeIDs[6]; + bool mInitialBakesLoaded; + + /******************************************************************************** ** ** ** STATE -- cgit v1.2.3 From 231b90cbacaf4e95e528c3335659f1959907cf59 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 21 Mar 2012 18:58:24 -0400 Subject: SH-3039 WIP - trying to close phases where needed --- indra/newview/llagent.cpp | 7 +++++++ indra/newview/llagentwearables.cpp | 5 +++++ indra/newview/llagentwearables.h | 1 + 3 files changed, 13 insertions(+) mode change 100644 => 100755 indra/newview/llagent.cpp mode change 100644 => 100755 indra/newview/llagentwearables.cpp mode change 100644 => 100755 indra/newview/llagentwearables.h (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp old mode 100644 new mode 100755 index 8aba2e76a2..3f1f410db8 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3783,6 +3783,13 @@ void LLAgent::sendAgentSetAppearance() return; } + if (!gAgentWearables.changeInProgress()) + { + // Change is fully resolved, can close some open phases. + gAgentAvatarp->stopPhase("process_initial_wearables_update"); + gAgentAvatarp->stopPhase("wear_inventory_category"); + } + gAgentAvatarp->sendAppearanceChangeMetrics(); LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; //dumpAvatarTEs( "sendAgentSetAppearance()" ); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp old mode 100644 new mode 100755 index bd418ca2b3..20ce2f63e2 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -2081,6 +2081,11 @@ boost::signals2::connection LLAgentWearables::addLoadedCallback(loaded_callback_ return mLoadedSignal.connect(cb); } +bool LLAgentWearables::changeInProgress() const +{ + return mCOFChangeInProgress; +} + void LLAgentWearables::notifyLoadingStarted() { mCOFChangeInProgress = true; diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h old mode 100644 new mode 100755 index 01cae3ffd8..5932be21c6 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -233,6 +233,7 @@ public: typedef boost::signals2::signal loaded_signal_t; boost::signals2::connection addLoadedCallback(loaded_callback_t cb); + bool changeInProgress() const; void notifyLoadingStarted(); void notifyLoadingFinished(); -- cgit v1.2.3 From 1886846725252254058168dcf6fc6082c15ebed4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 22 Mar 2012 15:19:18 -0700 Subject: fix for texture density display so that it works with shaders enabled --- indra/newview/llspatialpartition.cpp | 117 +++++++++++++++++++++++++++-------- 1 file changed, 90 insertions(+), 27 deletions(-) (limited to 'indra') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5ef71fe6d9..b7a5eea27c 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -3647,45 +3647,108 @@ void renderShadowFrusta(LLDrawInfo* params) gGL.setSceneBlendType(LLRender::BT_ALPHA); } -void renderTexelDensity(LLDrawInfo* params) +void renderTexelDensity(LLDrawable* drawable) { - LLGLEnable _(GL_BLEND); if (LLViewerTexture::sDebugTexelsMode == LLViewerTexture::DEBUG_TEXELS_OFF || LLViewerTexture::sCheckerBoardImagep.isNull()) { return; } - LLViewerTexture* texturep = params->mTexture.get(); - LLMatrix4 checkboard_matrix; + + LLGLEnable _(GL_BLEND); + //gObjectFullbrightProgram.bind(); + + LLMatrix4 checkerboard_matrix; S32 discard_level = -1; - switch(LLViewerTexture::sDebugTexelsMode) + + for (S32 f = 0; f < drawable->getNumFaces(); f++) { - case LLViewerTexture::DEBUG_TEXELS_CURRENT: - discard_level = -1; - break; - case LLViewerTexture::DEBUG_TEXELS_DESIRED: + LLFace* facep = drawable->getFace(f); + LLVertexBuffer* buffer = facep->getVertexBuffer(); + LLViewerTexture* texturep = facep->getTexture(); + + if (texturep == NULL) continue; + + switch(LLViewerTexture::sDebugTexelsMode) { - LLViewerFetchedTexture* fetched_texturep = dynamic_cast(texturep); - discard_level = fetched_texturep ? fetched_texturep->getDesiredDiscardLevel() : -1; + case LLViewerTexture::DEBUG_TEXELS_CURRENT: + discard_level = -1; + break; + case LLViewerTexture::DEBUG_TEXELS_DESIRED: + { + LLViewerFetchedTexture* fetched_texturep = dynamic_cast(texturep); + discard_level = fetched_texturep ? fetched_texturep->getDesiredDiscardLevel() : -1; + break; + } + default: + case LLViewerTexture::DEBUG_TEXELS_FULL: + discard_level = 0; break; } - default: - case LLViewerTexture::DEBUG_TEXELS_FULL: - discard_level = 0; - break; + + checkerboard_matrix.initScale(LLVector3(texturep->getWidth(discard_level) / 8, texturep->getHeight(discard_level) / 8, 1.f)); + + gGL.getTexUnit(0)->bind(LLViewerTexture::sCheckerBoardImagep, TRUE); + gGL.matrixMode(LLRender::MM_TEXTURE); + gGL.loadMatrix((GLfloat*)&checkerboard_matrix.mMatrix); + + if (buffer && (facep->getGeomCount() >= 3)) + { + buffer->setBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); + U16 start = facep->getGeomStart(); + U16 end = start + facep->getGeomCount()-1; + U32 count = facep->getIndicesCount(); + U16 offset = facep->getIndicesStart(); + buffer->drawRange(LLRender::TRIANGLES, start, end, count, offset); + } + + gGL.loadIdentity(); + gGL.matrixMode(LLRender::MM_MODELVIEW); } - checkboard_matrix.initScale(LLVector3(texturep->getWidth(discard_level) / 8, texturep->getHeight(discard_level) / 8, 1.f)); - gGL.getTexUnit(0)->activate(); - gGL.matrixMode(LLRender::MM_TEXTURE); - gGL.loadMatrix((GLfloat*) checkboard_matrix.mMatrix); + //S32 num_textures = llmax(1, (S32)params->mTextureList.size()); + + //for (S32 i = 0; i < num_textures; i++) + //{ + // LLViewerTexture* texturep = params->mTextureList.empty() ? params->mTexture.get() : params->mTextureList[i].get(); + // if (texturep == NULL) continue; + + // LLMatrix4 checkboard_matrix; + // S32 discard_level = -1; + // switch(LLViewerTexture::sDebugTexelsMode) + // { + // case LLViewerTexture::DEBUG_TEXELS_CURRENT: + // discard_level = -1; + // break; + // case LLViewerTexture::DEBUG_TEXELS_DESIRED: + // { + // LLViewerFetchedTexture* fetched_texturep = dynamic_cast(texturep); + // discard_level = fetched_texturep ? fetched_texturep->getDesiredDiscardLevel() : -1; + // break; + // } + // default: + // case LLViewerTexture::DEBUG_TEXELS_FULL: + // discard_level = 0; + // break; + // } - gGL.getTexUnit(0)->bind(LLViewerTexture::sCheckerBoardImagep, TRUE); + // checkboard_matrix.initScale(LLVector3(texturep->getWidth(discard_level) / 8, texturep->getHeight(discard_level) / 8, 1.f)); + // gGL.getTexUnit(i)->activate(); - pushVerts(params, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0); + // glMatrixMode(GL_TEXTURE); + // glPushMatrix(); + // glLoadIdentity(); + // //gGL.matrixMode(LLRender::MM_TEXTURE); + // glLoadMatrixf((GLfloat*) checkboard_matrix.mMatrix); - gGL.loadIdentity(); - gGL.matrixMode(LLRender::MM_MODELVIEW); + // gGL.getTexUnit(i)->bind(LLViewerTexture::sCheckerBoardImagep, TRUE); + + // pushVerts(params, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_NORMAL ); + + // glPopMatrix(); + // glMatrixMode(GL_MODELVIEW); + // //gGL.matrixMode(LLRender::MM_MODELVIEW); + //} } @@ -4083,6 +4146,10 @@ public: { renderComplexityDisplay(drawable); } + if(gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY)) + { + renderTexelDensity(drawable); + } LLVOAvatar* avatar = dynamic_cast(drawable->getVObj().get()); @@ -4138,10 +4205,6 @@ public: { renderShadowFrusta(draw_info); } - if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXEL_DENSITY)) - { - renderTexelDensity(draw_info); - } } } } -- cgit v1.2.3 From b0b1634bd2b4b7382a5a1a55ba605a5809f0fa3f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 22 Mar 2012 18:33:02 -0400 Subject: fixed typo --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 indra/newview/llinventorymodel.cpp (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp old mode 100644 new mode 100755 index 2e4db6fc37..ba64447c1d --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2716,7 +2716,7 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) { LLPointer titem = new LLViewerInventoryItem; titem->unpackMessage(msg, _PREHASH_ItemData, i); - llinfos << "unpaked item '" << titem->getName() << "' in " + llinfos << "unpacked item '" << titem->getName() << "' in " << titem->getParentUUID() << llendl; U32 callback_id; msg->getU32Fast(_PREHASH_ItemData, _PREHASH_CallbackID, callback_id); -- cgit v1.2.3 From 5c86d19373ebfab446e8335729faefabc66ad15f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Sun, 25 Mar 2012 11:52:10 -0700 Subject: SH-3050 : Parse an input codestream without decompressing it to find discard levels boundaries (test only). --- indra/llkdu/llimagej2ckdu.cpp | 202 ++++++++++++++++++++++++++++++- indra/llkdu/llimagej2ckdu.h | 1 + indra/llkdu/tests/llimagej2ckdu_test.cpp | 20 +++ 3 files changed, 222 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index eed4139f3f..8b170a3206 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -32,6 +32,7 @@ #include "llmath.h" #include "llkdumem.h" +#include "kdu_block_coding.h" class kdc_flow_control { @@ -244,7 +245,7 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECod mCodeStreamp->create(mInputp); // Set the maximum number of bytes to use from the codestream - mCodeStreamp->set_max_bytes(max_bytes); + mCodeStreamp->set_max_bytes(max_bytes,true); // If you want to flip or rotate the image for some reason, change // the resolution, or identify a restricted region of interest, this is @@ -369,6 +370,9 @@ BOOL LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco // To regain control, we throw an exception, and catch it here. try { + // Merov : Test!! DO NOT COMMIT!! + //findDiscardLevelsBoundaries(base); + base.updateRawDiscardLevel(); setupCodeStream(base, TRUE, mode); @@ -752,6 +756,202 @@ BOOL LLImageJ2CKDU::getMetadata(LLImageJ2C &base) } } +/*****************************************************************************/ +/* STATIC copy_block */ +/*****************************************************************************/ + +static void copy_block(kdu_block *in, kdu_block *out) +{ + if (in->K_max_prime != out->K_max_prime) + { + std::cout << "Cannot copy blocks belonging to subbands with different quantization parameters." << std::endl; + return; + } + if ((in->size.x != out->size.x) || (in->size.y != out->size.y)) + { + std::cout << "Cannot copy code-blocks with different dimensions." << std::endl; + return; + } + out->missing_msbs = in->missing_msbs; + if (out->max_passes < (in->num_passes+2)) // Gives us enough to round up + out->set_max_passes(in->num_passes+2,false); // to the next whole bit-plane + out->num_passes = in->num_passes; + int num_bytes = 0; + for (int z=0; z < in->num_passes; z++) + { + num_bytes += (out->pass_lengths[z] = in->pass_lengths[z]); + out->pass_slopes[z] = in->pass_slopes[z]; + } + + // Just copy compressed code-bytes. Block transcoding not supported. + if (out->max_bytes < num_bytes) + out->set_max_bytes(num_bytes,false); + memcpy(out->byte_buffer,in->byte_buffer,(size_t) num_bytes); +} + +/*****************************************************************************/ +/* STATIC copy_tile */ +/*****************************************************************************/ + +static void +copy_tile(kdu_tile tile_in, kdu_tile tile_out, int tnum_in, int tnum_out, + kdu_params *siz_in, kdu_params *siz_out, int skip_components, + int &num_blocks) +{ + int num_components = tile_out.get_num_components(); + int new_tpart=0, next_tpart = 1; + + for (int c=0; c < num_components; c++) + { + kdu_tile_comp comp_in, comp_out; + comp_in = tile_in.access_component(c); + comp_out = tile_out.access_component(c); + int num_resolutions = comp_out.get_num_resolutions(); + for (int r=0; r < num_resolutions; r++) + { + kdu_resolution res_in; res_in = comp_in.access_resolution(r); + kdu_resolution res_out; res_out = comp_out.access_resolution(r); + int b, min_band; + int num_bands = res_in.get_valid_band_indices(min_band); + for (b=min_band; num_bands > 0; num_bands--, b++) + { + kdu_subband band_in; band_in = res_in.access_subband(b); + kdu_subband band_out; band_out = res_out.access_subband(b); + kdu_dims blocks_in; band_in.get_valid_blocks(blocks_in); + kdu_dims blocks_out; band_out.get_valid_blocks(blocks_out); + if ((blocks_in.size.x != blocks_out.size.x) || + (blocks_in.size.y != blocks_out.size.y)) + { + std::cout << "Transcoding operation cannot proceed: Code-block partitions for the input and output code-streams do not agree." << std::endl; + return; + } + kdu_coords idx; + for (idx.y=0; idx.y < blocks_out.size.y; idx.y++) + { + for (idx.x=0; idx.x < blocks_out.size.x; idx.x++) + { + kdu_block *in = + band_in.open_block(idx+blocks_in.pos,&new_tpart); + for (; next_tpart <= new_tpart; next_tpart++) + siz_out->copy_from(siz_in,tnum_in,tnum_out,next_tpart, + skip_components); + kdu_block *out = band_out.open_block(idx+blocks_out.pos); + copy_block(in,out); + band_in.close_block(in); + band_out.close_block(out); + num_blocks++; + } + } + } + } + } +} + +// Find the block boundary for each discard level in the input image. +// We parse the input blocks and copy them in a temporary output stream. +// For the moment, we do nothing more that parsing the raw list of blocks and outputing result. +void LLImageJ2CKDU::findDiscardLevelsBoundaries(LLImageJ2C &base) +{ + // We need the number of levels in that image before starting. + getMetadata(base); + + for (int discard_level = 0; discard_level < mLevels; discard_level++) + { + // Create the input codestream object. + setupCodeStream(base, TRUE, MODE_FAST); + mCodeStreamp->apply_input_restrictions(0, 4, discard_level, 0, NULL); + //mCodeStreamp->set_max_bytes(max,true); + siz_params *siz_in = mCodeStreamp->access_siz(); + + // Create the output codestream object. + siz_params siz; + siz.copy_from(siz_in,-1,-1,-1,0,discard_level,false,false,false); + siz.set(Scomponents,0,0,mCodeStreamp->get_num_components()); + + U32 max_output_size = base.getWidth()*base.getHeight()*base.getComponents(); + max_output_size = (max_output_size < 1000 ? 1000 : max_output_size); + U8 *output_buffer = new U8[max_output_size]; + U32 output_size = 0; // Address updated by LLKDUMemTarget to give the final compressed buffer size + LLKDUMemTarget output(output_buffer, output_size, max_output_size); + kdu_codestream codestream_out; + codestream_out.create(&siz,&output); + //codestream_out.share_buffering(*mCodeStreamp); + siz_params *siz_out = codestream_out.access_siz(); + siz_out->copy_from(siz_in,-1,-1,-1,0,discard_level,false,false,false); + codestream_out.access_siz()->finalize_all(-1); + + // Set up rate control variables + kdu_long max_bytes = KDU_LONG_MAX; + kdu_params *cod = siz_out->access_cluster(COD_params); + int total_layers; cod->get(Clayers,0,0,total_layers); + kdu_long *layer_bytes = new kdu_long[total_layers]; + int nel, non_empty_layers = 0; + + // Now ready to perform the transfer of compressed data between streams + int flush_counter = INT_MAX; + kdu_dims tile_indices_in; + mCodeStreamp->get_valid_tiles(tile_indices_in); + kdu_dims tile_indices_out; + codestream_out.get_valid_tiles(tile_indices_out); + assert((tile_indices_in.size.x == tile_indices_out.size.x) && + (tile_indices_in.size.y == tile_indices_out.size.y)); + int num_blocks=0; + + kdu_coords idx; + for (idx.y=0; idx.y < tile_indices_out.size.y; idx.y++) + { + for (idx.x=0; idx.x < tile_indices_out.size.x; idx.x++) + { + kdu_tile tile_in = mCodeStreamp->open_tile(idx+tile_indices_in.pos); + int tnum_in = tile_in.get_tnum(); + int tnum_out = idx.x + idx.y*tile_indices_out.size.x; + siz_out->copy_from(siz_in,tnum_in,tnum_out,0,0,discard_level,false,false,false); + siz_out->finalize_all(tnum_out); + // Note: do not open the output tile without first copying any tile-specific code-stream parameters + kdu_tile tile_out = codestream_out.open_tile(idx+tile_indices_out.pos); + assert(tnum_out == tile_out.get_tnum()); + copy_tile(tile_in,tile_out,tnum_in,tnum_out,siz_in,siz_out,0,num_blocks); + tile_in.close(); + tile_out.close(); + flush_counter--; + if ((flush_counter <= 0) && codestream_out.ready_for_flush()) + { + flush_counter = INT_MAX; + nel = codestream_out.trans_out(max_bytes,layer_bytes,total_layers); + non_empty_layers = (nel > non_empty_layers)?nel:non_empty_layers; + } + } + } + + // Generate the output code-stream + if (codestream_out.ready_for_flush()) + { + nel = codestream_out.trans_out(max_bytes,layer_bytes,total_layers); + non_empty_layers = (nel > non_empty_layers)?nel:non_empty_layers; + } + if (non_empty_layers > total_layers) + non_empty_layers = total_layers; // Can happen if a tile has more layers + + // Print out stats + std::cout << "Code stream parsing for discard level = " << discard_level << std::endl; + std::cout << " Total compressed memory in = " << mCodeStreamp->get_compressed_data_memory() << " bytes" << std::endl; + std::cout << " Total compressed memory out = " << codestream_out.get_compressed_data_memory() << " bytes" << std::endl; + //std::cout << " Output contains " << total_layers << " quality layers" << std::endl; + std::cout << " Transferred " << num_blocks << " code-blocks from in to out" << std::endl; + //std::cout << " Read " << mCodeStreamp->get_num_tparts() << " tile-part(s) from a total of " << (int) tile_indices_in.area() << " tile(s)" << std::endl; + std::cout << " Total bytes read = " << mCodeStreamp->get_total_bytes() << std::endl; + //std::cout << " Wrote " << codestream_out.get_num_tparts() << " tile-part(s) in a total of " << (int) tile_indices_out.area() << " tile(s)" << std::endl; + std::cout << " Total bytes written = " << codestream_out.get_total_bytes() << std::endl; + std::cout << "-------------" << std::endl; + + // Clean-up + cleanupCodeStream(); + codestream_out.destroy(); + delete[] output_buffer; + } + return; +} + void set_default_colour_weights(kdu_params *siz) { kdu_params *cod = siz->access_cluster(COD_params); diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 1489dbf704..9ab0b9e4a7 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -60,6 +60,7 @@ protected: BOOL reversible=FALSE); /*virtual*/ BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL); /*virtual*/ BOOL initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0); + void findDiscardLevelsBoundaries(LLImageJ2C &base); private: BOOL initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, ECodeStreamMode mode, S32 first_channel, S32 max_channel_count, int discard_level = -1, int* region = NULL); diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index ab60ab6d50..feb6671e40 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -29,6 +29,7 @@ // Class to test #include "llimagej2ckdu.h" #include "llkdumem.h" +#include "kdu_block_coding.h" // Tut header #include "lltut.h" @@ -107,16 +108,25 @@ bool LLKDUMemIn::get(int, kdu_line_buf&, int) { return false; } // Stub Kakadu Library calls kdu_tile_comp kdu_tile::access_component(int ) { kdu_tile_comp a; return a; } +kdu_block_encoder::kdu_block_encoder() { } +kdu_block_decoder::kdu_block_decoder() { } +void kdu_block::set_max_passes(int , bool ) { } +void kdu_block::set_max_bytes(int , bool ) { } +void kdu_block::set_max_samples(int ) { } void kdu_tile::close(kdu_thread_env* ) { } int kdu_tile::get_num_components() { return 0; } bool kdu_tile::get_ycc() { return false; } void kdu_tile::set_components_of_interest(int , const int* ) { } +int kdu_tile::get_tnum() { return 0; } kdu_resolution kdu_tile_comp::access_resolution() { kdu_resolution a; return a; } +kdu_resolution kdu_tile_comp::access_resolution(int ) { kdu_resolution a; return a; } int kdu_tile_comp::get_bit_depth(bool ) { return 8; } bool kdu_tile_comp::get_reversible() { return false; } +int kdu_tile_comp::get_num_resolutions() { return 1; } kdu_subband kdu_resolution::access_subband(int ) { kdu_subband a; return a; } void kdu_resolution::get_dims(kdu_dims& ) { } int kdu_resolution::which() { return 0; } +int kdu_resolution::get_valid_band_indices(int &) { return 1; } kdu_decoder::kdu_decoder(kdu_subband , kdu_sample_allocator*, bool , float, int, kdu_thread_env*, kdu_thread_queue*) { } kdu_synthesis::kdu_synthesis(kdu_resolution, kdu_sample_allocator*, bool, float, kdu_thread_env*, kdu_thread_queue*) { } kdu_params::kdu_params(const char*, bool, bool, bool, bool, bool) { } @@ -124,6 +134,7 @@ kdu_params::~kdu_params() { } void kdu_params::set(const char* , int , int , bool ) { } void kdu_params::set(const char* , int , int , int ) { } void kdu_params::finalize_all(bool ) { } +void kdu_params::finalize_all(int, bool ) { } void kdu_params::copy_from(kdu_params*, int, int, int, int, int, bool, bool, bool) { } bool kdu_params::parse_string(const char*) { return false; } bool kdu_params::get(const char*, int, int, bool&, bool, bool, bool) { return false; } @@ -148,9 +159,18 @@ void kdu_codestream::get_subsampling(int , kdu_coords&, bool ) { } void kdu_codestream::flush(kdu_long *, int , kdu_uint16 *, bool, bool, double, kdu_thread_env*) { } void kdu_codestream::set_resilient(bool ) { } int kdu_codestream::get_num_components(bool ) { return 0; } +kdu_long kdu_codestream::get_total_bytes(bool ) { return 0; } +kdu_long kdu_codestream::get_compressed_data_memory(bool ) {return 0; } +void kdu_codestream::share_buffering(kdu_codestream ) { } +int kdu_codestream::get_num_tparts() { return 0; } +int kdu_codestream::trans_out(kdu_long, kdu_long*, int, bool, kdu_thread_env* ) { return 0; } +bool kdu_codestream::ready_for_flush(kdu_thread_env*) { return false; } siz_params* kdu_codestream::access_siz() { return NULL; } kdu_tile kdu_codestream::open_tile(kdu_coords , kdu_thread_env* ) { kdu_tile a; return a; } kdu_codestream_comment kdu_codestream::add_comment() { kdu_codestream_comment a; return a; } +void kdu_subband::close_block(kdu_block*, kdu_thread_env*) { } +void kdu_subband::get_valid_blocks(kdu_dims &indices) { } +kdu_block* kdu_subband::open_block(kdu_coords, int*, kdu_thread_env*) { return NULL; } bool kdu_codestream_comment::put_text(const char*) { return false; } void kdu_customize_warnings(kdu_message*) { } void kdu_customize_errors(kdu_message*) { } -- cgit v1.2.3 From 792943c211f90738e245b11e128525190ff1b107 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 30 Mar 2012 14:07:43 -0700 Subject: SH-3050 : Add a call to set_max_bytes() and some clean up --- indra/llkdu/llimagej2ckdu.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 8b170a3206..fdfab5506a 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -807,12 +807,14 @@ copy_tile(kdu_tile tile_in, kdu_tile tile_out, int tnum_in, int tnum_out, comp_in = tile_in.access_component(c); comp_out = tile_out.access_component(c); int num_resolutions = comp_out.get_num_resolutions(); + //std::cout << " Copying tile : num_resolutions = " << num_resolutions << std::endl; for (int r=0; r < num_resolutions; r++) { kdu_resolution res_in; res_in = comp_in.access_resolution(r); kdu_resolution res_out; res_out = comp_out.access_resolution(r); int b, min_band; int num_bands = res_in.get_valid_band_indices(min_band); + std::cout << " Copying tile : num_bands = " << num_bands << std::endl; for (b=min_band; num_bands > 0; num_bands--, b++) { kdu_subband band_in; band_in = res_in.access_subband(b); @@ -826,6 +828,7 @@ copy_tile(kdu_tile tile_in, kdu_tile tile_out, int tnum_in, int tnum_out, return; } kdu_coords idx; + //std::cout << " Copying tile : block indices, x = " << blocks_out.size.x << " and y = " << blocks_out.size.y << std::endl; for (idx.y=0; idx.y < blocks_out.size.y; idx.y++) { for (idx.x=0; idx.x < blocks_out.size.x; idx.x++) @@ -857,10 +860,11 @@ void LLImageJ2CKDU::findDiscardLevelsBoundaries(LLImageJ2C &base) for (int discard_level = 0; discard_level < mLevels; discard_level++) { + //std::cout << "Parsing discard level = " << discard_level << std::endl; // Create the input codestream object. setupCodeStream(base, TRUE, MODE_FAST); mCodeStreamp->apply_input_restrictions(0, 4, discard_level, 0, NULL); - //mCodeStreamp->set_max_bytes(max,true); + mCodeStreamp->set_max_bytes(KDU_LONG_MAX,true); siz_params *siz_in = mCodeStreamp->access_siz(); // Create the output codestream object. @@ -898,6 +902,7 @@ void LLImageJ2CKDU::findDiscardLevelsBoundaries(LLImageJ2C &base) int num_blocks=0; kdu_coords idx; + //std::cout << "Parsing tiles : x = " << tile_indices_out.size.x << " to y = " << tile_indices_out.size.y << std::endl; for (idx.y=0; idx.y < tile_indices_out.size.y; idx.y++) { for (idx.x=0; idx.x < tile_indices_out.size.x; idx.x++) -- cgit v1.2.3 From 6a7582c09d5533cab09ca07da301d9c987b422f5 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 2 Apr 2012 11:21:52 -0400 Subject: SH-3041 FIX use server-sent baked texture IDs while waiting for avatar to load Prevents the avatar's baked texture UUIDs sent by the server's first objectUpdate message from being overwritten until the wearable cache results come back. --- indra/newview/llagent.cpp | 3 +-- indra/newview/llagentwearables.cpp | 11 ++++++++++- indra/newview/llvoavatarself.cpp | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 8aba2e76a2..83761ea18f 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3310,13 +3310,12 @@ void LLAgent::processAgentCachedTextureResponse(LLMessageSystem *mesgsys, void * else { // no cache of this bake. request upload. - gAgentAvatarp->requestLayerSetUpload(baked_index); + gAgentAvatarp->invalidateComposite(gAgentAvatarp->getLayerSet(baked_index),TRUE); } } } } } - llinfos << "Received cached texture response for " << num_results << " textures." << llendl; gAgentAvatarp->outputRezTiming("Fetched agent wearables textures from cache. Will now load them"); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index bd418ca2b3..5c302766c4 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1447,7 +1447,16 @@ void LLAgentWearables::setWearableOutfit(const LLInventoryItem::item_array_t& it { gAgentAvatarp->setCompositeUpdatesEnabled(TRUE); gAgentAvatarp->updateVisualParams(); - gAgentAvatarp->invalidateAll(); + + // If we have not yet declouded, we may want to use + // baked texture UUIDs sent from the first objectUpdate message + // don't overwrite these. If we have already declouded, we've saved + // these ids as the last known good textures and can invalidate without + // re-clouding. + if (!gAgentAvatarp->getIsCloud()) + { + gAgentAvatarp->invalidateAll(); + } } // Start rendering & update the server diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f73c8b59aa..02efda913e 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -822,6 +822,8 @@ U32 LLVOAvatarSelf::processUpdateMessage(LLMessageSystem *mesgsys, mInitialBakeIDs[i] = texture_id; } + onFirstTEMessageReceived(); + mInitialBakesLoaded = true; } -- cgit v1.2.3 From 7c14e354aedf5de21a3255a467750a09f18e33eb Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 2 Apr 2012 17:26:38 -0400 Subject: SH-3064 WIP - centralized logic for mapping rez status S32 values to strings --- indra/newview/llviewerassetstats.cpp | 7 +++---- indra/newview/llvoavatar.cpp | 25 +++++++++++-------------- indra/newview/llvoavatar.h | 1 + indra/newview/llvoavatarself.cpp | 10 ++++++---- indra/newview/tests/llviewerassetstats_test.cpp | 9 +++++++++ 5 files changed, 30 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index 0adefbc500..9e627a5c61 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -346,11 +346,10 @@ LLViewerAssetStats::asLLSD(bool compact_output) slot[mean_tag] = LLSD(F64(stats.mFPS.getMean())); } reg_stat[avatar_tag][avatar_nearby_tag] = LLSD::emptyArray(); - if (stats.mAvatarRezStates.size() > 2) + for (S32 rez_stat=0; rez_stat < stats.mAvatarRezStates.size(); ++rez_stat) { - reg_stat[avatar_tag][avatar_nearby_tag]["cloud"] = stats.mAvatarRezStates[0]; - reg_stat[avatar_tag][avatar_nearby_tag]["gray"] = stats.mAvatarRezStates[1]; - reg_stat[avatar_tag][avatar_nearby_tag]["textured"] = stats.mAvatarRezStates[2]; + std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat); + reg_stat["nearby"][rez_status_name] = stats.mAvatarRezStates[rez_stat]; } U32 grid_x(0), grid_y(0); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 1537435526..c6726fa860 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -779,13 +779,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, std::string LLVOAvatar::avString() const { - std::string viz_string; - if (getIsCloud()) - viz_string = "cloud"; - else if (isFullyTextured()) - viz_string = "textured"; - else - viz_string = "gray"; + std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); return " Avatar '" + getFullname() + "' " + viz_string + " "; } @@ -1075,6 +1069,15 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) } } +// static +std::string LLVOAvatar::rezStatusToString(S32 rez_status) +{ + if (rez_status==0) return "cloud"; + if (rez_status==1) return "gray"; + if (rez_status==2) return "textured"; + return "unknown"; +} + // static void LLVOAvatar::dumpBakedStatus() { @@ -8607,13 +8610,7 @@ void LLVOAvatar::idleUpdateRenderCost() } - std::string viz_string; - if (getIsCloud()) - viz_string = "cloud"; - else if (isFullyTextured()) - viz_string = "textured"; - else - viz_string = "gray"; + std::string viz_string = LLVOAvatar::rezStatusToString(getRezzedStatus()); setDebugText(llformat("%s %d", viz_string.c_str(), cost)); mVisualComplexity = cost; F32 green = 1.f-llclamp(((F32) cost-(F32)ARC_LIMIT)/(F32)ARC_LIMIT, 0.f, 1.f); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 76261c0dc8..04ef8d2014 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -555,6 +555,7 @@ public: BOOL isFullyBaked(); static BOOL areAllNearbyInstancesBaked(S32& grey_avatars); static void getNearbyRezzedStats(std::vector& counts); + static std::string rezStatusToString(S32 status); //-------------------------------------------------------------------- // Baked textures diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 5eb0cefb40..96f9ff39dd 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2128,14 +2128,16 @@ LLSD LLVOAvatarSelf::metricsData() // runway - add region info LLSD result; result["id"] = getID(); - result["rez_status"] = getRezzedStatus(); + result["rez_status"] = LLVOAvatar::rezStatusToString(getRezzedStatus()); result["is_self"] = isSelf(); std::vector rez_counts; LLVOAvatar::getNearbyRezzedStats(rez_counts); result["nearby"] = LLSD::emptyMap(); - result["nearby"]["cloud"] = rez_counts[0]; - result["nearby"]["gray"] = rez_counts[1]; - result["nearby"]["textured"] = rez_counts[2]; + for (S32 i=0; i& counts) counts[2] = 1; } +// static +std::string LLVOAvatar::rezStatusToString(S32 rez_status) +{ + if (rez_status==0) return "cloud"; + if (rez_status=1) return "gray"; + if (rez_status=2) return "textured"; + return "unknown"; +} + static const char * all_keys[] = { "duration", -- cgit v1.2.3 From 9eef61327bed3e71c2342d333596251d59b1500a Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Mon, 2 Apr 2012 17:41:02 -0400 Subject: SH-3041 BUILDFIX fixed a bad function call Had a function call in last checkin that was removed before commit since I thought it was only used in debug code. Adding it back in as its actually used. --- indra/newview/llvoavatarself.cpp | 14 ++++++++++++++ indra/newview/llvoavatarself.h | 1 + 2 files changed, 15 insertions(+) (limited to 'indra') diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 51d603f3bd..d0ccdf5209 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2645,6 +2645,20 @@ LLTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const return NULL; } +LLTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) const +{ + /* switch(index) + case TEX_HEAD_BAKED: + case TEX_HEAD_BODYPAINT: + return mHeadLayerSet; */ + if (baked_index >= 0 && baked_index < BAKED_NUM_INDICES) + { + return mBakedTextureDatas[baked_index].mTexLayerSet; + } + return NULL; +} + + // static void LLVOAvatarSelf::onCustomizeStart() { diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 17cdd514cc..004f7e885b 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -241,6 +241,7 @@ public: void requestLayerSetUpload(LLVOAvatarDefines::EBakedTextureIndex i); void requestLayerSetUpdate(LLVOAvatarDefines::ETextureIndex i); LLTexLayerSet* getLayerSet(LLVOAvatarDefines::ETextureIndex index) const; + LLTexLayerSet* getLayerSet(LLVOAvatarDefines::EBakedTextureIndex baked_index) const; //-------------------------------------------------------------------- // Composites -- cgit v1.2.3 From df09fd8e8b5b73330e4942c2cb218a216d7aca99 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 2 Apr 2012 19:05:32 -0700 Subject: SH-3060 : Preliminary implementation of the new byte range computation, implement setting to turn it on or off --- indra/llimage/llimage.cpp | 4 ++- indra/llimage/llimage.h | 5 +++- indra/llimage/llimagej2c.cpp | 47 +++++++++++---------------------- indra/llkdu/llimagej2ckdu.cpp | 14 ++++++++-- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llappviewer.cpp | 2 +- 6 files changed, 47 insertions(+), 36 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 937655a22d..7f95441075 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -48,11 +48,13 @@ //static std::string LLImage::sLastErrorMessage; LLMutex* LLImage::sMutex = NULL; +bool LLImage::sUseNewByteRange = false; LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ; //static -void LLImage::initClass() +void LLImage::initClass(bool use_new_byte_range) { + sUseNewByteRange = use_new_byte_range; sMutex = new LLMutex(NULL); LLImageBase::createPrivatePool() ; diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index eba8362f1c..b757547ab8 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -89,15 +89,18 @@ typedef enum e_image_codec class LLImage { public: - static void initClass(); + static void initClass(bool use_new_byte_range = false); static void cleanupClass(); static const std::string& getLastError(); static void setLastError(const std::string& message); + static bool useNewByteRange() { return sUseNewByteRange; } + protected: static LLMutex* sMutex; static std::string sLastErrorMessage; + static bool sUseNewByteRange; }; //============================================================================ diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index fbf4b769e1..cbb6f75b43 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -262,10 +262,12 @@ S32 LLImageJ2C::calcHeaderSizeJ2C() //static S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) { - // Note: this only provides an *estimate* of the size in bytes of an image level - // *TODO: find a way to read the true size (when available) and convey the fact - // that the result is an estimate in the other cases - if (rate <= 0.f) rate = .125f; + // Note: This provides an estimation for the first quality layer of a given discard level + // This is however an efficient approximation, as the true discard level boundary would be + // in general too big for fast fetching. + // For details about the equation used here, see https://wiki.lindenlab.com/wiki/THX1138_KDU_Improvements#Byte_Range_Study + if (rate <= 0.f) rate = 1.f/8.f; + // Compute w/pow(2,discard_level) and h/pow(2,discard_level) while (discard_level > 0) { if (w < 1 || h < 1) @@ -274,7 +276,13 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r h >>= 1; discard_level--; } - S32 bytes = (S32)((F32)(w*h*comp)*rate); + // Temporary: compute both new and old range and pick one according to the settings TextureNewByteRange + // *TODO: Take the old code out once we have enough tests done + // *TODO: Replace the magic "7" by the number of quality layers in the j2c image + S32 bytes; + S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/7.f; + S32 old_bytes = (S32)((F32)(w*h*comp)*rate); + bytes = (LLImage::useNewByteRange() ? new_bytes : old_bytes); bytes = llmax(bytes, calcHeaderSizeJ2C()); return bytes; } @@ -284,11 +292,7 @@ S32 LLImageJ2C::calcHeaderSize() return calcHeaderSizeJ2C(); } - -// calcDataSize() returns how many bytes to read -// to load discard_level (including header and higher discard levels) -// *TODO: This is deeply wrong. That size should be taken from the image file header or other -// relevant infos. In any case, this is only an approximation. +// calcDataSize() returns how many bytes to read to load discard_level (including header) S32 LLImageJ2C::calcDataSize(S32 discard_level) { discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL); @@ -304,25 +308,6 @@ S32 LLImageJ2C::calcDataSize(S32 discard_level) mDataSizes[level] = calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), level, mRate); level--; } - - /* This is technically a more correct way to calculate the size required - for each discard level, since they should include the size needed for - lower levels. Unfortunately, this doesn't work well and will lead to - download stalls. The true correct way is to parse the header. This will - all go away with http textures at some point. - - // Calculate the size for each discard level. Lower levels (higher quality) - // contain the cumulative size of higher levels - S32 total_size = calcHeaderSizeJ2C(); - - S32 level = MAX_DISCARD_LEVEL; // Start at the highest discard - while ( level >= 0 ) - { // Add in this discard level and all before it - total_size += calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), level, mRate); - mDataSizes[level] = total_size; - level--; - } - */ } return mDataSizes[discard_level]; } @@ -337,8 +322,8 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes) } while (1) { - S32 bytes_needed = calcDataSize(discard_level); // virtual - if (bytes >= bytes_needed - (bytes_needed>>2)) // For J2c, up the res at 75% of the optimal number of bytes + S32 bytes_needed = calcDataSize(discard_level); + if (bytes >= bytes_needed) { break; } diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index fdfab5506a..4468b8563b 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -294,6 +294,13 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECod // Get the number of resolution levels in that image mLevels = mCodeStreamp->get_min_dwt_levels(); + + //kdu_coords idx; idx.x = 0; idx.y = 0; + //kdu_dims tile_indices_in; + //mCodeStreamp->get_valid_tiles(tile_indices_in); + //mCodeStreamp->create_tile(idx+tile_indices_in.pos); + //int layers = mCodeStreamp->get_max_tile_layers(); + //llinfos << "Merov debug : setupCodeStream, levels = " << mLevels << ", layers = " << layers << llendl; // Set the base dimensions base.setSize(dims.size.x, dims.size.y, components); @@ -390,7 +397,7 @@ BOOL LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco region_kdu->size.y = region[3] - region[1]; } int discard = (discard_level != -1 ? discard_level : base.getRawDiscardLevel()); - + llinfos << "Merov debug : initDecode, discard used = " << discard << ", asked = " << discard_level << llendl; // Apply loading restrictions mCodeStreamp->apply_input_restrictions( first_channel, max_channel_count, discard, 0, region_kdu); @@ -468,6 +475,9 @@ BOOL LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco { kdu_tile tile = mCodeStreamp->open_tile(*(mTPosp)+mTileIndicesp->pos); + int layers = mCodeStreamp->get_max_tile_layers(); + llinfos << "Merov debug : decodeImpl, levels = " << mLevels << ", layers = " << layers << llendl; + // Find the region of the buffer occupied by this // tile. Note that we have no control over // sub-sampling factors which might have been used @@ -675,7 +685,7 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co std::string blocks_string = llformat("Cblk={%d,%d}",mBlocksSize,mBlocksSize); codestream.access_siz()->parse_string(blocks_string.c_str()); } - std::string ordering_string = llformat("Corder=RPCL"); + std::string ordering_string = llformat("Corder=LRCP"); codestream.access_siz()->parse_string(ordering_string.c_str()); std::string PLT_string = llformat("ORGgen_plt=yes"); codestream.access_siz()->parse_string(PLT_string.c_str()); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9fff543b13..5fc9c5d863 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10686,6 +10686,17 @@ Value 0 + TextureNewByteRange + + Comment + Use the new more accurate byte range computation for j2c discard levels + Persist + 1 + Type + Boolean + Value + 1 + TexturePickerShowFolders Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bea8303d69..1a68d0317e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1947,7 +1947,7 @@ bool LLAppViewer::initThreads() static const bool enable_threads = true; #endif - LLImage::initClass(); + LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange")); LLVFSThread::initClass(enable_threads && false); LLLFSThread::initClass(enable_threads && false); -- cgit v1.2.3 From cd12a3bba9da830b98d53a207daca20c29035cc5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 3 Apr 2012 17:37:32 -0400 Subject: fixed integration test bug revealed by mac compiler pickiness --- indra/newview/tests/llviewerassetstats_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index ba760c0695..56d2004c17 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -49,8 +49,8 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) std::string LLVOAvatar::rezStatusToString(S32 rez_status) { if (rez_status==0) return "cloud"; - if (rez_status=1) return "gray"; - if (rez_status=2) return "textured"; + if (rez_status==1) return "gray"; + if (rez_status==2) return "textured"; return "unknown"; } -- cgit v1.2.3 From 625e76c1e429657009c9521ee958e9c2535a2f07 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 3 Apr 2012 16:02:03 -0600 Subject: For SH-3072: do not pause texture fetching when FPS is low. --- indra/newview/llappviewer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bea8303d69..971b096a15 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1339,13 +1339,11 @@ bool LLAppViewer::mainLoop() ms_sleep(500); } - static const F64 FRAME_SLOW_THRESHOLD = 0.5; //2 frames per seconds const F64 max_idle_time = llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second idleTimer.reset(); - bool is_slow = (frameTimer.getElapsedTimeF64() > FRAME_SLOW_THRESHOLD) ; S32 total_work_pending = 0; S32 total_io_pending = 0; - while(!is_slow)//do not unpause threads if the frame rates are very low. + while(1) { S32 work_pending = 0; S32 io_pending = 0; -- cgit v1.2.3 From 6eb53b7c42812cd1e2ebca21bec6849ba850406f Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 3 Apr 2012 16:02:36 -0600 Subject: For SH-3071: Increase HTTP concurrency to improve texture fetching performance --- indra/newview/lltexturefetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e27ebf9018..9ed6537b7a 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1151,7 +1151,7 @@ bool LLTextureFetchWorker::doWork(S32 param) //1, not openning too many file descriptors at the same time; //2, control the traffic of http so udp gets bandwidth. // - static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 8 ; + static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 24 ; if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) { return false ; //wait. -- cgit v1.2.3 From 96d96bf4746210095cc40bd37b46b005daf7a0f3 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 4 Apr 2012 10:40:26 -0400 Subject: formatting fixes (whitespace only) --- indra/newview/llvoavatar.cpp | 208 +++++++++++++++++++++---------------------- 1 file changed, 104 insertions(+), 104 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index c6726fa860..2f26c4583c 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3177,56 +3177,56 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) || is_away != mNameAway || is_busy != mNameBusy || is_muted != mNameMute - || is_appearance != mNameAppearance + || is_appearance != mNameAppearance || is_friend != mNameFriend || is_cloud != mNameCloud) - { + { LLColor4 name_tag_color = getNameTagColor(is_friend); clearNameTag(); if (is_away || is_muted || is_busy || is_appearance) - { + { std::string line; - if (is_away) - { - line += LLTrans::getString("AvatarAway"); + if (is_away) + { + line += LLTrans::getString("AvatarAway"); line += ", "; - } - if (is_busy) - { + } + if (is_busy) + { line += LLTrans::getString("AvatarBusy"); line += ", "; } if (is_muted) - { + { line += LLTrans::getString("AvatarMuted"); - line += ", "; - } + line += ", "; + } if (is_appearance) { line += LLTrans::getString("AvatarEditingAppearance"); line += ", "; - } + } if (is_cloud) - { + { line += LLTrans::getString("LoadingData"); line += ", "; } // trim last ", " line.resize( line.length() - 2 ); addNameTagLine(line, name_tag_color, LLFontGL::NORMAL, - LLFontGL::getFontSansSerifSmall()); + LLFontGL::getFontSansSerifSmall()); } if (sRenderGroupTitles && title && title->getString() && title->getString()[0] != '\0') - { + { std::string title_str = title->getString(); LLStringFn::replace_ascii_controlchars(title_str,LL_UNKNOWN_CHAR); addNameTagLine(title_str, name_tag_color, LLFontGL::NORMAL, - LLFontGL::getFontSansSerifSmall()); - } + LLFontGL::getFontSansSerifSmall()); + } static LLUICachedControl show_display_names("NameTagShowDisplayNames"); static LLUICachedControl show_usernames("NameTagShowUsernames"); @@ -3239,120 +3239,120 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name) // ...call this function back when the name arrives // and force a rebuild LLAvatarNameCache::get(getID(), - boost::bind(&LLVOAvatar::clearNameTag, this)); - } + boost::bind(&LLVOAvatar::clearNameTag, this)); + } // Might be blank if name not available yet, that's OK if (show_display_names) { addNameTagLine(av_name.mDisplayName, name_tag_color, LLFontGL::NORMAL, - LLFontGL::getFontSansSerif()); - } + LLFontGL::getFontSansSerif()); + } // Suppress SLID display if display name matches exactly (ugh) if (show_usernames && !av_name.mIsDisplayNameDefault) - { + { // *HACK: Desaturate the color LLColor4 username_color = name_tag_color * 0.83f; addNameTagLine(av_name.mUsername, username_color, LLFontGL::NORMAL, - LLFontGL::getFontSansSerifSmall()); + LLFontGL::getFontSansSerifSmall()); } - } + } else - { + { const LLFontGL* font = LLFontGL::getFontSansSerif(); std::string full_name = LLCacheName::buildFullName( firstname->getString(), lastname->getString() ); addNameTagLine(full_name, name_tag_color, LLFontGL::NORMAL, font); - } + } - mNameAway = is_away; - mNameBusy = is_busy; - mNameMute = is_muted; - mNameAppearance = is_appearance; + mNameAway = is_away; + mNameBusy = is_busy; + mNameMute = is_muted; + mNameAppearance = is_appearance; mNameFriend = is_friend; - mNameCloud = is_cloud; - mTitle = title ? title->getString() : ""; - LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); - new_name = TRUE; - } + mNameCloud = is_cloud; + mTitle = title ? title->getString() : ""; + LLStringFn::replace_ascii_controlchars(mTitle,LL_UNKNOWN_CHAR); + new_name = TRUE; + } if (mVisibleChat) - { - mNameText->setFont(LLFontGL::getFontSansSerif()); + { + mNameText->setFont(LLFontGL::getFontSansSerif()); mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_LEFT); - mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); + mNameText->setFadeDistance(CHAT_NORMAL_RADIUS * 2.f, 5.f); - char line[MAX_STRING]; /* Flawfinder: ignore */ - line[0] = '\0'; - std::deque::iterator chat_iter = mChats.begin(); - mNameText->clearString(); - - LLColor4 new_chat = LLUIColorTable::instance().getColor( isSelf() ? "UserChatColor" : "AgentChatColor" ); - LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); - LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); - if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) - { - ++chat_iter; - } + char line[MAX_STRING]; /* Flawfinder: ignore */ + line[0] = '\0'; + std::deque::iterator chat_iter = mChats.begin(); + mNameText->clearString(); - for(; chat_iter != mChats.end(); ++chat_iter) - { - F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f); - LLFontGL::StyleFlags style; - switch(chat_iter->mChatType) - { - case CHAT_TYPE_WHISPER: - style = LLFontGL::ITALIC; - break; - case CHAT_TYPE_SHOUT: - style = LLFontGL::BOLD; - break; - default: - style = LLFontGL::NORMAL; - break; - } - if (chat_fade_amt < 1.f) - { - F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f); - mNameText->addLine(chat_iter->mText, lerp(new_chat, normal_chat, u), style); - } - else if (chat_fade_amt < 2.f) - { - F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f); - mNameText->addLine(chat_iter->mText, lerp(normal_chat, old_chat, u), style); - } - else if (chat_fade_amt < 3.f) - { - // *NOTE: only remove lines down to minimum number - mNameText->addLine(chat_iter->mText, old_chat, style); - } - } - mNameText->setVisibleOffScreen(TRUE); - - if (mTyping) - { - S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1; - switch(dot_count) - { - case 1: - mNameText->addLine(".", new_chat); - break; - case 2: - mNameText->addLine("..", new_chat); - break; - case 3: - mNameText->addLine("...", new_chat); - break; - } + LLColor4 new_chat = LLUIColorTable::instance().getColor( isSelf() ? "UserChatColor" : "AgentChatColor" ); + LLColor4 normal_chat = lerp(new_chat, LLColor4(0.8f, 0.8f, 0.8f, 1.f), 0.7f); + LLColor4 old_chat = lerp(normal_chat, LLColor4(0.6f, 0.6f, 0.6f, 1.f), 0.7f); + if (mTyping && mChats.size() >= MAX_BUBBLE_CHAT_UTTERANCES) + { + ++chat_iter; + } - } + for(; chat_iter != mChats.end(); ++chat_iter) + { + F32 chat_fade_amt = llclamp((F32)((LLFrameTimer::getElapsedSeconds() - chat_iter->mTime) / CHAT_FADE_TIME), 0.f, 4.f); + LLFontGL::StyleFlags style; + switch(chat_iter->mChatType) + { + case CHAT_TYPE_WHISPER: + style = LLFontGL::ITALIC; + break; + case CHAT_TYPE_SHOUT: + style = LLFontGL::BOLD; + break; + default: + style = LLFontGL::NORMAL; + break; } - else + if (chat_fade_amt < 1.f) + { + F32 u = clamp_rescale(chat_fade_amt, 0.9f, 1.f, 0.f, 1.f); + mNameText->addLine(chat_iter->mText, lerp(new_chat, normal_chat, u), style); + } + else if (chat_fade_amt < 2.f) + { + F32 u = clamp_rescale(chat_fade_amt, 1.9f, 2.f, 0.f, 1.f); + mNameText->addLine(chat_iter->mText, lerp(normal_chat, old_chat, u), style); + } + else if (chat_fade_amt < 3.f) + { + // *NOTE: only remove lines down to minimum number + mNameText->addLine(chat_iter->mText, old_chat, style); + } + } + mNameText->setVisibleOffScreen(TRUE); + + if (mTyping) + { + S32 dot_count = (llfloor(mTypingTimer.getElapsedTimeF32() * 3.f) + 2) % 3 + 1; + switch(dot_count) { + case 1: + mNameText->addLine(".", new_chat); + break; + case 2: + mNameText->addLine("..", new_chat); + break; + case 3: + mNameText->addLine("...", new_chat); + break; + } + + } + } + else + { // ...not using chat bubbles, just names mNameText->setTextAlignment(LLHUDNameTag::ALIGN_TEXT_CENTER); - mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); - mNameText->setVisibleOffScreen(FALSE); + mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); + mNameText->setVisibleOffScreen(FALSE); } } -- cgit v1.2.3 From 67353ef0c24f62c5e2356ccc1aaa55fb556379f5 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 4 Apr 2012 10:41:31 -0400 Subject: formatting fixes (whitespace only) --- indra/newview/llvoavatar.cpp | 82 ++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 2f26c4583c..58cabd1a24 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3067,43 +3067,43 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) return; } - BOOL new_name = FALSE; - if (visible_chat != mVisibleChat) + BOOL new_name = FALSE; + if (visible_chat != mVisibleChat) + { + mVisibleChat = visible_chat; + new_name = TRUE; + } + + if (sRenderGroupTitles != mRenderGroupTitles) + { + mRenderGroupTitles = sRenderGroupTitles; + new_name = TRUE; + } + + // First Calculate Alpha + // If alpha > 0, create mNameText if necessary, otherwise delete it + F32 alpha = 0.f; + if (mAppAngle > 5.f) + { + const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION; + if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME) { - mVisibleChat = visible_chat; - new_name = TRUE; + alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION; } - - if (sRenderGroupTitles != mRenderGroupTitles) + else { - mRenderGroupTitles = sRenderGroupTitles; - new_name = TRUE; + // ...not fading, full alpha + alpha = 1.f; } - - // First Calculate Alpha - // If alpha > 0, create mNameText if necessary, otherwise delete it - F32 alpha = 0.f; - if (mAppAngle > 5.f) - { - const F32 START_FADE_TIME = NAME_SHOW_TIME - FADE_DURATION; - if (!visible_chat && sRenderName == RENDER_NAME_FADE && time_visible > START_FADE_TIME) - { - alpha = 1.f - (time_visible - START_FADE_TIME) / FADE_DURATION; - } - else - { - // ...not fading, full alpha - alpha = 1.f; - } - } - else if (mAppAngle > 2.f) - { - // far away is faded out also - alpha = (mAppAngle-2.f)/3.f; - } + } + else if (mAppAngle > 2.f) + { + // far away is faded out also + alpha = (mAppAngle-2.f)/3.f; + } if (alpha <= 0.f) - { + { if (mNameText) { mNameText->markDead(); @@ -3113,19 +3113,19 @@ void LLVOAvatar::idleUpdateNameTag(const LLVector3& root_pos_last) return; } - if (!mNameText) - { + if (!mNameText) + { mNameText = static_cast( LLHUDObject::addHUDObject( - LLHUDObject::LL_HUD_NAME_TAG) ); + LLHUDObject::LL_HUD_NAME_TAG) ); //mNameText->setMass(10.f); - mNameText->setSourceObject(this); + mNameText->setSourceObject(this); mNameText->setVertAlignment(LLHUDNameTag::ALIGN_VERT_TOP); - mNameText->setVisibleOffScreen(TRUE); - mNameText->setMaxLines(11); - mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); - sNumVisibleChatBubbles++; - new_name = TRUE; - } + mNameText->setVisibleOffScreen(TRUE); + mNameText->setMaxLines(11); + mNameText->setFadeDistance(CHAT_NORMAL_RADIUS, 5.f); + sNumVisibleChatBubbles++; + new_name = TRUE; + } LLVector3 name_position = idleUpdateNameTagPosition(root_pos_last); mNameText->setPositionAgent(name_position); -- cgit v1.2.3 From c6511d9c857c079e0360f88c05328feb70a8bc0d Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 4 Apr 2012 15:59:52 -0700 Subject: SH-3075 : Fix encoding for reversible images and small textures --- indra/llimage/llimage.h | 2 + indra/llkdu/llimagej2ckdu.cpp | 112 +++++++++++++++++++++--------------------- 2 files changed, 58 insertions(+), 56 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index b757547ab8..18f8ae2fbb 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -48,6 +48,8 @@ const S32 MAX_PRECINCT_SIZE = 2048; // No reason to be bigger than MAX_IMAGE_S const S32 MIN_PRECINCT_SIZE = 4; // Can't be smaller than MIN_BLOCK_SIZE const S32 MAX_BLOCK_SIZE = 64; // Max total block size is 4096, hence 64x64 when using square blocks const S32 MIN_BLOCK_SIZE = 4; // Min block dim is 4 according to jpeg2000 spec +const S32 MIN_LAYER_SIZE = 2000; // Size of the first quality layer (after header). Must be > to FIRST_PACKET_SIZE!! +const S32 MAX_NB_LAYERS = 64; // Max number of layers we'll entertain in SL (practical limit) const S32 MIN_IMAGE_SIZE = (1<= 3) { // Note that we always use YCC and not YUV @@ -612,67 +606,70 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co set_default_colour_weights(codestream.access_siz()); } + // Set codestream options + int num_layer_specs = 0; + kdu_long layer_bytes[MAX_NB_LAYERS]; + U32 max_bytes = (U32)(base.getWidth() * base.getHeight() * base.getComponents()); + + // Rate is the argument passed into the LLImageJ2C which + // specifies the target compression rate. The default is 8:1. + // *TODO: mRate is actually always 8:1 in the viewer. Test different values. Also force to reversible for small (< 500 bytes) textures. + if (base.mRate != 0.f) + { + max_bytes = (U32)((F32)(max_bytes) * base.mRate); + } + else + { + max_bytes = (U32)((F32)(max_bytes) / 8.0f); + } + + // If the image is very small, code it in a lossless way. + // Note: it'll also have only 1 layer which is fine as there's no point reordering blocks in that case. + if (max_bytes < FIRST_PACKET_SIZE) + { + reversible = true; + } + + // This code is where we specify the target number of bytes for each quality layer. + // We're using a logarithmic spacing rule that fits with our way of fetching texture data. + // Note: For more info on this layers business, read kdu_codestream::flush() doc in kdu_compressed.h + U32 i = FIRST_PACKET_SIZE; + while ((i < max_bytes) && (num_layer_specs < (MAX_NB_LAYERS-1))) + { + if (i == FIRST_PACKET_SIZE * 4) + { + // That really just means that the first layer is FIRST_PACKET_SIZE and the second is MIN_LAYER_SIZE + i = MIN_LAYER_SIZE; + } + layer_bytes[num_layer_specs] = i; + num_layer_specs++; + i *= 4; + } + if (reversible) { codestream.access_siz()->parse_string("Creversible=yes"); - // *TODO: we should use yuv in reversible mode and one level since those images are small. + // *TODO: we should use yuv in reversible mode and one res level since those images are small. // Don't turn this on now though as both create problems on decoding for the moment //codestream.access_siz()->parse_string("Clevels=1"); //codestream.access_siz()->parse_string("Cycc=no"); - // If we're doing reversible (i.e. lossless compression), assumes we're not using quality layers. - // *TODO: this is incorrect and unecessary. Try using the regular layer setting. - codestream.access_siz()->parse_string("Clayers=1"); - num_layer_specs = 1; - layer_bytes[0] = 0; + // In the reversible case, set the last entry of that table to 0 so that all generated bits will + // indeed be output by the time the last quality layer is encountered. + layer_bytes[num_layer_specs] = 0; } else { - // Rate is the argument passed into the LLImageJ2C which - // specifies the target compression rate. The default is 8:1. - // Possibly if max_bytes < 500, we should just use the default setting? - // *TODO: mRate is actually always 8:1 in the viewer. Test different values. Also force to reversible for small (< 500 bytes) textures. - if (base.mRate != 0.f) - { - max_bytes = (U32)(base.mRate*base.getWidth()*base.getHeight()*base.getComponents()); - } - else - { - max_bytes = (U32)(base.getWidth()*base.getHeight()*base.getComponents()*0.125); - } - - const U32 min_bytes = FIRST_PACKET_SIZE; - if (max_bytes > min_bytes) - { - U32 i; - // This code is where we specify the target number of bytes for - // each layer. Not sure if we should do this for small images - // or not. The goal is to have this roughly align with - // different quality levels that we decode at. - for (i = min_bytes; i < max_bytes; i*=4) - { - if (i == min_bytes * 4) - { - i = 2000; - } - layer_bytes[num_layer_specs] = i; - num_layer_specs++; - } - layer_bytes[num_layer_specs] = max_bytes; - num_layer_specs++; - - std::string layer_string = llformat("Clayers=%d",num_layer_specs); - codestream.access_siz()->parse_string(layer_string.c_str()); - } - else - { - layer_bytes[0] = min_bytes; - num_layer_specs = 1; - std::string layer_string = llformat("Clayers=%d",num_layer_specs); - codestream.access_siz()->parse_string(layer_string.c_str()); - } + // Truncate the last quality layer if necessary so to fit the set compression ratio + layer_bytes[num_layer_specs] = max_bytes; } + num_layer_specs++; + + std::string layer_string = llformat("Clayers=%d",num_layer_specs); + codestream.access_siz()->parse_string(layer_string.c_str()); // Set up data ordering, markers, etc... if precincts or blocks specified + // Note: This code is *not* used in the encoding made by the viewer. It is currently used only + // by llimage_libtest to create various j2c and test alternative compression schemes. if ((mBlocksSize != -1) || (mPrecinctsSize != -1)) { if (mPrecinctsSize != -1) @@ -692,16 +689,19 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co std::string Parts_string = llformat("ORGtparts=R"); codestream.access_siz()->parse_string(Parts_string.c_str()); } + + // Set the number of wavelets subresolutions (aka levels) if (mLevels != 0) { std::string levels_string = llformat("Clevels=%d",mLevels); codestream.access_siz()->parse_string(levels_string.c_str()); } + // Complete the encode settings codestream.access_siz()->finalize_all(); codestream.change_appearance(transpose,vflip,hflip); - // Now we are ready for sample data processing. + // Now we are ready for sample data processing kdc_flow_control *tile = new kdc_flow_control(&mem_in,codestream); bool done = false; while (!done) -- cgit v1.2.3 From 782981866a70f4a33a298c93ee80aaf138fdf459 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 4 Apr 2012 18:58:34 -0700 Subject: SH-3060 : New byte range implementation. Intermediate (not working) state. --- indra/llimage/llimage.cpp | 3 ++- indra/llimage/llimage.h | 3 +++ indra/llimage/llimagej2c.cpp | 20 +++++++++++----- indra/llimage/llimagej2c.h | 3 ++- indra/llkdu/llimagej2ckdu.cpp | 40 +++++++++++++++++--------------- indra/llkdu/llimagej2ckdu.h | 1 + indra/llkdu/tests/llimagej2ckdu_test.cpp | 1 + 7 files changed, 44 insertions(+), 27 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 7f95441075..cce03ff6e6 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1337,7 +1337,8 @@ LLImageFormatted::LLImageFormatted(S8 codec) mDecoding(0), mDecoded(0), mDiscardLevel(-1), - mLevels(0) + mLevels(0), + mLayers(0) { mMemType = LLMemType::MTYPE_IMAGEFORMATTED; } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index 18f8ae2fbb..c5a7d6262e 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -320,6 +320,8 @@ public: S8 getDiscardLevel() const { return mDiscardLevel; } S8 getLevels() const { return mLevels; } void setLevels(S8 nlevels) { mLevels = nlevels; } + S32 getLayers() const { return mLayers; } + void setLayers(S32 nlayers) { mLayers = nlayers; } // setLastError needs to be deferred for J2C images since it may be called from a DLL virtual void resetLastError(); @@ -334,6 +336,7 @@ protected: S8 mDecoded; // unused, but changing LLImage layout requires recompiling static Mac/Linux libs. 2009-01-30 JC S8 mDiscardLevel; // Current resolution level worked on. 0 = full res, 1 = half res, 2 = quarter res, etc... S8 mLevels; // Number of resolution levels in that image. Min is 1. 0 means unknown. + S32 mLayers; // Number of quality layers in that image. Min is 1. 0 means unknown. public: static S32 sGlobalFormattedMemory; diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index cbb6f75b43..dc5bd8b5d5 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -58,7 +58,8 @@ LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), mRawDiscardLevel(-1), mRate(0.0f), mReversible(FALSE), - mAreaUsedForDataSizeCalcs(0) + mAreaUsedForDataSizeCalcs(0), + mLayersUsedForDataSizeCalcs(0) { mImpl = fallbackCreateLLImageJ2CImpl(); @@ -260,7 +261,7 @@ S32 LLImageJ2C::calcHeaderSizeJ2C() } //static -S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) +S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, S32 nb_layers, F32 rate) { // Note: This provides an estimation for the first quality layer of a given discard level // This is however an efficient approximation, as the true discard level boundary would be @@ -278,10 +279,11 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r } // Temporary: compute both new and old range and pick one according to the settings TextureNewByteRange // *TODO: Take the old code out once we have enough tests done - // *TODO: Replace the magic "7" by the number of quality layers in the j2c image S32 bytes; - S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/7.f; + F32 layer_factor = ((nb_layers > 0) && (nb_layers < 7) ? 3.0f * (7 - nb_layers): 3.0f); + S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor; S32 old_bytes = (S32)((F32)(w*h*comp)*rate); + llinfos << "Merov debug : calcDataSizeJ2C, layers = " << nb_layers << ", old = " << old_bytes << ", new = " << new_bytes << llendl; bytes = (LLImage::useNewByteRange() ? new_bytes : old_bytes); bytes = llmax(bytes, calcHeaderSizeJ2C()); return bytes; @@ -298,14 +300,20 @@ S32 LLImageJ2C::calcDataSize(S32 discard_level) discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL); if ( mAreaUsedForDataSizeCalcs != (getHeight() * getWidth()) - || mDataSizes[0] == 0) + || (mLayersUsedForDataSizeCalcs != getLayers()) + || (mDataSizes[0] == 0)) { + if (mLayersUsedForDataSizeCalcs != getLayers()) + { + llinfos << "Merov debug : recomputing data size because " << mLayersUsedForDataSizeCalcs << " != " << getLayers() << llendl; + } mAreaUsedForDataSizeCalcs = getHeight() * getWidth(); + mLayersUsedForDataSizeCalcs = getLayers(); S32 level = MAX_DISCARD_LEVEL; // Start at the highest discard while ( level >= 0 ) { - mDataSizes[level] = calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), level, mRate); + mDataSizes[level] = calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), level, getLayers(), mRate); level--; } } diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 914174fc57..28e3026aac 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -72,7 +72,7 @@ public: S32 getMaxBytes() const { return mMaxBytes; } static S32 calcHeaderSizeJ2C(); - static S32 calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate = 0.f); + static S32 calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, S32 nb_layers = 0, F32 rate = 0.f); static std::string getEngineInfo(); @@ -88,6 +88,7 @@ protected: S32 mDataSizes[MAX_DISCARD_LEVEL+1]; // Size of data required to reach a given level U32 mAreaUsedForDataSizeCalcs; // Height * width used to calculate mDataSizes + S32 mLayersUsedForDataSizeCalcs; // Numbers of layers used to calculate mDataSizes S8 mRawDiscardLevel; F32 mRate; diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 78c9be7bfd..08d840917d 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -195,7 +195,8 @@ mRawImagep(NULL), mDecodeState(NULL), mBlocksSize(-1), mPrecinctsSize(-1), -mLevels(0) +mLevels(0), +mLayers(0) { } @@ -245,6 +246,8 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECod mCodeStreamp->create(mInputp); // Set the maximum number of bytes to use from the codestream + // *TODO: This seems to be wrong. The base class should have no idea of how j2c compression works so no + // good way of computing what's the byte range to be used. mCodeStreamp->set_max_bytes(max_bytes,true); // If you want to flip or rotate the image for some reason, change @@ -295,13 +298,6 @@ void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, BOOL keep_codestream, ECod // Get the number of resolution levels in that image mLevels = mCodeStreamp->get_min_dwt_levels(); - //kdu_coords idx; idx.x = 0; idx.y = 0; - //kdu_dims tile_indices_in; - //mCodeStreamp->get_valid_tiles(tile_indices_in); - //mCodeStreamp->create_tile(idx+tile_indices_in.pos); - //int layers = mCodeStreamp->get_max_tile_layers(); - //llinfos << "Merov debug : setupCodeStream, levels = " << mLevels << ", layers = " << layers << llendl; - // Set the base dimensions base.setSize(dims.size.x, dims.size.y, components); base.setLevels(mLevels); @@ -364,7 +360,8 @@ BOOL LLImageJ2CKDU::initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int bloc mLevels = levels; if (mLevels != 0) { - mLevels = llclamp(mLevels,MIN_DECOMPOSITION_LEVELS,MIN_DECOMPOSITION_LEVELS); + mLevels = llclamp(mLevels,MIN_DECOMPOSITION_LEVELS,MAX_DECOMPOSITION_LEVELS); + base.setLevels(mLevels); } return TRUE; } @@ -476,7 +473,11 @@ BOOL LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco kdu_tile tile = mCodeStreamp->open_tile(*(mTPosp)+mTileIndicesp->pos); int layers = mCodeStreamp->get_max_tile_layers(); - llinfos << "Merov debug : decodeImpl, levels = " << mLevels << ", layers = " << layers << llendl; + if (layers > mLayers) + { + mLayers = layers; + base.setLayers(mLayers); + } // Find the region of the buffer occupied by this // tile. Note that we have no control over @@ -607,7 +608,7 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co } // Set codestream options - int num_layer_specs = 0; + mLayers = 0; kdu_long layer_bytes[MAX_NB_LAYERS]; U32 max_bytes = (U32)(base.getWidth() * base.getHeight() * base.getComponents()); @@ -634,15 +635,15 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co // We're using a logarithmic spacing rule that fits with our way of fetching texture data. // Note: For more info on this layers business, read kdu_codestream::flush() doc in kdu_compressed.h U32 i = FIRST_PACKET_SIZE; - while ((i < max_bytes) && (num_layer_specs < (MAX_NB_LAYERS-1))) + while ((i < max_bytes) && (mLayers < (MAX_NB_LAYERS-1))) { if (i == FIRST_PACKET_SIZE * 4) { // That really just means that the first layer is FIRST_PACKET_SIZE and the second is MIN_LAYER_SIZE i = MIN_LAYER_SIZE; } - layer_bytes[num_layer_specs] = i; - num_layer_specs++; + layer_bytes[mLayers] = i; + mLayers++; i *= 4; } @@ -655,17 +656,18 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co //codestream.access_siz()->parse_string("Cycc=no"); // In the reversible case, set the last entry of that table to 0 so that all generated bits will // indeed be output by the time the last quality layer is encountered. - layer_bytes[num_layer_specs] = 0; + layer_bytes[mLayers] = 0; } else { // Truncate the last quality layer if necessary so to fit the set compression ratio - layer_bytes[num_layer_specs] = max_bytes; + layer_bytes[mLayers] = max_bytes; } - num_layer_specs++; + mLayers++; - std::string layer_string = llformat("Clayers=%d",num_layer_specs); + std::string layer_string = llformat("Clayers=%d",mLayers); codestream.access_siz()->parse_string(layer_string.c_str()); + base.setLayers(mLayers); // Set up data ordering, markers, etc... if precincts or blocks specified // Note: This code is *not* used in the encoding made by the viewer. It is currently used only @@ -718,7 +720,7 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co } // Produce the compressed output - codestream.flush(layer_bytes,num_layer_specs); + codestream.flush(layer_bytes,mLayers); // Cleanup delete tile; diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index 9ab0b9e4a7..fab97326d4 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -75,6 +75,7 @@ private: int mBlocksSize; int mPrecinctsSize; int mLevels; + int mLayers; // Temporary variables for in-progress decodes... LLImageRaw *mRawImagep; diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index feb6671e40..405f7c9388 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -146,6 +146,7 @@ void kdu_codestream::set_fast() { } void kdu_codestream::set_fussy() { } void kdu_codestream::get_dims(int, kdu_dims&, bool ) { } int kdu_codestream::get_min_dwt_levels() { return 5; } +int kdu_codestream::get_max_tile_layers() { return 1; } void kdu_codestream::change_appearance(bool, bool, bool) { } void kdu_codestream::get_tile_dims(kdu_coords, int, kdu_dims&, bool ) { } void kdu_codestream::destroy() { } -- cgit v1.2.3 From 7d739fbe5b5f53fdc9dc5bfc1358906cca44fc05 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 5 Apr 2012 14:25:21 -0400 Subject: SH-3064 WIP - accumulate stats tied to phase timers --- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llviewerstats.h | 2 +- indra/newview/llvoavatar.cpp | 106 +++++++++++++++++++++++++++++++++---- indra/newview/llvoavatar.h | 9 ++++ indra/newview/llvoavatarself.cpp | 18 +++---- 5 files changed, 116 insertions(+), 21 deletions(-) mode change 100644 => 100755 indra/newview/llviewerstats.h (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 843fe8ef5e..5bfcace707 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -952,7 +952,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs if (isAgentAvatarValid()) { - gAgentAvatarp->clearPhases(); // reset phase timers for outfit loading. + //gAgentAvatarp->clearPhases(); // reset phase timers for outfit loading. gAgentAvatarp->startPhase("process_initial_wearables_update"); gAgentAvatarp->outputRezTiming("Received initial wearables update"); } diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h old mode 100644 new mode 100755 index f91a1241fe..718fabc75a --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -244,7 +244,7 @@ public: inline F32 getStdDev() const { const F32 mean = getMean(); - return (mCount == 0) ? 0.f : sqrt( mSumOfSquares/mCount - (mean * mean) ); + return (mCount < 2) ? 0.f : sqrt(llmax(0.f,mSumOfSquares/mCount - (mean * mean))); } inline U32 getCount() const diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 58cabd1a24..abbe25175a 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -633,11 +633,11 @@ F32 LLVOAvatar::sLODFactor = 1.f; F32 LLVOAvatar::sPhysicsLODFactor = 1.f; BOOL LLVOAvatar::sUseImpostors = FALSE; BOOL LLVOAvatar::sJointDebug = FALSE; - F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; +LLVOAvatar::phase_stats_t LLVOAvatar::sPhaseStats; //----------------------------------------------------------------------------- // Helper functions @@ -696,7 +696,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mSupportsAlphaLayers(FALSE), mLoadedCallbacksPaused(FALSE), mHasPelvisOffset( FALSE ), - mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar")) + mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar")), + mLastRezzedStatus(-1) + { LLMemType mt(LLMemType::MTYPE_AVATAR); //VTResume(); // VTune @@ -793,12 +795,6 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c << " : " << comment << llendl; - if (gAgentAvatarp && !gAgentAvatarp->isDead()) // not safe to call during ~LLVOAvatarself - { - LLSD metrics = gAgentAvatarp->metricsData(); - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << " metrics " << ll_pretty_print_sd(metrics) << LL_ENDL; - } - if (gSavedSettings.getBOOL("DebugAvatarRezTime")) { LLSD args; @@ -970,6 +966,7 @@ LLFrameTimer& LLVOAvatar::getPhaseTimer(const std::string& phase_name) void LLVOAvatar::startPhase(const std::string& phase_name) { LLFrameTimer& timer = getPhaseTimer(phase_name); + lldebugs << "startPhase " << phase_name << llendl; timer.unpause(); } @@ -978,8 +975,18 @@ void LLVOAvatar::stopPhase(const std::string& phase_name) phase_map_t::iterator iter = mPhases.find(phase_name); if (iter != mPhases.end()) { + if (iter->second.getStarted()) + { + // Going from started to paused state - record stats. + recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); + } + lldebugs << "stopPhase " << phase_name << llendl; iter->second.pause(); } + else + { + lldebugs << "stopPhase " << phase_name << " is not started, no-op" << llendl; + } } void LLVOAvatar::stopAllPhases() @@ -987,13 +994,23 @@ void LLVOAvatar::stopAllPhases() for (phase_map_t::iterator iter = mPhases.begin(); iter != mPhases.end(); ++iter) { + const std::string& phase_name = iter->first; + if (iter->second.getStarted()) + { + // Going from started to paused state - record stats. + recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); + } + lldebugs << "stopPhase (all) " << phase_name << llendl; iter->second.pause(); } } void LLVOAvatar::clearPhases() { + lldebugs << "clearPhases" << llendl; + mPhases.clear(); + mLastRezzedStatus = -1; } LLSD LLVOAvatar::dumpPhases() @@ -1001,12 +1018,39 @@ LLSD LLVOAvatar::dumpPhases() LLSD result; for (phase_map_t::iterator iter = mPhases.begin(); iter != mPhases.end(); ++iter) { - result[iter->first]["completed"] = !(iter->second.getStarted()); - result[iter->first]["elapsed"] = iter->second.getElapsedTimeF32(); + const std::string& phase_name = iter->first; + result[phase_name]["completed"] = !(iter->second.getStarted()); + result[phase_name]["elapsed"] = iter->second.getElapsedTimeF32(); +#if 0 // global stats for each phase seem like overkill here + phase_stats_t::iterator stats_iter = sPhaseStats.find(phase_name); + if (stats_iter != sPhaseStats.end()) + { + result[phase_name]["stats"] = stats_iter->second.getData(); + } +#endif } return result; } +// static +LLViewerStats::StatsAccumulator& LLVOAvatar::getPhaseStats(const std::string& phase_name) +{ + phase_stats_t::iterator it = sPhaseStats.find(phase_name); + if (it == sPhaseStats.end()) + { + LLViewerStats::StatsAccumulator new_stats; + sPhaseStats[phase_name] = new_stats; + } + return sPhaseStats[phase_name]; +} + +// static +void LLVOAvatar::recordPhaseStat(const std::string& phase_name, F32 value) +{ + LLViewerStats::StatsAccumulator& stats = getPhaseStats(phase_name); + stats.push(value); +} + void LLVOAvatar::deleteLayerSetCaches(bool clearAll) { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -6544,11 +6588,53 @@ BOOL LLVOAvatar::getIsCloud() const return FALSE; } +void LLVOAvatar::updateRezzedStatusTimers() +{ + // State machine for rezzed status. Statuses are 0 = cloud, 1 = gray, 2 = textured. + // Purpose is to collect time data for each period of cloud or cloud+gray. + S32 rez_status = getRezzedStatus(); + if (rez_status != mLastRezzedStatus) + { + llinfos << avString() << "zxx rez state change: " << mLastRezzedStatus << " -> " << rez_status << llendl; + bool is_cloud_or_gray = (rez_status==0 || rez_status==1); + bool was_cloud_or_gray = (mLastRezzedStatus==0 || mLastRezzedStatus==1); + bool is_cloud = (rez_status==0); + bool was_cloud = (mLastRezzedStatus==0); + + // Non-cloud to cloud + if (is_cloud && !was_cloud) + { + // start cloud timer. + startPhase("cloud"); + } + else if (was_cloud && !is_cloud) + { + // stop cloud timer, which will capture stats. + stopPhase("cloud"); + } + + // Non-cloud-or-gray to cloud-or-gray + if (is_cloud_or_gray && !was_cloud_or_gray) + { + // start cloud-or-gray timer. + startPhase("cloud-or-gray"); + } + else if (was_cloud_or_gray && !is_cloud_or_gray) + { + // stop cloud-or-gray timer, which will capture stats. + stopPhase("cloud-or-gray"); + } + + mLastRezzedStatus = rez_status; + } +} + // call periodically to keep isFullyLoaded up to date. // returns true if the value has changed. BOOL LLVOAvatar::updateIsFullyLoaded() { const BOOL loading = getIsCloud(); + updateRezzedStatusTimers(); updateRuthTimer(loading); return processFullyLoadedChange(loading); } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 04ef8d2014..7a1b780862 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -48,6 +48,7 @@ #include "lltexglobalcolor.h" #include "lldriverparam.h" #include "material_codes.h" // LL_MCODE_END +#include "llviewerstats.h" extern const LLUUID ANIM_AGENT_BODY_NOISE; extern const LLUUID ANIM_AGENT_BREATHE_ROT; @@ -282,6 +283,9 @@ public: BOOL isFullyTextured() const; BOOL hasGray() const; S32 getRezzedStatus() const; // 0 = cloud, 1 = gray, 2 = fully textured. + void updateRezzedStatusTimers(); + + S32 mLastRezzedStatus; // Tracking progress of active/completed phases for activities like outfit changing. LLFrameTimer& getPhaseTimer(const std::string& phase_name); @@ -290,6 +294,8 @@ public: void stopAllPhases(); void clearPhases(); LLSD dumpPhases(); + static LLViewerStats::StatsAccumulator& getPhaseStats(const std::string& phase_name); + static void recordPhaseStat(const std::string& phase_name, F32 value); class ScopedPhaseSetter { @@ -323,8 +329,11 @@ private: LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; + // TODO move all the phase stuff to its down data structure. typedef std::map phase_map_t; phase_map_t mPhases; + typedef std::map phase_stats_t; + static phase_stats_t sPhaseStats; protected: LLFrameTimer mInvisibleTimer; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index c593481b40..5ba5ec8ef5 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2430,11 +2430,11 @@ void LLVOAvatarSelf::outputRezDiagnostics() const } const F32 final_time = mDebugSelfLoadTimer.getElapsedTimeF32(); - llinfos << "REZTIME: Myself rez stats:" << llendl; - llinfos << "\t Time from avatar creation to load wearables: " << (S32)mDebugTimeWearablesLoaded << llendl; - llinfos << "\t Time from avatar creation to de-cloud: " << (S32)mDebugTimeAvatarVisible << llendl; - llinfos << "\t Time from avatar creation to de-cloud for others: " << (S32)final_time << llendl; - llinfos << "\t Load time for each texture: " << llendl; + LL_DEBUGS("Avatar") << "REZTIME: Myself rez stats:" << llendl; + LL_DEBUGS("Avatar") << "\t Time from avatar creation to load wearables: " << (S32)mDebugTimeWearablesLoaded << llendl; + 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) { std::stringstream out; @@ -2458,12 +2458,12 @@ void LLVOAvatarSelf::outputRezDiagnostics() const // Don't print out non-existent textures. if (j != 0) - llinfos << out.str() << llendl; + LL_DEBUGS("Avatar") << out.str() << llendl; } - llinfos << "\t Time points for each upload (start / finish)" << llendl; + LL_DEBUGS("Avatar") << "\t Time points for each upload (start / finish)" << llendl; for (U32 i = 0; i < LLVOAvatarDefines::BAKED_NUM_INDICES; ++i) { - llinfos << "\t\t (" << i << ") \t" << (S32)mDebugBakedTextureTimes[i][0] << " / " << (S32)mDebugBakedTextureTimes[i][1] << llendl; + 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(); @@ -2475,7 +2475,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const if (!layerset) continue; const LLTexLayerSetBuffer *layerset_buffer = layerset->getComposite(); if (!layerset_buffer) continue; - llinfos << layerset_buffer->dumpTextureInfo() << llendl; + LL_DEBUGS("Avatar") << layerset_buffer->dumpTextureInfo() << llendl; } } -- cgit v1.2.3 From 91094d92a75b3900be15bfb8be4b9f7cc072487b Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 5 Apr 2012 22:05:00 -0700 Subject: SH-3060 : Implement new byte range computation, cleaned up use of compression rate as well. --- indra/llimage/llimage.cpp | 3 +- indra/llimage/llimage.h | 4 +-- indra/llimage/llimagej2c.cpp | 55 +++++++++++++++++------------------ indra/llimage/llimagej2c.h | 7 +++-- indra/llkdu/llimagej2ckdu.cpp | 44 +++++++++------------------- indra/llkdu/llimagej2ckdu.h | 1 - indra/newview/lltexlayer.cpp | 1 - indra/newview/llviewertexturelist.cpp | 1 - 8 files changed, 46 insertions(+), 70 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index cce03ff6e6..7f95441075 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -1337,8 +1337,7 @@ LLImageFormatted::LLImageFormatted(S8 codec) mDecoding(0), mDecoded(0), mDiscardLevel(-1), - mLevels(0), - mLayers(0) + mLevels(0) { mMemType = LLMemType::MTYPE_IMAGEFORMATTED; } diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index c5a7d6262e..a643e4d9f5 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -62,6 +62,7 @@ const S32 MAX_IMAGE_DATA_SIZE = MAX_IMAGE_AREA * MAX_IMAGE_COMPONENTS; //2048 * // *TODO: change both to 1024 when SIM texture fetching is deprecated const S32 FIRST_PACKET_SIZE = 600; const S32 MAX_IMG_PACKET_SIZE = 1000; +const S32 HTTP_PACKET_SIZE = 1496; // Base classes for images. // There are two major parts for the image: @@ -320,8 +321,6 @@ public: S8 getDiscardLevel() const { return mDiscardLevel; } S8 getLevels() const { return mLevels; } void setLevels(S8 nlevels) { mLevels = nlevels; } - S32 getLayers() const { return mLayers; } - void setLayers(S32 nlayers) { mLayers = nlayers; } // setLastError needs to be deferred for J2C images since it may be called from a DLL virtual void resetLastError(); @@ -336,7 +335,6 @@ protected: S8 mDecoded; // unused, but changing LLImage layout requires recompiling static Mac/Linux libs. 2009-01-30 JC S8 mDiscardLevel; // Current resolution level worked on. 0 = full res, 1 = half res, 2 = quarter res, etc... S8 mLevels; // Number of resolution levels in that image. Min is 1. 0 means unknown. - S32 mLayers; // Number of quality layers in that image. Min is 1. 0 means unknown. public: static S32 sGlobalFormattedMemory; diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index dc5bd8b5d5..7894de0de5 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -56,10 +56,9 @@ std::string LLImageJ2C::getEngineInfo() LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), mMaxBytes(0), mRawDiscardLevel(-1), - mRate(0.0f), + mRate(DEFAULT_COMPRESSION_RATE), mReversible(FALSE), - mAreaUsedForDataSizeCalcs(0), - mLayersUsedForDataSizeCalcs(0) + mAreaUsedForDataSizeCalcs(0) { mImpl = fallbackCreateLLImageJ2CImpl(); @@ -257,33 +256,40 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, //static S32 LLImageJ2C::calcHeaderSizeJ2C() { - return FIRST_PACKET_SIZE; // Hack. just needs to be >= actual header size... + return HTTP_PACKET_SIZE; // Hack. just needs to be >= actual header size... } //static -S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, S32 nb_layers, F32 rate) +S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate) { - // Note: This provides an estimation for the first quality layer of a given discard level + // Note: This provides an estimation for the first to last quality layer of a given discard level // This is however an efficient approximation, as the true discard level boundary would be // in general too big for fast fetching. // For details about the equation used here, see https://wiki.lindenlab.com/wiki/THX1138_KDU_Improvements#Byte_Range_Study - if (rate <= 0.f) rate = 1.f/8.f; - // Compute w/pow(2,discard_level) and h/pow(2,discard_level) - while (discard_level > 0) + + // Estimate the number of layers. This is consistent with what's done in j2c encoding + S32 nb_layers = 1; + S32 surface = w*h; + S32 s = 64*64; + while (surface > s) { - if (w < 1 || h < 1) - break; - w >>= 1; - h >>= 1; - discard_level--; + nb_layers++; + s *= 4; } + F32 layer_factor = 3.0f * (7 - llclamp(nb_layers,1,6)); + + // Compute w/pow(2,discard_level) and h/pow(2,discard_level) + w >>= discard_level; + h >>= discard_level; + w = llmax(w, 1); + h = llmax(h, 1); + // Temporary: compute both new and old range and pick one according to the settings TextureNewByteRange // *TODO: Take the old code out once we have enough tests done S32 bytes; - F32 layer_factor = ((nb_layers > 0) && (nb_layers < 7) ? 3.0f * (7 - nb_layers): 3.0f); S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor; S32 old_bytes = (S32)((F32)(w*h*comp)*rate); - llinfos << "Merov debug : calcDataSizeJ2C, layers = " << nb_layers << ", old = " << old_bytes << ", new = " << new_bytes << llendl; + //llinfos << "Merov debug : w = " << w << ", h = " << h << ", c = " << comp << ", r = " << rate << ", d = " << discard_level << ", l = " << nb_layers << ", old = " << old_bytes << ", new = " << new_bytes << llendl; bytes = (LLImage::useNewByteRange() ? new_bytes : old_bytes); bytes = llmax(bytes, calcHeaderSizeJ2C()); return bytes; @@ -298,26 +304,22 @@ S32 LLImageJ2C::calcHeaderSize() S32 LLImageJ2C::calcDataSize(S32 discard_level) { discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL); - + return calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), discard_level, mRate); + /* if ( mAreaUsedForDataSizeCalcs != (getHeight() * getWidth()) - || (mLayersUsedForDataSizeCalcs != getLayers()) || (mDataSizes[0] == 0)) { - if (mLayersUsedForDataSizeCalcs != getLayers()) - { - llinfos << "Merov debug : recomputing data size because " << mLayersUsedForDataSizeCalcs << " != " << getLayers() << llendl; - } mAreaUsedForDataSizeCalcs = getHeight() * getWidth(); - mLayersUsedForDataSizeCalcs = getLayers(); S32 level = MAX_DISCARD_LEVEL; // Start at the highest discard while ( level >= 0 ) { - mDataSizes[level] = calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), level, getLayers(), mRate); + mDataSizes[level] = calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), level, mRate); level--; } } return mDataSizes[discard_level]; + */ } S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes) @@ -344,11 +346,6 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes) return discard_level; } -void LLImageJ2C::setRate(F32 rate) -{ - mRate = rate; -} - void LLImageJ2C::setMaxBytes(S32 max_bytes) { mMaxBytes = max_bytes; diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 28e3026aac..91c344d12f 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -31,6 +31,9 @@ #include "llassettype.h" #include "llmetricperformancetester.h" +// JPEG2000 : compression rate used in j2c conversion. +const F32 DEFAULT_COMPRESSION_RATE = 1.f/8.f; + class LLImageJ2CImpl; class LLImageCompressionTester ; @@ -67,12 +70,11 @@ public: // Encode accessors void setReversible(const BOOL reversible); // Use non-lossy? - void setRate(F32 rate); void setMaxBytes(S32 max_bytes); S32 getMaxBytes() const { return mMaxBytes; } static S32 calcHeaderSizeJ2C(); - static S32 calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, S32 nb_layers = 0, F32 rate = 0.f); + static S32 calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 rate = DEFAULT_COMPRESSION_RATE); static std::string getEngineInfo(); @@ -88,7 +90,6 @@ protected: S32 mDataSizes[MAX_DISCARD_LEVEL+1]; // Size of data required to reach a given level U32 mAreaUsedForDataSizeCalcs; // Height * width used to calculate mDataSizes - S32 mLayersUsedForDataSizeCalcs; // Numbers of layers used to calculate mDataSizes S8 mRawDiscardLevel; F32 mRate; diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 08d840917d..31db9d48e3 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -195,8 +195,7 @@ mRawImagep(NULL), mDecodeState(NULL), mBlocksSize(-1), mPrecinctsSize(-1), -mLevels(0), -mLayers(0) +mLevels(0) { } @@ -472,13 +471,6 @@ BOOL LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco { kdu_tile tile = mCodeStreamp->open_tile(*(mTPosp)+mTileIndicesp->pos); - int layers = mCodeStreamp->get_max_tile_layers(); - if (layers > mLayers) - { - mLayers = layers; - base.setLayers(mLayers); - } - // Find the region of the buffer occupied by this // tile. Note that we have no control over // sub-sampling factors which might have been used @@ -608,21 +600,14 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co } // Set codestream options - mLayers = 0; + int nb_layers = 0; kdu_long layer_bytes[MAX_NB_LAYERS]; U32 max_bytes = (U32)(base.getWidth() * base.getHeight() * base.getComponents()); - // Rate is the argument passed into the LLImageJ2C which - // specifies the target compression rate. The default is 8:1. - // *TODO: mRate is actually always 8:1 in the viewer. Test different values. Also force to reversible for small (< 500 bytes) textures. - if (base.mRate != 0.f) - { - max_bytes = (U32)((F32)(max_bytes) * base.mRate); - } - else - { - max_bytes = (U32)((F32)(max_bytes) / 8.0f); - } + // Rate is the argument passed into the LLImageJ2C which specifies the target compression rate. The default is 8:1. + // *TODO: mRate is actually always 8:1 in the viewer. Test different values. + llassert (base.mRate > 0.f); + max_bytes = (U32)((F32)(max_bytes) * base.mRate); // If the image is very small, code it in a lossless way. // Note: it'll also have only 1 layer which is fine as there's no point reordering blocks in that case. @@ -635,15 +620,15 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co // We're using a logarithmic spacing rule that fits with our way of fetching texture data. // Note: For more info on this layers business, read kdu_codestream::flush() doc in kdu_compressed.h U32 i = FIRST_PACKET_SIZE; - while ((i < max_bytes) && (mLayers < (MAX_NB_LAYERS-1))) + while ((i < max_bytes) && (nb_layers < (MAX_NB_LAYERS-1))) { if (i == FIRST_PACKET_SIZE * 4) { // That really just means that the first layer is FIRST_PACKET_SIZE and the second is MIN_LAYER_SIZE i = MIN_LAYER_SIZE; } - layer_bytes[mLayers] = i; - mLayers++; + layer_bytes[nb_layers] = i; + nb_layers++; i *= 4; } @@ -656,18 +641,17 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co //codestream.access_siz()->parse_string("Cycc=no"); // In the reversible case, set the last entry of that table to 0 so that all generated bits will // indeed be output by the time the last quality layer is encountered. - layer_bytes[mLayers] = 0; + layer_bytes[nb_layers] = 0; } else { // Truncate the last quality layer if necessary so to fit the set compression ratio - layer_bytes[mLayers] = max_bytes; + layer_bytes[nb_layers] = max_bytes; } - mLayers++; + nb_layers++; - std::string layer_string = llformat("Clayers=%d",mLayers); + std::string layer_string = llformat("Clayers=%d",nb_layers); codestream.access_siz()->parse_string(layer_string.c_str()); - base.setLayers(mLayers); // Set up data ordering, markers, etc... if precincts or blocks specified // Note: This code is *not* used in the encoding made by the viewer. It is currently used only @@ -720,7 +704,7 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co } // Produce the compressed output - codestream.flush(layer_bytes,mLayers); + codestream.flush(layer_bytes,nb_layers); // Cleanup delete tile; diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index fab97326d4..9ab0b9e4a7 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -75,7 +75,6 @@ private: int mBlocksSize; int mPrecinctsSize; int mLevels; - int mLayers; // Temporary variables for in-progress decodes... LLImageRaw *mRawImagep; diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 1693cfc9e2..467115c928 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -497,7 +497,6 @@ void LLTexLayerSetBuffer::doUpload() } LLPointer compressedImage = new LLImageJ2C; - compressedImage->setRate(0.f); const char* comment_text = LINDEN_J2C_COMMENT_PREFIX "RGBHM"; // writes into baked_color_data. 5 channels (rgb, heightfield/alpha, mask) if (compressedImage->encode(baked_image, comment_text)) { diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 089f45ca89..54ae519422 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -1030,7 +1030,6 @@ LLPointer LLViewerTextureList::convertToUploadFile(LLPointerbiasedScaleToPowerOfTwo(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT); LLPointer compressedImage = new LLImageJ2C(); - compressedImage->setRate(0.f); if (gSavedSettings.getBOOL("LosslessJ2CUpload") && (raw_image->getWidth() * raw_image->getHeight() <= LL_IMAGE_REZ_LOSSLESS_CUTOFF * LL_IMAGE_REZ_LOSSLESS_CUTOFF)) -- cgit v1.2.3 From bb7b5b27cedaa189aa2db6bb6b272c969923d8e2 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 6 Apr 2012 16:17:38 -0700 Subject: SH-3060 : Fix kdu unit test I broke while changing mRate init policy --- indra/llkdu/tests/llimagej2ckdu_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp index 405f7c9388..beee99a522 100644 --- a/indra/llkdu/tests/llimagej2ckdu_test.cpp +++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp @@ -87,7 +87,7 @@ void LLImageFormatted::resetLastError() { } void LLImageFormatted::sanityCheck() { } void LLImageFormatted::setLastError(const std::string& , const std::string& ) { } -LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C) { } +LLImageJ2C::LLImageJ2C() : LLImageFormatted(IMG_CODEC_J2C), mRate(DEFAULT_COMPRESSION_RATE) { } LLImageJ2C::~LLImageJ2C() { } S32 LLImageJ2C::calcDataSize(S32 ) { return 0; } S32 LLImageJ2C::calcDiscardLevelBytes(S32 ) { return 0; } -- cgit v1.2.3 From 172b45d5a217c7cdb922f49706b310edc412fc28 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 6 Apr 2012 18:28:47 -0700 Subject: SH-3060 : Complete new byte range computation, clean up and back pedal on some changes that didn't pay of. --- indra/llimage/llimagej2c.cpp | 11 ++++------- indra/llkdu/llimagej2ckdu.cpp | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 7894de0de5..69d261c9a6 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -256,7 +256,7 @@ BOOL LLImageJ2C::encode(const LLImageRaw *raw_imagep, const char* comment_text, //static S32 LLImageJ2C::calcHeaderSizeJ2C() { - return HTTP_PACKET_SIZE; // Hack. just needs to be >= actual header size... + return FIRST_PACKET_SIZE; // Hack. just needs to be >= actual header size... } //static @@ -267,7 +267,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r // in general too big for fast fetching. // For details about the equation used here, see https://wiki.lindenlab.com/wiki/THX1138_KDU_Improvements#Byte_Range_Study - // Estimate the number of layers. This is consistent with what's done in j2c encoding + // Estimate the number of layers. This is consistent with what's done for j2c encoding in LLImageJ2CKDU::encodeImpl(). S32 nb_layers = 1; S32 surface = w*h; S32 s = 64*64; @@ -304,8 +304,6 @@ S32 LLImageJ2C::calcHeaderSize() S32 LLImageJ2C::calcDataSize(S32 discard_level) { discard_level = llclamp(discard_level, 0, MAX_DISCARD_LEVEL); - return calcDataSizeJ2C(getWidth(), getHeight(), getComponents(), discard_level, mRate); - /* if ( mAreaUsedForDataSizeCalcs != (getHeight() * getWidth()) || (mDataSizes[0] == 0)) { @@ -319,7 +317,6 @@ S32 LLImageJ2C::calcDataSize(S32 discard_level) } } return mDataSizes[discard_level]; - */ } S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes) @@ -332,8 +329,8 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes) } while (1) { - S32 bytes_needed = calcDataSize(discard_level); - if (bytes >= bytes_needed) + S32 bytes_needed = calcDataSize(discard_level); // virtual + if (bytes >= bytes_needed - (bytes_needed>>2)) // For J2c, up the res at 75% of the optimal number of bytes { break; } diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 31db9d48e3..cbfc34ebb8 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -393,7 +393,7 @@ BOOL LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco region_kdu->size.y = region[3] - region[1]; } int discard = (discard_level != -1 ? discard_level : base.getRawDiscardLevel()); - llinfos << "Merov debug : initDecode, discard used = " << discard << ", asked = " << discard_level << llendl; + //llinfos << "Merov debug : initDecode, discard used = " << discard << ", asked = " << discard_level << llendl; // Apply loading restrictions mCodeStreamp->apply_input_restrictions( first_channel, max_channel_count, discard, 0, region_kdu); -- cgit v1.2.3 From e4cced82343391292e61db03bb019e19827834c7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 9 Apr 2012 17:57:50 -0400 Subject: SH-3064 FIX - added cloud and cloud-or-gray stats to summary metrics. Moved summary metrics out of per-region info. Removed phase stats from avatar appearance change msg. --- indra/newview/llviewerassetstats.cpp | 27 +++++++++++++------- indra/newview/llviewerassetstats.h | 9 ++++--- indra/newview/llvoavatar.cpp | 2 +- indra/newview/llvoavatar.h | 5 +++- indra/newview/tests/llviewerassetstats_test.cpp | 33 +++++++++++++++++-------- 5 files changed, 52 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index 9e627a5c61..f408d06f4c 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -160,7 +160,9 @@ LLViewerAssetStats::LLViewerAssetStats() LLViewerAssetStats::LLViewerAssetStats(const LLViewerAssetStats & src) : mRegionHandle(src.mRegionHandle), - mResetTimestamp(src.mResetTimestamp) + mResetTimestamp(src.mResetTimestamp), + mPhaseStats(src.mPhaseStats), + mAvatarRezStates(src.mAvatarRezStates) { const PerRegionContainer::const_iterator it_end(src.mRegionStats.end()); for (PerRegionContainer::const_iterator it(src.mRegionStats.begin()); it_end != it; ++it) @@ -261,7 +263,10 @@ LLViewerAssetStats::recordAvatarStats() { std::vector rez_counts; LLVOAvatar::getNearbyRezzedStats(rez_counts); - mCurRegionStats->mAvatarRezStates = rez_counts; + mAvatarRezStates = rez_counts; + mPhaseStats.clear(); + mPhaseStats["cloud"] = LLVOAvatar::getPhaseStats("cloud"); + mPhaseStats["cloud-or-gray"] = LLVOAvatar::getPhaseStats("cloud-or-gray"); } LLSD @@ -297,6 +302,7 @@ LLViewerAssetStats::asLLSD(bool compact_output) // Avatar sub-tags static const LLSD::String avatar_tag("avatar"); static const LLSD::String avatar_nearby_tag("nearby"); + static const LLSD::String avatar_phase_stats_tag("phase_stats"); const duration_t now = LLViewerAssetStatsFF::get_timestamp(); mCurRegionStats->accumulateTime(now); @@ -345,13 +351,6 @@ LLViewerAssetStats::asLLSD(bool compact_output) slot[max_tag] = LLSD(F64(stats.mFPS.getMax())); slot[mean_tag] = LLSD(F64(stats.mFPS.getMean())); } - reg_stat[avatar_tag][avatar_nearby_tag] = LLSD::emptyArray(); - for (S32 rez_stat=0; rez_stat < stats.mAvatarRezStates.size(); ++rez_stat) - { - std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat); - reg_stat["nearby"][rez_status_name] = stats.mAvatarRezStates[rez_stat]; - } - U32 grid_x(0), grid_y(0); grid_from_region_handle(it->first, &grid_x, &grid_y); reg_stat["grid_x"] = LLSD::Integer(grid_x); @@ -363,6 +362,16 @@ LLViewerAssetStats::asLLSD(bool compact_output) LLSD ret = LLSD::emptyMap(); ret["regions"] = regions; ret["duration"] = LLSD::Real((now - mResetTimestamp) * 1.0e-6); + LLSD avatar_info; + avatar_info[avatar_nearby_tag] = LLSD::emptyArray(); + for (S32 rez_stat=0; rez_stat < mAvatarRezStates.size(); ++rez_stat) + { + std::string rez_status_name = LLVOAvatar::rezStatusToString(rez_stat); + avatar_info[avatar_nearby_tag][rez_status_name] = mAvatarRezStates[rez_stat]; + } + avatar_info[avatar_phase_stats_tag]["cloud"] = mPhaseStats["cloud"].getData(); + avatar_info[avatar_phase_stats_tag]["cloud-or-gray"] = mPhaseStats["cloud-or-gray"].getData(); + ret[avatar_tag] = avatar_info; return ret; } diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index 6cb0cc4060..4b278bc2a2 100755 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -36,6 +36,7 @@ #include "llviewerassetstorage.h" #include "llsimplestat.h" #include "llsd.h" +#include "llvoavatar.h" /** * @class LLViewerAssetStats @@ -125,8 +126,7 @@ public: mRegionHandle(src.mRegionHandle), mTotalTime(src.mTotalTime), mStartTimestamp(src.mStartTimestamp), - mFPS(src.mFPS), - mAvatarRezStates(src.mAvatarRezStates) + mFPS(src.mFPS) { for (int i = 0; i < LL_ARRAY_SIZE(mRequests); ++i) { @@ -149,7 +149,6 @@ public: duration_t mTotalTime; duration_t mStartTimestamp; LLSimpleStatMMM<> mFPS; - std::vector mAvatarRezStates; struct prs_group { @@ -257,6 +256,10 @@ protected: // Time of last reset duration_t mResetTimestamp; + + // Nearby avatar stats + std::vector mAvatarRezStates; + LLVOAvatar::phase_stats_t mPhaseStats; }; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index abbe25175a..46805ec0c6 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6595,7 +6595,7 @@ void LLVOAvatar::updateRezzedStatusTimers() S32 rez_status = getRezzedStatus(); if (rez_status != mLastRezzedStatus) { - llinfos << avString() << "zxx rez state change: " << mLastRezzedStatus << " -> " << rez_status << llendl; + llinfos << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << llendl; bool is_cloud_or_gray = (rez_status==0 || rez_status==1); bool was_cloud_or_gray = (mLastRezzedStatus==0 || mLastRezzedStatus==1); bool is_cloud = (rez_status==0); diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 7a1b780862..8b72682040 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -330,9 +330,12 @@ private: LLFrameTimer mRuthTimer; // TODO move all the phase stuff to its down data structure. +public: + typedef std::map phase_stats_t; typedef std::map phase_map_t; + +private: phase_map_t mPhases; - typedef std::map phase_stats_t; static phase_stats_t sPhaseStats; protected: diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 56d2004c17..356c5b8261 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -45,6 +45,12 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) counts[2] = 1; } +LLViewerStats::StatsAccumulator& LLVOAvatar::getPhaseStats(const std::string& phase_name) +{ + static std::map stats_map; + return stats_map[phase_name]; +} + // static std::string LLVOAvatar::rezStatusToString(S32 rez_status) { @@ -130,10 +136,17 @@ is_double_key_map(const LLSD & sd, const std::string & key1, const std::string & return sd.isMap() && 2 == sd.size() && sd.has(key1) && sd.has(key2); } +static bool +is_triple_key_map(const LLSD & sd, const std::string & key1, const std::string & key2, const std::string& key3) +{ + return sd.isMap() && 3 == sd.size() && sd.has(key1) && sd.has(key2) && sd.has(key3); +} + + static bool is_no_stats_map(const LLSD & sd) { - return is_double_key_map(sd, "duration", "regions"); + return is_triple_key_map(sd, "duration", "regions", "avatar"); } static bool @@ -244,7 +257,7 @@ namespace tut // Once the region is set, we will get a response even with no data collection it->setRegion(region1_handle); sd_full = it->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd_full, "duration", "regions")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd_full, "duration", "regions", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd_full["regions"], region1_handle)); LLSD sd = sd_full["regions"][0]; @@ -285,7 +298,7 @@ namespace tut it->setRegion(region1_handle); LLSD sd = it->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = sd[0]; @@ -310,7 +323,7 @@ namespace tut LLViewerAssetStatsFF::record_dequeue_main(LLViewerAssetType::AT_BODYPART, false, false); LLSD sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = sd["regions"][0]; @@ -350,7 +363,7 @@ namespace tut LLSD sd = gViewerAssetStatsThread1->asLLSD(false); ensure("Other collector is empty", is_no_stats_map(sd)); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = sd["regions"][0]; @@ -400,7 +413,7 @@ namespace tut // std::cout << sd << std::endl; - ensure("Correct double-key LLSD map root", is_double_key_map(sd, "duration", "regions")); + ensure("Correct double-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar")); ensure("Correct double-slot LLSD array regions", is_double_slot_array(sd["regions"], region1_handle, region2_handle)); LLSD sd1 = get_region(sd, region1_handle); LLSD sd2 = get_region(sd, region2_handle); @@ -423,7 +436,7 @@ namespace tut // Reset leaves current region in place gViewerAssetStatsMain->reset(); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle)); sd2 = sd["regions"][0]; @@ -472,7 +485,7 @@ namespace tut LLSD sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct double-key LLSD map root", is_double_key_map(sd, "duration", "regions")); + ensure("Correct double-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar")); ensure("Correct double-slot LLSD array regions", is_double_slot_array(sd["regions"], region1_handle, region2_handle)); LLSD sd1 = get_region(sd, region1_handle); LLSD sd2 = get_region(sd, region2_handle); @@ -495,7 +508,7 @@ namespace tut // Reset leaves current region in place gViewerAssetStatsMain->reset(); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "duration", "regions")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "duration", "regions", "avatar")); ensure("Correct single-slot LLSD array regions (p2)", is_single_slot_array(sd["regions"], region2_handle)); sd2 = get_region(sd, region2_handle); ensure("Region2 is present in results", sd2.isMap()); @@ -541,7 +554,7 @@ namespace tut LLSD sd = gViewerAssetStatsThread1->asLLSD(false); ensure("Other collector is empty", is_no_stats_map(sd)); sd = gViewerAssetStatsMain->asLLSD(false); - ensure("Correct single-key LLSD map root", is_double_key_map(sd, "regions", "duration")); + ensure("Correct single-key LLSD map root", is_triple_key_map(sd, "regions", "duration", "avatar")); ensure("Correct single-slot LLSD array regions", is_single_slot_array(sd["regions"], region1_handle)); sd = get_region(sd, region1_handle); ensure("Region1 is present in results", sd.isMap()); -- cgit v1.2.3 From 724863423142b55d536bd40c12d8a203a6de2468 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 9 Apr 2012 18:35:28 -0400 Subject: possible fix for linux build failure --- indra/newview/tests/llviewerassetstats_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 356c5b8261..952f0f1a6e 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -128,13 +128,13 @@ is_single_key_map(const LLSD & sd, const std::string & key) { return sd.isMap() && 1 == sd.size() && sd.has(key); } -#endif static bool is_double_key_map(const LLSD & sd, const std::string & key1, const std::string & key2) { return sd.isMap() && 2 == sd.size() && sd.has(key1) && sd.has(key2); } +#endif static bool is_triple_key_map(const LLSD & sd, const std::string & key1, const std::string & key2, const std::string& key3) -- cgit v1.2.3 From ac50379957b3f8bf03f0604dc3319c14e73ce657 Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 12 Apr 2012 11:55:37 -0700 Subject: SH-3065 FIX Investigate fixes for out-of-order operations on startup Reviewed by Simon --- indra/newview/llavatarpropertiesprocessor.cpp | 9 +++++++++ indra/newview/lltexturefetch.cpp | 9 ++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index b1cd83a1fb..706bc42ea0 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -33,6 +33,7 @@ #include "llagentpicksinfo.h" #include "lldateutil.h" #include "llviewergenericmessage.h" +#include "llstartup.h" // Linden library includes #include "llavatarconstants.h" // AVATAR_TRANSACTED, etc. @@ -113,6 +114,14 @@ void LLAvatarPropertiesProcessor::sendGenericRequest(const LLUUID& avatar_id, EA void LLAvatarPropertiesProcessor::sendAvatarPropertiesRequest(const LLUUID& avatar_id) { + // this is the startup state when send_complete_agent_movement() message is sent. + // Before this, the AvatarPropertiesRequest message + // won't work so don't bother trying + if (LLStartUp::getStartupState() <= STATE_AGENT_SEND) + { + return; + } + if (isPendingRequest(avatar_id, APT_PROPERTIES)) { // waiting for a response, don't re-request diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index e27ebf9018..5cc8de3d91 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -53,6 +53,7 @@ #include "llviewerassetstats.h" #include "llworld.h" #include "llsdutil.h" +#include "llstartup.h" LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128); LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128); @@ -2238,7 +2239,13 @@ S32 LLTextureFetch::update(F32 max_time_ms) if (!mDebugPause) { - sendRequestListToSimulators(); + // this is the startup state when send_complete_agent_movement() message is sent. + // Before this, the RequestImages message sent by sendRequestListToSimulators + // won't work so don't bother trying + if (LLStartUp::getStartupState() > STATE_AGENT_SEND) + { + sendRequestListToSimulators(); + } } if (!mThreaded) -- cgit v1.2.3 From 0a42495906fdc56eeb118ac41ffa9ebcadc8de17 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 12 Apr 2012 15:50:25 -0600 Subject: for SH-3074: clear ghost and stale texture fetching requests in time --- indra/newview/lltexturefetch.cpp | 11 +++++++++++ indra/newview/llviewertexture.cpp | 11 +++++++++++ indra/newview/llviewertexture.h | 1 + indra/newview/llviewertexturelist.cpp | 25 +++++++++++++++++++++++++ indra/newview/llviewertexturelist.h | 2 ++ 5 files changed, 50 insertions(+) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 9ed6537b7a..3d8424e274 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -845,6 +845,8 @@ void LLTextureFetchWorker::startWork(S32 param) // Called from LLWorkerThread::processRequest() bool LLTextureFetchWorker::doWork(S32 param) { + static const F32 FETCHING_TIMEOUT = 120.f;//seconds + LLMutexLock lock(&mWorkMutex); if ((mFetcher->isQuitting() || getFlags(LLWorkerClass::WCF_DELETE_REQUESTED))) @@ -1187,6 +1189,8 @@ bool LLTextureFetchWorker::doWork(S32 param) bool res = false; if (!mUrl.empty()) { + mRequestedTimer.reset(); + mLoaded = FALSE; mGetStatus = 0; mGetReason.clear(); @@ -1345,6 +1349,13 @@ bool LLTextureFetchWorker::doWork(S32 param) } else { + if(FETCHING_TIMEOUT < mRequestedTimer.getElapsedTimeF32()) + { + //timeout, abort. + mState = DONE; + return true; + } + setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); return false; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 2efc9ad4d0..09f3db60f2 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2129,6 +2129,17 @@ bool LLViewerFetchedTexture::updateFetch() return mIsFetching ? true : false; } +void LLViewerFetchedTexture::forceToDeleteRequest() +{ + if (mHasFetcher) + { + LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); + mHasFetcher = FALSE; + mIsFetching = FALSE ; + resetTextureStats(); + } +} + void LLViewerFetchedTexture::setIsMissingAsset() { if (mUrl.empty()) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 99053a8ccc..80b0db2e4c 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -490,6 +490,7 @@ public: BOOL hasFetcher() const { return mHasFetcher;} void setCanUseHTTP(bool can_use_http) {mCanUseHTTP = can_use_http;} + void forceToDeleteRequest(); protected: /*virtual*/ void switchToCachedImage(); S32 getCurrentDiscardLevelForFetching() ; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 54ae519422..2008a884db 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -58,6 +58,7 @@ #include "pipeline.h" #include "llappviewer.h" #include "llxuiparser.h" +#include "llagent.h" //////////////////////////////////////////////////////////////////////////// @@ -597,6 +598,12 @@ static LLFastTimer::DeclareTimer FTM_IMAGE_STATS("Stats"); void LLViewerTextureList::updateImages(F32 max_time) { + if(gAgent.getTeleportState() != LLAgent::TELEPORT_NONE) + { + clearFetchingRequests(); + return; + } + LLAppViewer::getTextureFetch()->setTextureBandwidth(LLViewerStats::getInstance()->mTextureKBitStat.getMeanPerSec()); LLViewerStats::getInstance()->mNumImagesStat.addValue(sNumImages); @@ -659,6 +666,24 @@ void LLViewerTextureList::updateImages(F32 max_time) } } +void LLViewerTextureList::clearFetchingRequests() +{ + if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) + { + return; + } + + for (image_priority_list_t::iterator iter = mImageList.begin(); + iter != mImageList.end(); ++iter) + { + LLViewerFetchedTexture* image = *iter; + if(image->hasFetcher()) + { + image->forceToDeleteRequest() ; + } + } +} + void LLViewerTextureList::updateImagesDecodePriorities() { // Update the decode priority for N images each frame diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index e0a362596d..64e2c1f791 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -164,6 +164,8 @@ private: // Implemented in header in case someone changes default params above. JC LLViewerFetchedTexture* getImageFromHost(const LLUUID& image_id, LLHost host) { return getImage(image_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); } + + void clearFetchingRequests(); public: typedef std::set > image_list_t; -- cgit v1.2.3 From c410a4e3325350e3d9a72b867dcef44df9136f54 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 12 Apr 2012 20:19:56 -0700 Subject: SH-3080 : Implement the TextureReverseByteRange setting so we can play with that parameter --- indra/llimage/llimage.cpp | 4 +++- indra/llimage/llimage.h | 4 +++- indra/llimage/llimagej2c.cpp | 6 +++--- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llappviewer.cpp | 2 +- 5 files changed, 21 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 7f95441075..6775b005f4 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -49,12 +49,14 @@ std::string LLImage::sLastErrorMessage; LLMutex* LLImage::sMutex = NULL; bool LLImage::sUseNewByteRange = false; +S32 LLImage::sMinimalReverseByteRangePercent = 75; LLPrivateMemoryPool* LLImageBase::sPrivatePoolp = NULL ; //static -void LLImage::initClass(bool use_new_byte_range) +void LLImage::initClass(bool use_new_byte_range, S32 minimal_reverse_byte_range_percent) { sUseNewByteRange = use_new_byte_range; + sMinimalReverseByteRangePercent = minimal_reverse_byte_range_percent; sMutex = new LLMutex(NULL); LLImageBase::createPrivatePool() ; diff --git a/indra/llimage/llimage.h b/indra/llimage/llimage.h index a643e4d9f5..46e6d1a901 100644 --- a/indra/llimage/llimage.h +++ b/indra/llimage/llimage.h @@ -92,18 +92,20 @@ typedef enum e_image_codec class LLImage { public: - static void initClass(bool use_new_byte_range = false); + static void initClass(bool use_new_byte_range = false, S32 minimal_reverse_byte_range_percent = 75); static void cleanupClass(); static const std::string& getLastError(); static void setLastError(const std::string& message); static bool useNewByteRange() { return sUseNewByteRange; } + static S32 getReverseByteRangePercent() { return sMinimalReverseByteRangePercent; } protected: static LLMutex* sMutex; static std::string sLastErrorMessage; static bool sUseNewByteRange; + static S32 sMinimalReverseByteRangePercent; }; //============================================================================ diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 69d261c9a6..4c5c8a9c52 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -289,7 +289,6 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r S32 bytes; S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor; S32 old_bytes = (S32)((F32)(w*h*comp)*rate); - //llinfos << "Merov debug : w = " << w << ", h = " << h << ", c = " << comp << ", r = " << rate << ", d = " << discard_level << ", l = " << nb_layers << ", old = " << old_bytes << ", new = " << new_bytes << llendl; bytes = (LLImage::useNewByteRange() ? new_bytes : old_bytes); bytes = llmax(bytes, calcHeaderSizeJ2C()); return bytes; @@ -329,8 +328,9 @@ S32 LLImageJ2C::calcDiscardLevelBytes(S32 bytes) } while (1) { - S32 bytes_needed = calcDataSize(discard_level); // virtual - if (bytes >= bytes_needed - (bytes_needed>>2)) // For J2c, up the res at 75% of the optimal number of bytes + S32 bytes_needed = calcDataSize(discard_level); + // Use TextureReverseByteRange percent (see settings.xml) of the optimal size to qualify as correct rendering for the given discard level + if (bytes >= (bytes_needed*LLImage::getReverseByteRangePercent()/100)) { break; } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 5fc9c5d863..eff00b257c 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10719,6 +10719,17 @@ Value 2 + TextureReverseByteRange + + Comment + Minimal percent of the optimal byte range allowed to render a given discard level + Persist + 1 + Type + S32 + Value + 50 + ThrottleBandwidthKBPS Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1a68d0317e..37119f4451 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1947,7 +1947,7 @@ bool LLAppViewer::initThreads() static const bool enable_threads = true; #endif - LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange")); + LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getBOOL("TextureReverseByteRange")); LLVFSThread::initClass(enable_threads && false); LLLFSThread::initClass(enable_threads && false); -- cgit v1.2.3 From b4a3bb4f3b6247ebcd7d084df601ae77161664e1 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 12 Apr 2012 22:05:53 -0700 Subject: SH-3081 : Implement TextureCameraMotion settings as well as faster loading when the camera is still --- indra/newview/app_settings/settings.xml | 22 ++++++++++++++++++++++ indra/newview/llviewertexture.cpp | 22 ++++++++++++++++------ indra/newview/llviewertexture.h | 1 + 3 files changed, 39 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eff00b257c..eb3fcc30ee 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10631,6 +10631,28 @@ Value 20.0 + TextureCameraMotionThreshold + + Comment + If the overall motion is lower than this value, textures will be loaded faster + Persist + 1 + Type + F32 + Value + 0.2 + + TextureCameraMotionBoost + + Comment + Progressive discard level decrement when the camera is still + Persist + 1 + Type + S32 + Value + 3 + TextureDecodeDisabled Comment diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 2efc9ad4d0..508599e5ae 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -88,6 +88,7 @@ S32 LLViewerTexture::sMaxBoundTextureMemInMegaBytes = 0; S32 LLViewerTexture::sMaxTotalTextureMemInMegaBytes = 0; S32 LLViewerTexture::sMaxDesiredTextureMemInBytes = 0 ; S8 LLViewerTexture::sCameraMovingDiscardBias = 0 ; +F32 LLViewerTexture::sCameraMovingBias = 0.0f ; S32 LLViewerTexture::sMaxSculptRez = 128 ; //max sculpt image size const S32 MAX_CACHED_RAW_IMAGE_AREA = 64 * 64 ; const S32 MAX_CACHED_RAW_SCULPT_IMAGE_AREA = LLViewerTexture::sMaxSculptRez * LLViewerTexture::sMaxSculptRez ; @@ -546,7 +547,8 @@ void LLViewerTexture::updateClass(const F32 velocity, const F32 angular_velocity F32 camera_moving_speed = LLViewerCamera::getInstance()->getAverageSpeed() ; F32 camera_angular_speed = LLViewerCamera::getInstance()->getAverageAngularSpeed(); - sCameraMovingDiscardBias = (S8)llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1) ; + sCameraMovingBias = llmax(0.2f * camera_moving_speed, 2.0f * camera_angular_speed - 1); + sCameraMovingDiscardBias = (S8)(sCameraMovingBias); LLViewerTexture::sFreezeImageScalingDown = (BYTES_TO_MEGA_BYTES(sBoundTextureMemoryInBytes) < 0.75f * sMaxBoundTextureMemInMegaBytes * texmem_middle_bound_scale) && (BYTES_TO_MEGA_BYTES(sTotalTextureMemoryInBytes) < 0.75f * sMaxTotalTextureMemInMegaBytes * texmem_middle_bound_scale) ; @@ -1888,6 +1890,8 @@ S32 LLViewerFetchedTexture::getCurrentDiscardLevelForFetching() bool LLViewerFetchedTexture::updateFetch() { static LLCachedControl textures_decode_disabled(gSavedSettings,"TextureDecodeDisabled"); + static LLCachedControl sCameraMotionThreshold(gSavedSettings,"TextureCameraMotionThreshold"); + static LLCachedControl sCameraMotionBoost(gSavedSettings,"TextureCameraMotionBoost"); if(textures_decode_disabled) { return false ; @@ -2050,18 +2054,24 @@ bool LLViewerFetchedTexture::updateFetch() // make_request = false; //} - if(make_request) + if (make_request) { - //load the texture progressively. + // Load the texture progressively: we try not to rush to the desired discard too fast. + // If the camera is not moving, we do not tweak the discard level notch by notch but go to the desired discard with larger boosted steps + // This mitigates the "textures stay blurry" problem when loading while not killing the texture memory while moving around S32 delta_level = (mBoostLevel > LLViewerTexture::BOOST_NONE) ? 2 : 1 ; - if(current_discard < 0) + if (current_discard < 0) { desired_discard = llmax(desired_discard, getMaxDiscardLevel() - delta_level); } - else + else if (LLViewerTexture::sCameraMovingBias < sCameraMotionThreshold) { - desired_discard = llmax(desired_discard, current_discard - delta_level); + desired_discard = llmax(desired_discard, current_discard - sCameraMotionBoost); } + else + { + desired_discard = llmax(desired_discard, current_discard - delta_level); + } if (mIsFetching) { diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 99053a8ccc..bd85b491ad 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -324,6 +324,7 @@ public: static S32 sMaxTotalTextureMemInMegaBytes; static S32 sMaxDesiredTextureMemInBytes ; static S8 sCameraMovingDiscardBias; + static F32 sCameraMovingBias; static S32 sMaxSculptRez ; static S32 sMinLargeImageSize ; static S32 sMaxSmallImageSize ; -- cgit v1.2.3 From 7d8fdf9a85e176057422fcb20011287c1cb528ef Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 13 Apr 2012 12:09:37 -0700 Subject: SH-3080 : Fix wrong settings reading code (will crash on some machine) --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 40920dfd07..23c7b47860 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1945,7 +1945,7 @@ bool LLAppViewer::initThreads() static const bool enable_threads = true; #endif - LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getBOOL("TextureReverseByteRange")); + LLImage::initClass(gSavedSettings.getBOOL("TextureNewByteRange"),gSavedSettings.getS32("TextureReverseByteRange")); LLVFSThread::initClass(enable_threads && false); LLLFSThread::initClass(enable_threads && false); -- cgit v1.2.3 From 8778010feec5193c5ffc88d70e4a303aebaaaee4 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 13 Apr 2012 17:03:29 -0400 Subject: fix for linux build failure --- indra/llimage/llimagej2c.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 indra/llimage/llimagej2c.cpp (limited to 'indra') diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp old mode 100644 new mode 100755 index 69d261c9a6..4e08f09b4e --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -287,7 +287,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r // Temporary: compute both new and old range and pick one according to the settings TextureNewByteRange // *TODO: Take the old code out once we have enough tests done S32 bytes; - S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor; + S32 new_bytes = (S32) (sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor); S32 old_bytes = (S32)((F32)(w*h*comp)*rate); //llinfos << "Merov debug : w = " << w << ", h = " << h << ", c = " << comp << ", r = " << rate << ", d = " << discard_level << ", l = " << nb_layers << ", old = " << old_bytes << ", new = " << new_bytes << llendl; bytes = (LLImage::useNewByteRange() ? new_bytes : old_bytes); -- cgit v1.2.3 From 8b3703bd03487e6d70a793427ed1587b1cd86808 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Fri, 13 Apr 2012 15:42:54 -0700 Subject: SH-3060 : Always use old byte range on low res (faster), reserve new byte range for high res. --- indra/llimage/llimagej2c.cpp | 7 +++++-- indra/llimage/llimagej2c.h | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 4c5c8a9c52..a76734e550 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -289,7 +289,7 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r S32 bytes; S32 new_bytes = sqrt((F32)(w*h))*(F32)(comp)*rate*1000.f/layer_factor; S32 old_bytes = (S32)((F32)(w*h*comp)*rate); - bytes = (LLImage::useNewByteRange() ? new_bytes : old_bytes); + bytes = (LLImage::useNewByteRange() && (new_bytes < old_bytes) ? new_bytes : old_bytes); bytes = llmax(bytes, calcHeaderSizeJ2C()); return bytes; } @@ -473,6 +473,7 @@ LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTester mTotalTimeDecompression = 0.0f; mTotalTimeCompression = 0.0f; + mRunTimeDecompression = 0.0f; } LLImageCompressionTester::~LLImageCompressionTester() @@ -555,12 +556,14 @@ void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const mTotalBytesInDecompression += bytesIn; mRunBytesInDecompression += bytesIn; mTotalBytesOutDecompression += bytesOut; - if (mRunBytesInDecompression > (1000000)) + //if (mRunBytesInDecompression > (1000000)) + if ((mTotalTimeDecompression - mRunTimeDecompression) >= (5.0f)) { // Output everything outputTestResults(); // Reset the decompression data of the run mRunBytesInDecompression = 0; + mRunTimeDecompression = mTotalTimeDecompression; } } diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 91c344d12f..42093e0e64 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -163,6 +163,7 @@ class LLImageCompressionTester : public LLMetricPerformanceTesterBasic // F32 mTotalTimeDecompression; // Total time spent in computing decompression F32 mTotalTimeCompression; // Total time spent in computing compression + F32 mRunTimeDecompression; // Time in this run (we output every 5 sec in decompress) }; #endif -- cgit v1.2.3 From 7fbf42dec8bae638b62676c280b3f042f9458057 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Apr 2012 14:52:44 -0400 Subject: Move phase tracking to its own set of classes inside LLViewerStats - simplifies llvoavatar and allows adding such tracking to classes that live outside the avatar lifetime --- indra/newview/llagent.cpp | 4 +- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llagentwearablesfetch.cpp | 4 +- indra/newview/llstartup.cpp | 3 + indra/newview/llviewerassetstats.cpp | 4 +- indra/newview/llviewerassetstats.h | 2 +- indra/newview/llviewerstats.cpp | 107 +++++++++++++++++++++++ indra/newview/llviewerstats.h | 23 ++++- indra/newview/llvoavatar.cpp | 111 ++---------------------- indra/newview/llvoavatar.h | 50 +++++------ indra/newview/llvoavatarself.cpp | 11 +-- indra/newview/tests/llviewerassetstats_test.cpp | 13 +-- 12 files changed, 178 insertions(+), 156 deletions(-) mode change 100644 => 100755 indra/newview/llstartup.cpp mode change 100644 => 100755 indra/newview/llviewerstats.cpp (limited to 'indra') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index b1ece51439..5f07501983 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3785,8 +3785,8 @@ void LLAgent::sendAgentSetAppearance() if (!gAgentWearables.changeInProgress()) { // Change is fully resolved, can close some open phases. - gAgentAvatarp->stopPhase("process_initial_wearables_update"); - gAgentAvatarp->stopPhase("wear_inventory_category"); + gAgentAvatarp->getPhases().stopPhase("process_initial_wearables_update"); + gAgentAvatarp->getPhases().stopPhase("wear_inventory_category"); } gAgentAvatarp->sendAppearanceChangeMetrics(); diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 5bfcace707..0104d2b088 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -953,7 +953,7 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs if (isAgentAvatarValid()) { //gAgentAvatarp->clearPhases(); // reset phase timers for outfit loading. - gAgentAvatarp->startPhase("process_initial_wearables_update"); + gAgentAvatarp->getPhases().startPhase("process_initial_wearables_update"); gAgentAvatarp->outputRezTiming("Received initial wearables update"); } diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 2735c7ef39..e2417cdddb 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -89,7 +89,7 @@ LLInitialWearablesFetch::LLInitialWearablesFetch(const LLUUID& cof_id) : { if (isAgentAvatarValid()) { - gAgentAvatarp->startPhase("initial_wearables_fetch"); + gAgentAvatarp->getPhases().startPhase("initial_wearables_fetch"); gAgentAvatarp->outputRezTiming("Initial wearables fetch started"); } } @@ -108,7 +108,7 @@ void LLInitialWearablesFetch::done() doOnIdleOneTime(boost::bind(&LLInitialWearablesFetch::processContents,this)); if (isAgentAvatarValid()) { - gAgentAvatarp->stopPhase("initial_wearables_fetch"); + gAgentAvatarp->getPhases().stopPhase("initial_wearables_fetch"); gAgentAvatarp->outputRezTiming("Initial wearables fetch done"); } } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp old mode 100644 new mode 100755 index 3923b4510a..31343ee908 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2706,7 +2706,10 @@ void LLStartUp::setStartupState( EStartupState state ) LL_INFOS("AppInit") << "Startup state changing from " << getStartupStateString() << " to " << startupStateToString(state) << LL_ENDL; + + selfStopPhase(getStartupStateString()); gStartupState = state; + selfStartPhase(getStartupStateString()); postStartupState(); } diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index f408d06f4c..4c59fd0371 100755 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -265,8 +265,8 @@ LLViewerAssetStats::recordAvatarStats() LLVOAvatar::getNearbyRezzedStats(rez_counts); mAvatarRezStates = rez_counts; mPhaseStats.clear(); - mPhaseStats["cloud"] = LLVOAvatar::getPhaseStats("cloud"); - mPhaseStats["cloud-or-gray"] = LLVOAvatar::getPhaseStats("cloud-or-gray"); + mPhaseStats["cloud"] = LLViewerStats::PhaseMap::getPhaseStats("cloud"); + mPhaseStats["cloud-or-gray"] = LLViewerStats::PhaseMap::getPhaseStats("cloud-or-gray"); } LLSD diff --git a/indra/newview/llviewerassetstats.h b/indra/newview/llviewerassetstats.h index 4b278bc2a2..8319752230 100755 --- a/indra/newview/llviewerassetstats.h +++ b/indra/newview/llviewerassetstats.h @@ -259,7 +259,7 @@ protected: // Nearby avatar stats std::vector mAvatarRezStates; - LLVOAvatar::phase_stats_t mPhaseStats; + LLViewerStats::phase_stats_t mPhaseStats; }; diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp old mode 100644 new mode 100755 index c88122f22c..497e95c5e3 --- a/indra/newview/llviewerstats.cpp +++ b/indra/newview/llviewerstats.cpp @@ -860,3 +860,110 @@ void send_stats() LLHTTPClient::post(url, body, new ViewerStatsResponder()); } +LLFrameTimer& LLViewerStats::PhaseMap::getPhaseTimer(const std::string& phase_name) +{ + phase_map_t::iterator iter = mPhaseMap.find(phase_name); + if (iter == mPhaseMap.end()) + { + LLFrameTimer timer; + mPhaseMap[phase_name] = timer; + } + LLFrameTimer& timer = mPhaseMap[phase_name]; + return timer; +} + +void LLViewerStats::PhaseMap::startPhase(const std::string& phase_name) +{ + LLFrameTimer& timer = getPhaseTimer(phase_name); + lldebugs << "startPhase " << phase_name << llendl; + timer.unpause(); +} + +void LLViewerStats::PhaseMap::stopPhase(const std::string& phase_name) +{ + phase_map_t::iterator iter = mPhaseMap.find(phase_name); + if (iter != mPhaseMap.end()) + { + if (iter->second.getStarted()) + { + // Going from started to paused state - record stats. + recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); + } + lldebugs << "stopPhase " << phase_name << llendl; + iter->second.pause(); + } + else + { + lldebugs << "stopPhase " << phase_name << " is not started, no-op" << llendl; + } +} + +void LLViewerStats::PhaseMap::stopAllPhases() +{ + for (phase_map_t::iterator iter = mPhaseMap.begin(); + iter != mPhaseMap.end(); ++iter) + { + const std::string& phase_name = iter->first; + if (iter->second.getStarted()) + { + // Going from started to paused state - record stats. + recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); + } + lldebugs << "stopPhase (all) " << phase_name << llendl; + iter->second.pause(); + } +} + +void LLViewerStats::PhaseMap::clearPhases() +{ + lldebugs << "clearPhases" << llendl; + + mPhaseMap.clear(); +} + +LLSD LLViewerStats::PhaseMap::dumpPhases() +{ + LLSD result; + for (phase_map_t::iterator iter = mPhaseMap.begin(); iter != mPhaseMap.end(); ++iter) + { + const std::string& phase_name = iter->first; + result[phase_name]["completed"] = !(iter->second.getStarted()); + result[phase_name]["elapsed"] = iter->second.getElapsedTimeF32(); +#if 0 // global stats for each phase seem like overkill here + phase_stats_t::iterator stats_iter = sPhaseStats.find(phase_name); + if (stats_iter != sPhaseStats.end()) + { + result[phase_name]["stats"] = stats_iter->second.getData(); + } +#endif + } + return result; +} + +// static initializer +//static +LLViewerStats::phase_stats_t LLViewerStats::PhaseMap::sStats; + +LLViewerStats::PhaseMap::PhaseMap() +{ +} + +// static +LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name) +{ + phase_stats_t::iterator it = sStats.find(phase_name); + if (it == sStats.end()) + { + LLViewerStats::StatsAccumulator new_stats; + sStats[phase_name] = new_stats; + } + return sStats[phase_name]; +} + +// static +void LLViewerStats::PhaseMap::recordPhaseStat(const std::string& phase_name, F32 value) +{ + LLViewerStats::StatsAccumulator& stats = getPhaseStats(phase_name); + stats.push(value); +} + diff --git a/indra/newview/llviewerstats.h b/indra/newview/llviewerstats.h index 718fabc75a..750d963f69 100755 --- a/indra/newview/llviewerstats.h +++ b/indra/newview/llviewerstats.h @@ -274,7 +274,28 @@ public: }; StatsAccumulator mAgentPositionSnaps; - + + // Phase tracking (originally put in for avatar rezzing), tracking + // progress of active/completed phases for activities like outfit changing. + typedef std::map phase_map_t; + typedef std::map phase_stats_t; + class PhaseMap + { + private: + phase_map_t mPhaseMap; + static phase_stats_t sStats; + public: + PhaseMap(); + LLFrameTimer& getPhaseTimer(const std::string& phase_name); + void startPhase(const std::string& phase_name); + void stopPhase(const std::string& phase_name); + void stopAllPhases(); + void clearPhases(); + LLSD dumpPhases(); + static StatsAccumulator& getPhaseStats(const std::string& phase_name); + static void recordPhaseStat(const std::string& phase_name, F32 value); + }; + private: F64 mStats[ST_COUNT]; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 46805ec0c6..275c326ef6 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -637,7 +637,6 @@ F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; F32 LLVOAvatar::sGreyTime = 0.f; F32 LLVOAvatar::sGreyUpdateTime = 0.f; -LLVOAvatar::phase_stats_t LLVOAvatar::sPhaseStats; //----------------------------------------------------------------------------- // Helper functions @@ -867,7 +866,7 @@ LLVOAvatar::~LLVOAvatar() mAnimationSources.clear(); LLLoadedCallbackEntry::cleanUpCallbackList(&mCallbackTextureList) ; - clearPhases(); + getPhases().clearPhases(); lldebugs << "LLVOAvatar Destructor end" << llendl; } @@ -951,106 +950,6 @@ S32 LLVOAvatar::getRezzedStatus() const return 1; // gray } -LLFrameTimer& LLVOAvatar::getPhaseTimer(const std::string& phase_name) -{ - phase_map_t::iterator iter = mPhases.find(phase_name); - if (iter == mPhases.end()) - { - LLFrameTimer timer; - mPhases[phase_name] = timer; - } - LLFrameTimer& timer = mPhases[phase_name]; - return timer; -} - -void LLVOAvatar::startPhase(const std::string& phase_name) -{ - LLFrameTimer& timer = getPhaseTimer(phase_name); - lldebugs << "startPhase " << phase_name << llendl; - timer.unpause(); -} - -void LLVOAvatar::stopPhase(const std::string& phase_name) -{ - phase_map_t::iterator iter = mPhases.find(phase_name); - if (iter != mPhases.end()) - { - if (iter->second.getStarted()) - { - // Going from started to paused state - record stats. - recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); - } - lldebugs << "stopPhase " << phase_name << llendl; - iter->second.pause(); - } - else - { - lldebugs << "stopPhase " << phase_name << " is not started, no-op" << llendl; - } -} - -void LLVOAvatar::stopAllPhases() -{ - for (phase_map_t::iterator iter = mPhases.begin(); - iter != mPhases.end(); ++iter) - { - const std::string& phase_name = iter->first; - if (iter->second.getStarted()) - { - // Going from started to paused state - record stats. - recordPhaseStat(phase_name,iter->second.getElapsedTimeF32()); - } - lldebugs << "stopPhase (all) " << phase_name << llendl; - iter->second.pause(); - } -} - -void LLVOAvatar::clearPhases() -{ - lldebugs << "clearPhases" << llendl; - - mPhases.clear(); - mLastRezzedStatus = -1; -} - -LLSD LLVOAvatar::dumpPhases() -{ - LLSD result; - for (phase_map_t::iterator iter = mPhases.begin(); iter != mPhases.end(); ++iter) - { - const std::string& phase_name = iter->first; - result[phase_name]["completed"] = !(iter->second.getStarted()); - result[phase_name]["elapsed"] = iter->second.getElapsedTimeF32(); -#if 0 // global stats for each phase seem like overkill here - phase_stats_t::iterator stats_iter = sPhaseStats.find(phase_name); - if (stats_iter != sPhaseStats.end()) - { - result[phase_name]["stats"] = stats_iter->second.getData(); - } -#endif - } - return result; -} - -// static -LLViewerStats::StatsAccumulator& LLVOAvatar::getPhaseStats(const std::string& phase_name) -{ - phase_stats_t::iterator it = sPhaseStats.find(phase_name); - if (it == sPhaseStats.end()) - { - LLViewerStats::StatsAccumulator new_stats; - sPhaseStats[phase_name] = new_stats; - } - return sPhaseStats[phase_name]; -} - -// static -void LLVOAvatar::recordPhaseStat(const std::string& phase_name, F32 value) -{ - LLViewerStats::StatsAccumulator& stats = getPhaseStats(phase_name); - stats.push(value); -} - void LLVOAvatar::deleteLayerSetCaches(bool clearAll) { for (U32 i = 0; i < mBakedTextureDatas.size(); i++) @@ -6605,24 +6504,24 @@ void LLVOAvatar::updateRezzedStatusTimers() if (is_cloud && !was_cloud) { // start cloud timer. - startPhase("cloud"); + getPhases().startPhase("cloud"); } else if (was_cloud && !is_cloud) { // stop cloud timer, which will capture stats. - stopPhase("cloud"); + getPhases().stopPhase("cloud"); } // Non-cloud-or-gray to cloud-or-gray if (is_cloud_or_gray && !was_cloud_or_gray) { // start cloud-or-gray timer. - startPhase("cloud-or-gray"); + getPhases().startPhase("cloud-or-gray"); } else if (was_cloud_or_gray && !is_cloud_or_gray) { // stop cloud-or-gray timer, which will capture stats. - stopPhase("cloud-or-gray"); + getPhases().stopPhase("cloud-or-gray"); } mLastRezzedStatus = rez_status; diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 8b72682040..6334c43f8e 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -287,32 +287,10 @@ public: S32 mLastRezzedStatus; - // Tracking progress of active/completed phases for activities like outfit changing. - LLFrameTimer& getPhaseTimer(const std::string& phase_name); - void startPhase(const std::string& phase_name); - void stopPhase(const std::string& phase_name); - void stopAllPhases(); - void clearPhases(); - LLSD dumpPhases(); - static LLViewerStats::StatsAccumulator& getPhaseStats(const std::string& phase_name); - static void recordPhaseStat(const std::string& phase_name, F32 value); - - class ScopedPhaseSetter + LLViewerStats::PhaseMap& getPhases() { - public: - ScopedPhaseSetter(LLVOAvatar* avatar, std::string phase_name): - mAvatar(avatar),mPhaseName(phase_name) - { - if (mAvatar) { mAvatar->startPhase(mPhaseName); } - } - ~ScopedPhaseSetter() - { - if (mAvatar) { mAvatar->stopPhase(mPhaseName); } - } - private: - std::string mPhaseName; - LLVOAvatar* mAvatar; - }; + return mPhases; + } protected: BOOL updateIsFullyLoaded(); @@ -329,14 +307,26 @@ private: LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; - // TODO move all the phase stuff to its down data structure. public: - typedef std::map phase_stats_t; - typedef std::map phase_map_t; + class ScopedPhaseSetter + { + public: + ScopedPhaseSetter(LLVOAvatar *avatarp, std::string phase_name): + mAvatar(avatarp), mPhaseName(phase_name) + { + if (mAvatar) { mAvatar->getPhases().startPhase(mPhaseName); } + } + ~ScopedPhaseSetter() + { + if (mAvatar) { mAvatar->getPhases().stopPhase(mPhaseName); } + } + private: + std::string mPhaseName; + LLVOAvatar* mAvatar; + }; private: - phase_map_t mPhases; - static phase_stats_t sPhaseStats; + LLViewerStats::PhaseMap mPhases; protected: LLFrameTimer mInvisibleTimer; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 66cc107a87..aac07df2a9 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -80,7 +80,7 @@ void selfStartPhase(const std::string& phase_name) { if (isAgentAvatarValid()) { - gAgentAvatarp->startPhase(phase_name); + gAgentAvatarp->getPhases().startPhase(phase_name); } } @@ -88,7 +88,7 @@ void selfStopPhase(const std::string& phase_name) { if (isAgentAvatarValid()) { - gAgentAvatarp->stopPhase(phase_name); + gAgentAvatarp->getPhases().stopPhase(phase_name); } } @@ -96,7 +96,8 @@ void selfClearPhases() { if (isAgentAvatarValid()) { - gAgentAvatarp->clearPhases(); + gAgentAvatarp->getPhases().clearPhases(); + gAgentAvatarp->mLastRezzedStatus = -1; } } @@ -104,7 +105,7 @@ void selfStopAllPhases() { if (isAgentAvatarValid()) { - gAgentAvatarp->stopAllPhases(); + gAgentAvatarp->getPhases().stopAllPhases(); } } @@ -2146,7 +2147,7 @@ LLSD LLVOAvatarSelf::metricsData() result["timers"]["ruth"] = mRuthTimer.getElapsedTimeF32(); result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32(); result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); - result["phases"] = dumpPhases(); + result["phases"] = getPhases().dumpPhases(); return result; } diff --git a/indra/newview/tests/llviewerassetstats_test.cpp b/indra/newview/tests/llviewerassetstats_test.cpp index 952f0f1a6e..f8923b9868 100755 --- a/indra/newview/tests/llviewerassetstats_test.cpp +++ b/indra/newview/tests/llviewerassetstats_test.cpp @@ -45,12 +45,6 @@ void LLVOAvatar::getNearbyRezzedStats(std::vector& counts) counts[2] = 1; } -LLViewerStats::StatsAccumulator& LLVOAvatar::getPhaseStats(const std::string& phase_name) -{ - static std::map stats_map; - return stats_map[phase_name]; -} - // static std::string LLVOAvatar::rezStatusToString(S32 rez_status) { @@ -60,6 +54,13 @@ std::string LLVOAvatar::rezStatusToString(S32 rez_status) return "unknown"; } +// static +LLViewerStats::StatsAccumulator& LLViewerStats::PhaseMap::getPhaseStats(const std::string& phase_name) +{ + static LLViewerStats::StatsAccumulator junk; + return junk; +} + static const char * all_keys[] = { "duration", -- cgit v1.2.3 From 08704b36f6850d2d2fd29bb984238f760215356a Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 19 Apr 2012 17:12:49 -0400 Subject: startup phase tracking added to appearance metrics --- indra/newview/llstartup.cpp | 5 +++-- indra/newview/llstartup.h | 4 ++++ indra/newview/llvoavatarself.cpp | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) mode change 100644 => 100755 indra/newview/llstartup.h (limited to 'indra') diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 31343ee908..8586900b9c 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -240,6 +240,7 @@ static bool mLoginStatePastUI = false; boost::scoped_ptr LLStartUp::sStateWatcher(new LLEventStream("StartupState")); boost::scoped_ptr LLStartUp::sListener(new LLStartupListener()); +boost::scoped_ptr LLStartUp::sPhases(new LLViewerStats::PhaseMap); // // local function declaration @@ -2707,9 +2708,9 @@ void LLStartUp::setStartupState( EStartupState state ) getStartupStateString() << " to " << startupStateToString(state) << LL_ENDL; - selfStopPhase(getStartupStateString()); + sPhases->stopPhase(getStartupStateString()); gStartupState = state; - selfStartPhase(getStartupStateString()); + sPhases->startPhase(getStartupStateString()); postStartupState(); } diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h old mode 100644 new mode 100755 index 0a18ef1b2d..3754aaf966 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -34,6 +34,8 @@ class LLEventPump; class LLStartupListener; class LLSLURL; +#include "llviewerstats.h" + // functions bool idle_startup(); void release_start_screen(); @@ -113,6 +115,7 @@ public: static bool startLLProxy(); // Initialize the SOCKS 5 proxy + static LLViewerStats::PhaseMap& getPhases() { return *sPhases; } private: static LLSLURL sStartSLURL; @@ -120,6 +123,7 @@ private: static EStartupState gStartupState; // Do not set directly, use LLStartup::setStartupState static boost::scoped_ptr sStateWatcher; static boost::scoped_ptr sListener; + static boost::scoped_ptr sPhases; }; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index aac07df2a9..14d5b1c8d9 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -59,6 +59,7 @@ #include "llmeshrepository.h" #include "llvovolume.h" #include "llsdutil.h" +#include "llstartup.h" #if LL_MSVC // disable boost::lexical_cast warning @@ -2148,6 +2149,7 @@ LLSD LLVOAvatarSelf::metricsData() result["timers"]["invisible"] = mInvisibleTimer.getElapsedTimeF32(); result["timers"]["fully_loaded"] = mFullyLoadedTimer.getElapsedTimeF32(); result["phases"] = getPhases().dumpPhases(); + result["startup"] = LLStartUp::getPhases().dumpPhases(); return result; } -- cgit v1.2.3 From 1253c11e0b6d28e2e0941dffd2e45cb6433f9c57 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 23 Apr 2012 11:38:53 -0400 Subject: more phase tracking for inventory ops --- indra/newview/llappearancemgr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 11f6aa1013..484de81ac9 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -174,7 +174,6 @@ public: * after the last item has fired the event and dereferenced it -- if all * the events actually fire! */ - selfStopPhase("wear_inventory_category_callback"); } protected: @@ -182,6 +181,8 @@ protected: { LL_DEBUGS("Avatar") << self_av_string() << "done all inventory callbacks" << LL_ENDL; + selfStopPhase("wear_inventory_category_callback"); + // Is the destructor called by ordinary dereference, or because the app's shutting down? // If the inventory callback manager goes away, we're shutting down, no longer want the callback. if( LLInventoryCallbackManager::is_instantiated() ) @@ -1891,6 +1892,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool LL_DEBUGS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName() << " )" << LL_ENDL; + selfStartPhase("wear_inventory_category_fetch"); callAfterCategoryFetch(category->getUUID(),boost::bind(&LLAppearanceMgr::wearCategoryFinal, &LLAppearanceMgr::instance(), category->getUUID(), copy, append)); @@ -1899,6 +1901,8 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) { LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; + + selfStopPhase("wear_inventory_category_fetch"); // We now have an outfit ready to be copied to agent inventory. Do // it, and wear that outfit normally. -- cgit v1.2.3 From 4ccae31320a7bc321a4d1df105cdf3b70b60d503 Mon Sep 17 00:00:00 2001 From: callum Date: Mon, 23 Apr 2012 11:28:52 -0700 Subject: SH-3115 FIX Crash on exit, curl handles not empty Reviewed by Ted. --- indra/llmessage/llcurl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 3bcaffc275..4d92cfd32f 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -1506,7 +1506,8 @@ void LLCurl::cleanupClass() delete sHandleMutexp ; sHandleMutexp = NULL ; - llassert(Easy::sActiveHandles.empty()); + // removed as per https://jira.secondlife.com/browse/SH-3115 + //llassert(Easy::sActiveHandles.empty()); } //static -- cgit v1.2.3 From 5ab4dadc703a0f7419929c7da57c471f2ece8a6c Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 25 Apr 2012 16:59:20 -0600 Subject: for subtasks SH-3118, SH-3112, SH-3110, SH-3106, SH-3091 for SH-3086: As a viewer architect, I would like to understand how fast each of the components of the texture pipeline can run in isolation --- indra/llmessage/llcurl.cpp | 2 +- indra/newview/CMakeLists.txt | 2 + indra/newview/llappviewer.cpp | 9 + indra/newview/llfloatertexturefetchdebugger.cpp | 330 ++++++++++++++++ indra/newview/llfloatertexturefetchdebugger.h | 70 ++++ indra/newview/lltexturefetch.cpp | 436 ++++++++++++++++++++- indra/newview/lltexturefetch.h | 148 ++++++- indra/newview/llviewerfloaterreg.cpp | 2 + indra/newview/llviewertexture.cpp | 7 +- indra/newview/llviewertexture.h | 1 + indra/newview/llviewertexturelist.h | 6 +- .../xui/en/floater_texture_fetch_debugger.xml | 292 ++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 7 + 13 files changed, 1305 insertions(+), 7 deletions(-) create mode 100644 indra/newview/llfloatertexturefetchdebugger.cpp create mode 100644 indra/newview/llfloatertexturefetchdebugger.h create mode 100644 indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml (limited to 'indra') diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 3bcaffc275..f58a4f5caf 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -1506,7 +1506,7 @@ void LLCurl::cleanupClass() delete sHandleMutexp ; sHandleMutexp = NULL ; - llassert(Easy::sActiveHandles.empty()); + //llassert(Easy::sActiveHandles.empty()); } //static diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f85b943c70..6db97390aa 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -236,6 +236,7 @@ set(viewer_SOURCE_FILES llfloatertelehub.cpp llfloatertestinspectors.cpp llfloatertestlistview.cpp + llfloatertexturefetchdebugger.cpp llfloatertools.cpp llfloatertopobjects.cpp llfloatertos.cpp @@ -792,6 +793,7 @@ set(viewer_HEADER_FILES llfloatertelehub.h llfloatertestinspectors.h llfloatertestlistview.h + llfloatertexturefetchdebugger.h llfloatertools.h llfloatertopobjects.h llfloatertos.h diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a627f3868b..3ee53c679f 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -93,6 +93,7 @@ #include "llsecondlifeurls.h" #include "llupdaterservice.h" #include "llcallfloater.h" +#include "llfloatertexturefetchdebugger.h" // Linden library includes #include "llavatarnamecache.h" @@ -1220,6 +1221,14 @@ bool LLAppViewer::mainLoop() mem_leak_instance->idle() ; } + //texture fetching debugger + LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = + LLFloaterReg::findTypedInstance("tex_fetch_debugger"); + if(tex_fetch_debugger_instance) + { + tex_fetch_debugger_instance->idle() ; + } + // canonical per-frame event mainloop.post(newFrame); diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp new file mode 100644 index 0000000000..6756f9bbc1 --- /dev/null +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -0,0 +1,330 @@ +/** + * @file llfloatertexturefetchdebugger.cpp + * @brief LLFloaterTextureFetchDebugger class definition + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatertexturefetchdebugger.h" + +#include "lluictrlfactory.h" +#include "llbutton.h" +#include "llspinctrl.h" +#include "llresmgr.h" + +#include "llmath.h" +#include "llviewerwindow.h" +#include "llappviewer.h" +#include "lltexturefetch.h" + +//static +F32 LLFloaterTextureFetchDebugger::sTexelPixelRatio = 1.0f; + +LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key) + : LLFloater(key), + mDebugger(NULL) +{ + setTitle("Texture Fetching Debugger Floater"); + + mCommitCallbackRegistrar.add("TexFetchDebugger.ChangeTexelPixelRatio", boost::bind(&LLFloaterTextureFetchDebugger::onChangeTexelPixelRatio, this)); + + mCommitCallbackRegistrar.add("TexFetchDebugger.Start", boost::bind(&LLFloaterTextureFetchDebugger::onClickStart, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.Clear", boost::bind(&LLFloaterTextureFetchDebugger::onClickClear, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.Close", boost::bind(&LLFloaterTextureFetchDebugger::onClickClose, this)); + + mCommitCallbackRegistrar.add("TexFetchDebugger.CacheRead", boost::bind(&LLFloaterTextureFetchDebugger::onClickCacheRead, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.CacheWrite", boost::bind(&LLFloaterTextureFetchDebugger::onClickCacheWrite, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.HTTPLoad", boost::bind(&LLFloaterTextureFetchDebugger::onClickHTTPLoad, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.Decode", boost::bind(&LLFloaterTextureFetchDebugger::onClickDecode, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.GLTexture", boost::bind(&LLFloaterTextureFetchDebugger::onClickGLTexture, this)); +} +//---------------------------------------------- + +BOOL LLFloaterTextureFetchDebugger::postBuild(void) +{ + mDebugger = LLAppViewer::getTextureFetch()->getFetchDebugger(); + + //set states for buttons + mButtonStateMap["start_btn"] = true; + mButtonStateMap["close_btn"] = true; + mButtonStateMap["clear_btn"] = true; + mButtonStateMap["cacheread_btn"] = false; + mButtonStateMap["cachewrite_btn"] = false; + mButtonStateMap["http_btn"] = false; + mButtonStateMap["decode_btn"] = false; + mButtonStateMap["gl_btn"] = false; + updateButtons(); + + return TRUE ; +} + +LLFloaterTextureFetchDebugger::~LLFloaterTextureFetchDebugger() +{ + //stop everything + mDebugger->stopDebug(); +} + +void LLFloaterTextureFetchDebugger::updateButtons() +{ + for(std::map::iterator iter = mButtonStateMap.begin(); iter != mButtonStateMap.end(); ++iter) + { + if(iter->second) + { + childEnable(iter->first.c_str()); + } + else + { + childDisable(iter->first.c_str()); + } + } +} + +void LLFloaterTextureFetchDebugger::disableButtons() +{ + childDisable("start_btn"); + childDisable("clear_btn"); + childDisable("cacheread_btn"); + childDisable("cachewrite_btn"); + childDisable("http_btn"); + childDisable("decode_btn"); + childDisable("gl_btn"); +} + +void LLFloaterTextureFetchDebugger::idle() +{ + LLTextureFetchDebugger::e_debug_state state = mDebugger->getState(); + + if(mDebugger->update()) + { + switch(state) + { + case LLTextureFetchDebugger::IDLE: + break; + case LLTextureFetchDebugger::READ_CACHE: + mButtonStateMap["cachewrite_btn"] = true; + mButtonStateMap["decode_btn"] = true; + updateButtons(); + break; + case LLTextureFetchDebugger::WRITE_CACHE: + updateButtons(); + break; + case LLTextureFetchDebugger::DECODING: + mButtonStateMap["gl_btn"] = true; + updateButtons(); + break; + case LLTextureFetchDebugger::HTTP_FETCHING: + mButtonStateMap["cacheread_btn"] = true; + mButtonStateMap["cachewrite_btn"] = true; + mButtonStateMap["decode_btn"] = true; + updateButtons(); + break; + case LLTextureFetchDebugger::GL_TEX: + updateButtons(); + break; + default: + break; + } + } +} + +//---------------------- +void LLFloaterTextureFetchDebugger::onChangeTexelPixelRatio() +{ + sTexelPixelRatio = getChild("texel_pixel_ratio")->getValue().asReal(); +} + +void LLFloaterTextureFetchDebugger::onClickStart() +{ + disableButtons(); + + mDebugger->startDebug(); + + mButtonStateMap["start_btn"] = false; + mButtonStateMap["cacheread_btn"] = true; + mButtonStateMap["http_btn"] = true; + updateButtons(); +} + +void LLFloaterTextureFetchDebugger::onClickClose() +{ + setVisible(FALSE); + + //stop everything + mDebugger->stopDebug(); +} + +void LLFloaterTextureFetchDebugger::onClickClear() +{ + mButtonStateMap["start_btn"] = true; + mButtonStateMap["close_btn"] = true; + mButtonStateMap["clear_btn"] = true; + mButtonStateMap["cacheread_btn"] = false; + mButtonStateMap["cachewrite_btn"] = false; + mButtonStateMap["http_btn"] = false; + mButtonStateMap["decode_btn"] = false; + mButtonStateMap["gl_btn"] = false; + updateButtons(); + + //stop everything + mDebugger->stopDebug(); + mDebugger->clearHistory(); +} + +void LLFloaterTextureFetchDebugger::onClickCacheRead() +{ + disableButtons(); + + mDebugger->debugCacheRead(); +} + +void LLFloaterTextureFetchDebugger::onClickCacheWrite() +{ + disableButtons(); + + mDebugger->debugCacheWrite(); +} + +void LLFloaterTextureFetchDebugger::onClickHTTPLoad() +{ + disableButtons(); + + mDebugger->debugHTTP(); +} + +void LLFloaterTextureFetchDebugger::onClickDecode() +{ + disableButtons(); + + mDebugger->debugDecoder(); +} + +void LLFloaterTextureFetchDebugger::onClickGLTexture() +{ + disableButtons(); + + mDebugger->debugGLTextureCreation(); +} + +void LLFloaterTextureFetchDebugger::draw() +{ + //total number of fetched textures + { + getChild("total_num_fetched_label")->setTextArg("[NUM]", llformat("%d", mDebugger->getNumFetchedTextures())); + } + + //total number of fetching requests + { + getChild("total_num_fetching_requests_label")->setTextArg("[NUM]", llformat("%d", mDebugger->getNumFetchingRequests())); + } + + //total number of cache hits + { + getChild("total_num_cache_hits_label")->setTextArg("[NUM]", llformat("%d", mDebugger->getNumCacheHits())); + } + + //total number of visible textures + { + getChild("total_num_visible_tex_label")->setTextArg("[NUM]", llformat("%d", mDebugger->getNumVisibleFetchedTextures())); + } + + //total number of visible texture fetching requests + { + getChild("total_num_visible_tex_fetch_req_label")->setTextArg("[NUM]", llformat("%d", mDebugger->getNumVisibleFetchingRequests())); + } + + //total number of fetched data + { + getChild("total_fetched_data_label")->setTextArg("[SIZE1]", llformat("%d", mDebugger->getFetchedData() >> 10)); + getChild("total_fetched_data_label")->setTextArg("[SIZE2]", llformat("%d", mDebugger->getDecodedData() >> 10)); + } + + //total number of visible fetched data + { + getChild("total_fetched_vis_data_label")->setTextArg("[SIZE1]", llformat("%d", mDebugger->getVisibleFetchedData() >> 10)); + getChild("total_fetched_vis_data_label")->setTextArg("[SIZE2]", llformat("%d", mDebugger->getVisibleDecodedData() >> 10)); + } + + //total number of rendered fetched data + { + getChild("total_fetched_rendered_data_label")->setTextArg("[SIZE1]", llformat("%d", mDebugger->getRenderedData() >> 10)); + getChild("total_fetched_rendered_data_label")->setTextArg("[SIZE2]", llformat("%d", mDebugger->getRenderedDecodedData() >> 10)); + } + + //total time on cache readings + if(mDebugger->getCacheReadTime() < 0.f) + { + getChild("total_time_cache_read_label")->setTextArg("[TIME]", std::string("----")); + } + else + { + getChild("total_time_cache_read_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getCacheReadTime())); + } + + //total time on cache writings + if(mDebugger->getCacheWriteTime() < 0.f) + { + getChild("total_time_cache_write_label")->setTextArg("[TIME]", std::string("----")); + } + else + { + getChild("total_time_cache_write_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getCacheWriteTime())); + } + + //total time on decoding + if(mDebugger->getDecodeTime() < 0.f) + { + getChild("total_time_decode_label")->setTextArg("[TIME]", std::string("----")); + } + else + { + getChild("total_time_decode_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getDecodeTime())); + } + + //total time on gl texture creation + if(mDebugger->getGLCreationTime() < 0.f) + { + getChild("total_time_gl_label")->setTextArg("[TIME]", std::string("----")); + } + else + { + getChild("total_time_gl_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getGLCreationTime())); + } + + //total time on HTTP fetching + if(mDebugger->getHTTPTime() < 0.f) + { + getChild("total_time_http_label")->setTextArg("[TIME]", std::string("----")); + } + else + { + getChild("total_time_http_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getHTTPTime())); + } + + //total time on entire fetching + { + getChild("total_time_fetch_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getTotalFetchingTime())); + } + + LLFloater::draw(); +} diff --git a/indra/newview/llfloatertexturefetchdebugger.h b/indra/newview/llfloatertexturefetchdebugger.h new file mode 100644 index 0000000000..9f2e62fd2c --- /dev/null +++ b/indra/newview/llfloatertexturefetchdebugger.h @@ -0,0 +1,70 @@ +/** + * @file llfloatertexturefetchdebugger.h + * @brief texture fetching debugger window, debug use only + * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_FLOATER_TEXTURE_FETCH_DEBUGGER__H +#define LL_FLOATER_TEXTURE_FETCH_DEBUGGER__H + +#include "llfloater.h" +class LLTextureFetchDebugger; + +class LLFloaterTextureFetchDebugger : public LLFloater +{ + friend class LLFloaterReg; +public: + /// initialize all the callbacks for the menu + + virtual BOOL postBuild() ; + virtual void draw() ; + + void onChangeTexelPixelRatio(); + + void onClickStart(); + void onClickClear(); + void onClickClose(); + + void onClickCacheRead(); + void onClickCacheWrite(); + void onClickHTTPLoad(); + void onClickDecode(); + void onClickGLTexture(); + +public: + void idle() ; + +private: + LLFloaterTextureFetchDebugger(const LLSD& key); + virtual ~LLFloaterTextureFetchDebugger(); + + void updateButtons(); + void disableButtons(); +private: + static F32 sTexelPixelRatio; + + LLTextureFetchDebugger* mDebugger; + std::map mButtonStateMap; +}; + +#endif // LL_FLOATER_TEXTURE_FETCH_DEBUGGER__H diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 2e1b409fa7..d7742219bf 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -54,6 +54,7 @@ #include "llworld.h" #include "llsdutil.h" #include "llstartup.h" +#include "llviewerstats.h" LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128); LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128); @@ -63,6 +64,7 @@ class LLTextureFetchWorker : public LLWorkerClass { friend class LLTextureFetch; friend class HTTPGetResponder; + friend class LLTextureFetchDebugger; private: class CacheReadResponder : public LLTextureCache::ReadResponder @@ -265,6 +267,7 @@ private: BOOL mNeedsAux; BOOL mHaveAllData; BOOL mInLocalCache; + BOOL mInCache; bool mCanUseHTTP ; bool mCanUseNET ; //can get from asset server. S32 mHTTPFailCount; @@ -677,6 +680,7 @@ LLTextureFetchWorker::LLTextureFetchWorker(LLTextureFetch* fetcher, mNeedsAux(FALSE), mHaveAllData(FALSE), mInLocalCache(FALSE), + mInCache(FALSE), mCanUseHTTP(true), mHTTPFailCount(0), mRetryAttempt(0), @@ -906,6 +910,7 @@ bool LLTextureFetchWorker::doWork(S32 param) mCacheReadHandle = LLTextureCache::nullHandle(); mCacheWriteHandle = LLTextureCache::nullHandle(); mState = LOAD_FROM_TEXTURE_CACHE; + mInCache = FALSE; mDesiredSize = llmax(mDesiredSize, TEXTURE_CACHE_ENTRY_SIZE); // min desired size is TEXTURE_CACHE_ENTRY_SIZE LL_DEBUGS("Texture") << mID << ": Priority: " << llformat("%8.0f",mImagePriority) << " Desired Discard: " << mDesiredDiscard << " Desired Size: " << mDesiredSize << LL_ENDL; @@ -994,6 +999,7 @@ bool LLTextureFetchWorker::doWork(S32 param) llassert_always(mFormattedImage->getDataSize() > 0); mLoadedDiscard = mDesiredDiscard; mState = DECODE_IMAGE; + mInCache = TRUE; mWriteToCacheState = NOT_WRITE ; LL_DEBUGS("Texture") << mID << ": Cached. Bytes: " << mFormattedImage->getDataSize() << " Size: " << llformat("%dx%d",mFormattedImage->getWidth(),mFormattedImage->getHeight()) @@ -1418,6 +1424,11 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (mDecoded) { + if(!mInLocalCache) + { + mFetcher->getFetchDebugger()->addHistoryEntry(this); + } + if (mDecodedDiscard < 0) { LL_DEBUGS("Texture") << mID << ": Failed to Decode." << LL_ENDL; @@ -1852,6 +1863,8 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mCurlPOSTRequestCount = 0; mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold")); + + mFetchDebugger = new LLTextureFetchDebugger(this, cache, imagedecodethread) ; } LLTextureFetch::~LLTextureFetch() @@ -1866,11 +1879,17 @@ LLTextureFetch::~LLTextureFetch() } // ~LLQueuedThread() called here + + delete mFetchDebugger; } bool LLTextureFetch::createRequest(const std::string& url, const LLUUID& id, const LLHost& host, F32 priority, S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux, bool can_use_http) { + if(mFetcherLocked) + { + return false; + } if (mDebugPause) { return false; @@ -2292,6 +2311,7 @@ void LLTextureFetch::startThread() { // Construct mCurlGetRequest from Worker Thread mCurlGetRequest = new LLCurlRequest(); + mFetchDebugger->setCurlGetRequest(mCurlGetRequest); } // WORKER THREAD @@ -2300,6 +2320,7 @@ void LLTextureFetch::endThread() // Destroy mCurlGetRequest from Worker Thread delete mCurlGetRequest; mCurlGetRequest = NULL; + mFetchDebugger->setCurlGetRequest(NULL); } // WORKER THREAD @@ -2837,7 +2858,6 @@ void LLTextureFetch::cmdDoWork() } } - ////////////////////////////////////////////////////////////////////////////// // Private (anonymous) class methods implementing the command scheme. @@ -3041,5 +3061,419 @@ truncate_viewer_metrics(int max_regions, LLSD & metrics) } // end of anonymous namespace +/////////////////////////////////////////////////////////////////////////////////////////// +//Start LLTextureFetchDebugger +/////////////////////////////////////////////////////////////////////////////////////////// +//--------------------- +class LLDebuggerCacheReadResponder : public LLTextureCache::ReadResponder +{ +public: + LLDebuggerCacheReadResponder(LLTextureFetchDebugger* debugger, S32 id, LLImageFormatted* image) + : mDebugger(debugger), mID(id) + { + setImage(image); + } + virtual void completed(bool success) + { + mDebugger->callbackCacheRead(mID, success, mFormattedImage, mImageSize, mImageLocal); + } +private: + LLTextureFetchDebugger* mDebugger; + S32 mID; +}; + +class LLDebuggerCacheWriteResponder : public LLTextureCache::WriteResponder +{ +public: + LLDebuggerCacheWriteResponder(LLTextureFetchDebugger* debugger, S32 id) + : mDebugger(debugger), mID(id) + { + } + virtual void completed(bool success) + { + mDebugger->callbackCacheWrite(mID, success); + } +private: + LLTextureFetchDebugger* mDebugger; + S32 mID; +}; + +class LLDebuggerDecodeResponder : public LLImageDecodeThread::Responder +{ +public: + LLDebuggerDecodeResponder(LLTextureFetchDebugger* debugger, S32 id) + : mDebugger(debugger), mID(id) + { + } + virtual void completed(bool success, LLImageRaw* raw, LLImageRaw* aux) + { + mDebugger->callbackDecoded(mID, success, raw, aux); + } +private: + LLTextureFetchDebugger* mDebugger; + S32 mID; +}; + +LLTextureFetchDebugger::LLTextureFetchDebugger(LLTextureFetch* fetcher, LLTextureCache* cache, LLImageDecodeThread* imagedecodethread) : + mFetcher(fetcher), + mTextureCache(cache), + mImageDecodeThread(imagedecodethread), + mCurlGetRequest(NULL) +{ + init(); +} + +LLTextureFetchDebugger::~LLTextureFetchDebugger() +{ + mFetchingHistory.clear(); + stopDebug(); +} + +void LLTextureFetchDebugger::init() +{ + mState = IDLE; + + mCacheReadTime = -1.f; + mCacheWriteTime = -1.f; + mDecodingTime = -1.f; + mHTTPTime = -1.f; + mGLCreationTime = -1.f; + mTotalFetchingTime = 0.f; + + mNumFetchedTextures = 0; + mNumCacheHits = 0; + mNumVisibleFetchedTextures = 0; + mNumVisibleFetchingRequests = 0; + mFetchedData = 0; + mDecodedData = 0; + mVisibleFetchedData = 0; + mVisibleDecodedData = 0; + mRenderedData = 0; + mRenderedDecodedData = 0; +} + +void LLTextureFetchDebugger::startDebug() +{ + //lock the fetcher + mFetcher->lockFetcher(true); + + //clear the current fetching queue + gTextureList.clearFetchingRequests(); + + //wait for all works to be done + while(1) + { + S32 pending = 0; + pending += LLAppViewer::getTextureCache()->update(1); + pending += LLAppViewer::getImageDecodeThread()->update(1); + pending += LLAppViewer::getTextureFetch()->update(1); + if(!pending) + { + break; + } + } + + //collect statistics + mTotalFetchingTime = gDebugTimers[0].getElapsedTimeF32() - mTotalFetchingTime; + + std::set fetched_textures; + S32 size = mFetchingHistory.size(); + for(S32 i = 0 ; i < size; i++) + { + bool in_list = true; + if(fetched_textures.find(mFetchingHistory[i].mID) == fetched_textures.end()) + { + fetched_textures.insert(mFetchingHistory[i].mID); + in_list = false; + } + + LLViewerFetchedTexture* tex = LLViewerTextureManager::findFetchedTexture(mFetchingHistory[i].mID); + if(tex && tex->isJustBound()) //visible + { + if(!in_list) + { + mNumVisibleFetchedTextures++; + } + mNumVisibleFetchingRequests++; + + mVisibleFetchedData += mFetchingHistory[i].mFetchedSize; + mVisibleDecodedData += mFetchingHistory[i].mDecodedSize; + + if(tex->getDiscardLevel() >= mFetchingHistory[i].mDecodedLevel) + { + mRenderedData += mFetchingHistory[i].mFetchedSize; + mRenderedDecodedData += mFetchingHistory[i].mDecodedSize; + } + } + } + + mNumFetchedTextures = fetched_textures.size(); +} + +void LLTextureFetchDebugger::stopDebug() +{ + //clear the current debug work + S32 size = mFetchingHistory.size(); + switch(mState) + { + case READ_CACHE: + for(S32 i = 0 ; i < size; i++) + { + if (mFetchingHistory[i]. mCacheHandle != LLTextureCache::nullHandle()) + { + mTextureCache->readComplete(mFetchingHistory[i].mCacheHandle, true); + } + } + break; + case WRITE_CACHE: + for(S32 i = 0 ; i < size; i++) + { + if (mFetchingHistory[i].mCacheHandle != LLTextureCache::nullHandle()) + { + mTextureCache->writeComplete(mFetchingHistory[i].mCacheHandle, true); + } + } + break; + case DECODING: + break; + case HTTP_FETCHING: + break; + case GL_TEX: + break; + default: + break; + } + + while(1) + { + if(update()) + { + break; + } + } + + //unlock the fetcher + mFetcher->lockFetcher(false); +} + +//called in the main thread and when the fetching queue is empty +void LLTextureFetchDebugger::clearHistory() +{ + mFetchingHistory.clear(); + init(); +} + +void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) +{ + if(worker->mInCache) + { + mNumCacheHits++; + } + mFetchedData += worker->mFormattedImage->getDataSize(); + mDecodedData += worker->mRawImage->getDataSize(); + + mFetchingHistory.push_back(FetchEntry(worker->mID, worker->mDecodedDiscard, worker->mFormattedImage->getDataSize(), worker->mRawImage->getDataSize())); + //mFetchingHistory.push_back(FetchEntry(worker->mID, worker->mDesiredSize, worker->mHaveAllData ? 0 : worker->mLoadedDiscard, worker->mFormattedImage->getComponents(), + //worker->mDecodedDiscard, worker->mFormattedImage->getDataSize(), worker->mRawImage->getDataSize())); +} + +void LLTextureFetchDebugger::lockCache() +{ +} + +void LLTextureFetchDebugger::unlockCache() +{ +} + +void LLTextureFetchDebugger::debugCacheRead() +{ + lockCache(); + llassert_always(mState == IDLE); + mTimer.reset(); + mState = READ_CACHE; + + S32 size = mFetchingHistory.size(); + for(S32 i = 0 ; i < size ; i++) + { + mFetchingHistory[i].mFormattedImage = NULL; + mFetchingHistory[i].mCacheHandle = mTextureCache->readFromCache(mFetchingHistory[i].mID, LLWorkerThread::PRIORITY_NORMAL, 0, mFetchingHistory[i].mFetchedSize, + new LLDebuggerCacheReadResponder(this, i, mFetchingHistory[i].mFormattedImage)); + } +} + +void LLTextureFetchDebugger::debugCacheWrite() +{ + //remove from cache + S32 size = mFetchingHistory.size(); + { + std::set deleted_list; + for(S32 i = 0 ; i < size ; i++) + { + if(deleted_list.find(mFetchingHistory[i].mID) == deleted_list.end()) + { + deleted_list.insert(mFetchingHistory[i].mID); + mTextureCache->removeFromCache(mFetchingHistory[i].mID); + } + } + } + + lockCache(); + llassert_always(mState == IDLE); + mTimer.reset(); + mState = WRITE_CACHE; + + for(S32 i = 0 ; i < size ; i++) + { + mFetchingHistory[i].mCacheHandle = mTextureCache->writeToCache(mFetchingHistory[i].mID, LLWorkerThread::PRIORITY_NORMAL, + mFetchingHistory[i].mFormattedImage->getData(), mFetchingHistory[i].mFetchedSize, + mFetchingHistory[i].mDecodedLevel == 0 ? mFetchingHistory[i].mFetchedSize : mFetchingHistory[i].mFetchedSize + 1, + new LLDebuggerCacheWriteResponder(this, i)); + } +} + +void LLTextureFetchDebugger::lockDecoder() +{ +} + +void LLTextureFetchDebugger::unlockDecoder() +{ +} + +void LLTextureFetchDebugger::debugDecoder() +{ + lockDecoder(); + llassert_always(mState == IDLE); + mTimer.reset(); + mState = DECODING; + + S32 size = mFetchingHistory.size(); + for(S32 i = 0 ; i < size ; i++) + { + if(mFetchingHistory[i].mFormattedImage.isNull()) + { + continue; + } + + mImageDecodeThread->decodeImage(mFetchingHistory[i].mFormattedImage, LLWorkerThread::PRIORITY_NORMAL, + mFetchingHistory[i].mDecodedLevel, mFetchingHistory[i].mNeedsAux, + new LLDebuggerDecodeResponder(this, i)); + } +} + +void LLTextureFetchDebugger::debugHTTP() +{ + llinfos << "debug HTTP" << llendl; +} + +void LLTextureFetchDebugger::debugGLTextureCreation() +{ + llassert_always(mState == IDLE); + mState = GL_TEX; + std::vector tex_list; + + S32 size = mFetchingHistory.size(); + for(S32 i = 0 ; i < size ; i++) + { + if(mFetchingHistory[i].mRawImage.notNull()) + { + LLViewerFetchedTexture* tex = gTextureList.findImage(mFetchingHistory[i].mID) ; + if(tex && !tex->isForSculptOnly()) + { + tex->destroyGLTexture() ; + tex_list.push_back(tex); + } + } + } + + mTimer.reset(); + S32 j = 0 ; + for(S32 i = 0 ; i < size ; i++) + { + if(mFetchingHistory[i].mRawImage.notNull()) + { + if(mFetchingHistory[i].mID == tex_list[j]->getID()) + { + tex_list[j]->createGLTexture(mFetchingHistory[i].mDecodedLevel, mFetchingHistory[i].mRawImage, 0, TRUE, tex_list[j]->getBoostLevel()); + j++; + } + } + } + + mGLCreationTime = mTimer.getElapsedTimeF32() ; + return; +} + +bool LLTextureFetchDebugger::update() +{ + switch(mState) + { + case READ_CACHE: + if(!mTextureCache->update(1)) + { + mCacheReadTime = mTimer.getElapsedTimeF32() ; + mState = IDLE; + unlockCache(); + } + break; + case WRITE_CACHE: + if(!mTextureCache->update(1)) + { + mCacheWriteTime = mTimer.getElapsedTimeF32() ; + mState = IDLE; + unlockCache(); + } + break; + case DECODING: + if(!mImageDecodeThread->update(1)) + { + mDecodingTime = mTimer.getElapsedTimeF32() ; + mState = IDLE; + unlockDecoder(); + } + break; + case HTTP_FETCHING: + mState = IDLE; + break; + case GL_TEX: + mState = IDLE; + break; + default: + mState = IDLE; + break; + } + + return mState == IDLE; +} + +void LLTextureFetchDebugger::callbackCacheRead(S32 id, bool success, LLImageFormatted* image, + S32 imagesize, BOOL islocal) +{ + if (success) + { + mFetchingHistory[id].mFormattedImage = image; + } + mTextureCache->readComplete(mFetchingHistory[id].mCacheHandle, false); + mFetchingHistory[id].mCacheHandle = LLTextureCache::nullHandle(); +} + +void LLTextureFetchDebugger::callbackCacheWrite(S32 id, bool success) +{ + mTextureCache->writeComplete(mFetchingHistory[id].mCacheHandle); + mFetchingHistory[id].mCacheHandle = LLTextureCache::nullHandle(); +} + +void LLTextureFetchDebugger::callbackDecoded(S32 id, bool success, LLImageRaw* raw, LLImageRaw* aux) +{ + if (success) + { + llassert_always(raw); + mFetchingHistory[id].mRawImage = raw; + } +} + +//--------------------- +/////////////////////////////////////////////////////////////////////////////////////////// +//End LLTextureFetchDebugger +/////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 710dd67e99..529a2e6834 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -34,14 +34,17 @@ #include "llcurl.h" #include "lltextureinfo.h" #include "llapr.h" +#include "llimageworker.h" +//#include "lltexturecache.h" class LLViewerTexture; class LLTextureFetchWorker; class HTTPGetResponder; -class LLTextureCache; class LLImageDecodeThread; class LLHost; class LLViewerAssetStats; +class LLTextureFetchDebugger; +class LLTextureCache; // Interface class class LLTextureFetch : public LLWorkerThread @@ -212,7 +215,150 @@ public: // attempt to log metrics follows a break in the metrics stream // reporting due to either startup or a problem POSTing data. static volatile bool svMetricsDataBreak; + +private: + //debug use + LLTextureFetchDebugger* mFetchDebugger; + bool mFetcherLocked; + +public: + //debug use + LLTextureFetchDebugger* getFetchDebugger() { return mFetchDebugger;} + void lockFetcher(bool lock) { mFetcherLocked = lock;} }; +//debug use +class LLTextureFetchDebugger +{ +public: + LLTextureFetchDebugger(LLTextureFetch* fetcher, LLTextureCache* cache, LLImageDecodeThread* imagedecodethread) ; + ~LLTextureFetchDebugger(); + +public: + enum e_debug_state + { + IDLE = 0, + READ_CACHE, + WRITE_CACHE, + DECODING, + HTTP_FETCHING, + GL_TEX, + INVALID + }; + +private: + struct FetchEntry + { + LLUUID mID; + //S32 mRequestedSize; + //S32 mFetchedDiscard; + //S32 mComponents; + S32 mDecodedLevel; + S32 mFetchedSize; + S32 mDecodedSize; + BOOL mNeedsAux; + U32 mCacheHandle; + LLPointer mFormattedImage; + LLPointer mRawImage; + + FetchEntry() : + mDecodedLevel(-1), + mFetchedSize(0), + mDecodedSize(0) + {} + FetchEntry(LLUUID& id, /*S32 r_size, S32 f_discard, S32 c,*/ S32 level, S32 f_size, S32 d_size) : + mID(id), + //mRequestedSize(r_size), + //mFetchedDiscard(f_discard), + //mComponents(c), + mDecodedLevel(level), + mFetchedSize(f_size), + mDecodedSize(d_size), + mNeedsAux(false) + {} + }; + std::vector mFetchingHistory; + + e_debug_state mState; + + F32 mCacheReadTime; + F32 mCacheWriteTime; + F32 mDecodingTime; + F32 mHTTPTime; + F32 mGLCreationTime; + + LLTimer mTimer; + + LLTextureFetch* mFetcher; + LLTextureCache* mTextureCache; + LLImageDecodeThread* mImageDecodeThread; + LLCurlRequest* mCurlGetRequest; + + F32 mTotalFetchingTime; + S32 mNumFetchedTextures; + S32 mNumCacheHits; + S32 mNumVisibleFetchedTextures; + S32 mNumVisibleFetchingRequests; + U32 mFetchedData; + U32 mDecodedData; + U32 mVisibleFetchedData; + U32 mVisibleDecodedData; + U32 mRenderedData; + U32 mRenderedDecodedData; + +public: + bool update(); //called in the main thread once per frame + + //fetching history + void clearHistory(); + void addHistoryEntry(LLTextureFetchWorker* worker); + + void setCurlGetRequest(LLCurlRequest* request) { mCurlGetRequest = request;} + + void startDebug(); + void stopDebug(); //stop everything + void debugCacheRead(); + void debugCacheWrite(); + void debugHTTP(); + void debugDecoder(); + void debugGLTextureCreation(); + + void callbackCacheRead(S32 id, bool success, LLImageFormatted* image, + S32 imagesize, BOOL islocal); + void callbackCacheWrite(S32 id, bool success); + void callbackDecoded(S32 id, bool success, LLImageRaw* raw, LLImageRaw* aux); + + e_debug_state getState() {return mState;} + S32 getNumFetchedTextures() {return mNumFetchedTextures;} + S32 getNumFetchingRequests() {return mFetchingHistory.size();} + S32 getNumCacheHits() {return mNumCacheHits;} + S32 getNumVisibleFetchedTextures() {return mNumVisibleFetchedTextures;} + S32 getNumVisibleFetchingRequests() {return mNumVisibleFetchingRequests;} + U32 getFetchedData() {return mFetchedData;} + U32 getDecodedData() {return mDecodedData;} + U32 getVisibleFetchedData() {return mVisibleFetchedData;} + U32 getVisibleDecodedData() {return mVisibleDecodedData;} + U32 getRenderedData() {return mRenderedData;} + U32 getRenderedDecodedData() {return mRenderedDecodedData;} + + F32 getCacheReadTime() {return mCacheReadTime;} + F32 getCacheWriteTime() {return mCacheWriteTime;} + F32 getDecodeTime() {return mDecodingTime;} + F32 getGLCreationTime() {return mGLCreationTime;} + F32 getHTTPTime() {return mHTTPTime;} + F32 getTotalFetchingTime() {return mTotalFetchingTime;} + +private: + void init(); + + void lockFetcher(); + void unlockFetcher(); + + void lockCache(); + void unlockCache(); + + void lockDecoder(); + void unlockDecoder(); +}; #endif // LL_LLTEXTUREFETCH_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index bb870f7651..986b8ac3c5 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -103,6 +103,7 @@ #include "llfloatertelehub.h" #include "llfloatertestinspectors.h" #include "llfloatertestlistview.h" +#include "llfloatertexturefetchdebugger.h" #include "llfloatertools.h" #include "llfloatertos.h" #include "llfloatertopobjects.h" @@ -227,6 +228,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("tex_fetch_debugger", "floater_texture_fetch_debugger.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index d5b53f3cb1..49faae3fdb 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -178,7 +178,12 @@ LLViewerTexture* LLViewerTextureManager::findTexture(const LLUUID& id) } return tex ; } - + +LLViewerFetchedTexture* LLViewerTextureManager::findFetchedTexture(const LLUUID& id) +{ + return gTextureList.findImage(id); +} + LLViewerMediaTexture* LLViewerTextureManager::findMediaTexture(const LLUUID &media_id) { return LLViewerMediaTexture::findMediaTexture(media_id) ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 6ddff3e485..d0bc534c5a 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -701,6 +701,7 @@ public: //"find-texture" just check if the texture exists, if yes, return it, otherwise return null. // static LLViewerTexture* findTexture(const LLUUID& id) ; + static LLViewerFetchedTexture* findFetchedTexture(const LLUUID& id) ; static LLViewerMediaTexture* findMediaTexture(const LLUUID& id) ; static LLViewerMediaTexture* createMediaTexture(const LLUUID& id, BOOL usemipmaps = TRUE, LLImageGL* gl_image = NULL) ; diff --git a/indra/newview/llviewertexturelist.h b/indra/newview/llviewertexturelist.h index 64e2c1f791..7038ea24ce 100644 --- a/indra/newview/llviewertexturelist.h +++ b/indra/newview/llviewertexturelist.h @@ -109,6 +109,8 @@ public: void doPreloadImages(); void doPrefetchImages(); + void clearFetchingRequests(); + static S32 getMinVideoRamSetting(); static S32 getMaxVideoRamSetting(bool get_recommended = false); @@ -163,9 +165,7 @@ private: // Request image from a specific host, used for baked avatar textures. // Implemented in header in case someone changes default params above. JC LLViewerFetchedTexture* getImageFromHost(const LLUUID& image_id, LLHost host) - { return getImage(image_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); } - - void clearFetchingRequests(); + { return getImage(image_id, TRUE, LLViewerTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); } public: typedef std::set > image_list_t; diff --git a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml new file mode 100644 index 0000000000..ff7528eeb7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml @@ -0,0 +1,292 @@ + + + + 1, Total number of fetched textures: [NUM] + + + 2, Total number of fetching requests: [NUM] + + + 3, Total number of cache hits: [NUM] + + + 4, Total number of visible textures: [NUM] + + + 5, Total number of visible texture fetching requests: [NUM] + + + 6, Total number of fetched data/Decoded Data: [SIZE1]KB / [SIZE2]KB + + + 7, Total number of visible fetched data/Decoded Data: [SIZE1]KB / [SIZE2]KB + + + 8, Total number of rendered fetched data/Decoded Data: [SIZE1]KB / [SIZE2]KB + + + 9, Total time on cache readings: [TIME] seconds + + + 10, Total time on cache writings: [TIME] seconds + + + 11, Total time on decodings: [TIME] seconds + + + 12, Total time on gl texture creation: [TIME] seconds + + + 13, Total time on HTTP fetching: [TIME] seconds + + + 14, Total time on entire fetching: [TIME] seconds + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 8b0152b1a2..a1f17ffc17 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1877,6 +1877,13 @@ function="Advanced.ToggleConsole" parameter="texture" /> + + + Date: Thu, 26 Apr 2012 13:18:06 -0400 Subject: tracking for copy-to-wear inventory failures --- indra/newview/llappearancemgr.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 484de81ac9..73dd64dffe 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -162,6 +162,8 @@ public: mCatID = cat_id; mAppend = append; + LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; + selfStartPhase("wear_inventory_category_callback"); } void fire(const LLUUID& item_id) @@ -174,6 +176,7 @@ public: * after the last item has fired the event and dereferenced it -- if all * the events actually fire! */ + LL_DEBUGS("Avatar") << self_av_string() << " fired on copied item, id " << item_id << LL_ENDL; } protected: -- cgit v1.2.3 From e344b2afa21adf072837f1bcf4b38dd511b76f0e Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 26 Apr 2012 15:53:35 -0600 Subject: For SH-3121: collect time of reloading all textures from cache and through HTTP when all objects loading are done. --- indra/newview/llappviewer.cpp | 18 ++--- indra/newview/llfloatertexturefetchdebugger.cpp | 60 ++++++++++++++++ indra/newview/llfloatertexturefetchdebugger.h | 2 + indra/newview/lltexturefetch.cpp | 83 +++++++++++++++++++++- indra/newview/lltexturefetch.h | 26 ++++++- indra/newview/llviewertexture.cpp | 8 +++ indra/newview/llviewertexture.h | 2 + .../xui/en/floater_texture_fetch_debugger.xml | 64 ++++++++++++++--- 8 files changed, 242 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3ee53c679f..bb6658dc48 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1219,15 +1219,7 @@ bool LLAppViewer::mainLoop() if(mem_leak_instance) { mem_leak_instance->idle() ; - } - - //texture fetching debugger - LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = - LLFloaterReg::findTypedInstance("tex_fetch_debugger"); - if(tex_fetch_debugger_instance) - { - tex_fetch_debugger_instance->idle() ; - } + } // canonical per-frame event mainloop.post(newFrame); @@ -1412,6 +1404,14 @@ bool LLAppViewer::mainLoop() LLLFSThread::sLocal->pause(); } + //texture fetching debugger + LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = + LLFloaterReg::findTypedInstance("tex_fetch_debugger"); + if(tex_fetch_debugger_instance) + { + tex_fetch_debugger_instance->idle() ; + } + if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) { diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index 6756f9bbc1..448c562134 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -58,6 +58,9 @@ LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key) mCommitCallbackRegistrar.add("TexFetchDebugger.HTTPLoad", boost::bind(&LLFloaterTextureFetchDebugger::onClickHTTPLoad, this)); mCommitCallbackRegistrar.add("TexFetchDebugger.Decode", boost::bind(&LLFloaterTextureFetchDebugger::onClickDecode, this)); mCommitCallbackRegistrar.add("TexFetchDebugger.GLTexture", boost::bind(&LLFloaterTextureFetchDebugger::onClickGLTexture, this)); + + mCommitCallbackRegistrar.add("TexFetchDebugger.RefetchVisCache", boost::bind(&LLFloaterTextureFetchDebugger::onClickRefetchVisCache, this)); + mCommitCallbackRegistrar.add("TexFetchDebugger.RefetchVisHTTP", boost::bind(&LLFloaterTextureFetchDebugger::onClickRefetchVisHTTP, this)); } //---------------------------------------------- @@ -74,6 +77,10 @@ BOOL LLFloaterTextureFetchDebugger::postBuild(void) mButtonStateMap["http_btn"] = false; mButtonStateMap["decode_btn"] = false; mButtonStateMap["gl_btn"] = false; + + mButtonStateMap["refetchviscache_btn"] = true; + mButtonStateMap["refetchvishttp_btn"] = true; + updateButtons(); return TRUE ; @@ -109,6 +116,8 @@ void LLFloaterTextureFetchDebugger::disableButtons() childDisable("http_btn"); childDisable("decode_btn"); childDisable("gl_btn"); + childDisable("refetchviscache_btn"); + childDisable("refetchvishttp_btn"); } void LLFloaterTextureFetchDebugger::idle() @@ -142,6 +151,11 @@ void LLFloaterTextureFetchDebugger::idle() case LLTextureFetchDebugger::GL_TEX: updateButtons(); break; + case LLTextureFetchDebugger::REFETCH_VIS_CACHE: + updateButtons(); + case LLTextureFetchDebugger::REFETCH_VIS_HTTP: + updateButtons(); + break; default: break; } @@ -184,6 +198,8 @@ void LLFloaterTextureFetchDebugger::onClickClear() mButtonStateMap["http_btn"] = false; mButtonStateMap["decode_btn"] = false; mButtonStateMap["gl_btn"] = false; + mButtonStateMap["refetchviscache_btn"] = true; + mButtonStateMap["refetchvishttp_btn"] = true; updateButtons(); //stop everything @@ -226,6 +242,20 @@ void LLFloaterTextureFetchDebugger::onClickGLTexture() mDebugger->debugGLTextureCreation(); } +void LLFloaterTextureFetchDebugger::onClickRefetchVisCache() +{ + disableButtons(); + + mDebugger->debugRefetchVisibleFromCache(); +} + +void LLFloaterTextureFetchDebugger::onClickRefetchVisHTTP() +{ + disableButtons(); + + mDebugger->debugRefetchVisibleFromHTTP(); +} + void LLFloaterTextureFetchDebugger::draw() { //total number of fetched textures @@ -257,6 +287,7 @@ void LLFloaterTextureFetchDebugger::draw() { getChild("total_fetched_data_label")->setTextArg("[SIZE1]", llformat("%d", mDebugger->getFetchedData() >> 10)); getChild("total_fetched_data_label")->setTextArg("[SIZE2]", llformat("%d", mDebugger->getDecodedData() >> 10)); + getChild("total_fetched_data_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getFetchedPixels() / 1000000.f)); } //total number of visible fetched data @@ -269,6 +300,7 @@ void LLFloaterTextureFetchDebugger::draw() { getChild("total_fetched_rendered_data_label")->setTextArg("[SIZE1]", llformat("%d", mDebugger->getRenderedData() >> 10)); getChild("total_fetched_rendered_data_label")->setTextArg("[SIZE2]", llformat("%d", mDebugger->getRenderedDecodedData() >> 10)); + getChild("total_fetched_rendered_data_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRenderedPixels() / 1000000.f)); } //total time on cache readings @@ -326,5 +358,33 @@ void LLFloaterTextureFetchDebugger::draw() getChild("total_time_fetch_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getTotalFetchingTime())); } + //total time on refetching visible textures from cache + if(mDebugger->getRefetchVisCacheTime() < 0.f) + { + getChild("total_time_refetch_vis_cache_label")->setTextArg("[TIME]", std::string("----")); + getChild("total_time_refetch_vis_cache_label")->setTextArg("[SIZE]", std::string("----")); + getChild("total_time_refetch_vis_cache_label")->setTextArg("[PIXEL]", std::string("----")); + } + else + { + getChild("total_time_refetch_vis_cache_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getRefetchVisCacheTime())); + getChild("total_time_refetch_vis_cache_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedData() >> 10)); + getChild("total_time_refetch_vis_cache_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedPixels() / 1000000.f)); + } + + //total time on refetching visible textures from http + if(mDebugger->getRefetchVisHTTPTime() < 0.f) + { + getChild("total_time_refetch_vis_http_label")->setTextArg("[TIME]", std::string("----")); + getChild("total_time_refetch_vis_http_label")->setTextArg("[SIZE]", std::string("----")); + getChild("total_time_refetch_vis_http_label")->setTextArg("[PIXEL]", std::string("----")); + } + else + { + getChild("total_time_refetch_vis_http_label")->setTextArg("[TIME]", llformat("%.3f", mDebugger->getRefetchVisHTTPTime())); + getChild("total_time_refetch_vis_http_label")->setTextArg("[SIZE]", llformat("%d", mDebugger->getRefetchedData() >> 10)); + getChild("total_time_refetch_vis_http_label")->setTextArg("[PIXEL]", llformat("%.3f", mDebugger->getRefetchedPixels() / 1000000.f)); + } + LLFloater::draw(); } diff --git a/indra/newview/llfloatertexturefetchdebugger.h b/indra/newview/llfloatertexturefetchdebugger.h index 9f2e62fd2c..7181dc04d5 100644 --- a/indra/newview/llfloatertexturefetchdebugger.h +++ b/indra/newview/llfloatertexturefetchdebugger.h @@ -51,6 +51,8 @@ public: void onClickDecode(); void onClickGLTexture(); + void onClickRefetchVisCache(); + void onClickRefetchVisHTTP(); public: void idle() ; diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index d7742219bf..2816c16261 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3139,6 +3139,8 @@ void LLTextureFetchDebugger::init() mHTTPTime = -1.f; mGLCreationTime = -1.f; mTotalFetchingTime = 0.f; + mRefetchVisCacheTime = -1.f; + mRefetchVisHTTPTime = -1.f; mNumFetchedTextures = 0; mNumCacheHits = 0; @@ -3150,12 +3152,19 @@ void LLTextureFetchDebugger::init() mVisibleDecodedData = 0; mRenderedData = 0; mRenderedDecodedData = 0; + mFetchedPixels = 0; + mRenderedPixels = 0; + mRefetchedData = 0; + mRefetchedPixels = 0; + + mFreezeHistory = FALSE; } void LLTextureFetchDebugger::startDebug() { //lock the fetcher mFetcher->lockFetcher(true); + mFreezeHistory = TRUE; //clear the current fetching queue gTextureList.clearFetchingRequests(); @@ -3203,6 +3212,7 @@ void LLTextureFetchDebugger::startDebug() { mRenderedData += mFetchingHistory[i].mFetchedSize; mRenderedDecodedData += mFetchingHistory[i].mDecodedSize; + mRenderedPixels += tex->getWidth() * tex->getHeight(); } } } @@ -3254,6 +3264,8 @@ void LLTextureFetchDebugger::stopDebug() //unlock the fetcher mFetcher->lockFetcher(false); + mFreezeHistory = FALSE; + mTotalFetchingTime = gDebugTimers[0].getElapsedTimeF32(); //reset } //called in the main thread and when the fetching queue is empty @@ -3265,12 +3277,20 @@ void LLTextureFetchDebugger::clearHistory() void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) { + if(mFreezeHistory) + { + mRefetchedPixels += worker->mRawImage->getWidth() * worker->mRawImage->getHeight(); + mRefetchedData += worker->mFormattedImage->getDataSize(); + return; + } + if(worker->mInCache) { mNumCacheHits++; } mFetchedData += worker->mFormattedImage->getDataSize(); mDecodedData += worker->mRawImage->getDataSize(); + mFetchedPixels += worker->mRawImage->getWidth() * worker->mRawImage->getHeight(); mFetchingHistory.push_back(FetchEntry(worker->mID, worker->mDecodedDiscard, worker->mFormattedImage->getDataSize(), worker->mRawImage->getDataSize())); //mFetchingHistory.push_back(FetchEntry(worker->mID, worker->mDesiredSize, worker->mHaveAllData ? 0 : worker->mLoadedDiscard, worker->mFormattedImage->getComponents(), @@ -3301,9 +3321,8 @@ void LLTextureFetchDebugger::debugCacheRead() } } -void LLTextureFetchDebugger::debugCacheWrite() +void LLTextureFetchDebugger::clearCache() { - //remove from cache S32 size = mFetchingHistory.size(); { std::set deleted_list; @@ -3316,12 +3335,19 @@ void LLTextureFetchDebugger::debugCacheWrite() } } } +} + +void LLTextureFetchDebugger::debugCacheWrite() +{ + //remove from cache + clearCache(); lockCache(); llassert_always(mState == IDLE); mTimer.reset(); mState = WRITE_CACHE; + S32 size = mFetchingHistory.size(); for(S32 i = 0 ; i < size ; i++) { mFetchingHistory[i].mCacheHandle = mTextureCache->writeToCache(mFetchingHistory[i].mID, LLWorkerThread::PRIORITY_NORMAL, @@ -3403,6 +3429,43 @@ void LLTextureFetchDebugger::debugGLTextureCreation() return; } +//clear fetching results of all textures. +void LLTextureFetchDebugger::clearTextures() +{ + S32 size = mFetchingHistory.size(); + for(S32 i = 0 ; i < size ; i++) + { + LLViewerFetchedTexture* tex = gTextureList.findImage(mFetchingHistory[i].mID) ; + if(tex) + { + tex->clearFetchedResults() ; + } + } +} + +void LLTextureFetchDebugger::debugRefetchVisibleFromCache() +{ + llassert_always(mState == IDLE); + mState = REFETCH_VIS_CACHE; + + clearTextures(); + + mTimer.reset(); + mFetcher->lockFetcher(false); +} + +void LLTextureFetchDebugger::debugRefetchVisibleFromHTTP() +{ + llassert_always(mState == IDLE); + mState = REFETCH_VIS_HTTP; + + clearCache(); + clearTextures(); + + mTimer.reset(); + mFetcher->lockFetcher(false); +} + bool LLTextureFetchDebugger::update() { switch(mState) @@ -3437,6 +3500,22 @@ bool LLTextureFetchDebugger::update() case GL_TEX: mState = IDLE; break; + case REFETCH_VIS_CACHE: + if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) + { + mRefetchVisCacheTime = gDebugTimers[0].getElapsedTimeF32() - mTotalFetchingTime; + mState = IDLE; + mFetcher->lockFetcher(true); + } + break; + case REFETCH_VIS_HTTP: + if (LLAppViewer::getTextureFetch()->getNumRequests() == 0) + { + mRefetchVisHTTPTime = gDebugTimers[0].getElapsedTimeF32() - mTotalFetchingTime; + mState = IDLE; + mFetcher->lockFetcher(true); + } + break; default: mState = IDLE; break; diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 529a2e6834..fc8855089c 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -243,6 +243,10 @@ public: DECODING, HTTP_FETCHING, GL_TEX, + REFETCH_VIS_CACHE, + REFETCH_VIS_HTTP, + REFETCH_ALL_CACHE, + REFETCH_ALL_HTTP, INVALID }; @@ -287,14 +291,17 @@ private: F32 mHTTPTime; F32 mGLCreationTime; + F32 mTotalFetchingTime; + F32 mRefetchVisCacheTime; + F32 mRefetchVisHTTPTime; + LLTimer mTimer; LLTextureFetch* mFetcher; LLTextureCache* mTextureCache; LLImageDecodeThread* mImageDecodeThread; LLCurlRequest* mCurlGetRequest; - - F32 mTotalFetchingTime; + S32 mNumFetchedTextures; S32 mNumCacheHits; S32 mNumVisibleFetchedTextures; @@ -305,7 +312,12 @@ private: U32 mVisibleDecodedData; U32 mRenderedData; U32 mRenderedDecodedData; + U32 mFetchedPixels; + U32 mRenderedPixels; + U32 mRefetchedData; + U32 mRefetchedPixels; + BOOL mFreezeHistory; public: bool update(); //called in the main thread once per frame @@ -322,6 +334,8 @@ public: void debugHTTP(); void debugDecoder(); void debugGLTextureCreation(); + void debugRefetchVisibleFromCache(); + void debugRefetchVisibleFromHTTP(); void callbackCacheRead(S32 id, bool success, LLImageFormatted* image, S32 imagesize, BOOL islocal); @@ -340,6 +354,10 @@ public: U32 getVisibleDecodedData() {return mVisibleDecodedData;} U32 getRenderedData() {return mRenderedData;} U32 getRenderedDecodedData() {return mRenderedDecodedData;} + U32 getFetchedPixels() {return mFetchedPixels;} + U32 getRenderedPixels() {return mRenderedPixels;} + U32 getRefetchedData() {return mRefetchedData;} + U32 getRefetchedPixels() {return mRefetchedPixels;} F32 getCacheReadTime() {return mCacheReadTime;} F32 getCacheWriteTime() {return mCacheWriteTime;} @@ -347,9 +365,13 @@ public: F32 getGLCreationTime() {return mGLCreationTime;} F32 getHTTPTime() {return mHTTPTime;} F32 getTotalFetchingTime() {return mTotalFetchingTime;} + F32 getRefetchVisCacheTime() {return mRefetchVisCacheTime;} + F32 getRefetchVisHTTPTime() {return mRefetchVisHTTPTime;} private: void init(); + void clearTextures();//clear fetching results of all textures. + void clearCache(); void lockFetcher(); void unlockFetcher(); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 49faae3fdb..a7e2ed85fa 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2144,6 +2144,14 @@ bool LLViewerFetchedTexture::updateFetch() return mIsFetching ? true : false; } +void LLViewerFetchedTexture::clearFetchedResults() +{ + llassert_always(!mNeedsCreateTexture && !mIsFetching); + + cleanup(); + destroyGLTexture(); +} + void LLViewerFetchedTexture::forceToDeleteRequest() { if (mHasFetcher) diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index d0bc534c5a..95896f9d41 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -433,6 +433,8 @@ public: bool updateFetch(); + void clearFetchedResults(); //clear all fetched results, for debug use. + // Override the computation of discard levels if we know the exact output // size of the image. Used for UI textures to not decode, even if we have // more data. diff --git a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml index ff7528eeb7..7f95d0e84b 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml @@ -2,12 +2,12 @@ + width="540"> - 6, Total number of fetched data/Decoded Data: [SIZE1]KB / [SIZE2]KB + width="530"> + 6, Total number of fetched data: [SIZE1]KB, Decoded Data: [SIZE2]KB, [PIXEL]MPixels - 7, Total number of visible fetched data/Decoded Data: [SIZE1]KB / [SIZE2]KB + 7, Total number of visible data: [SIZE1]KB, Decoded Data: [SIZE2]KB - 8, Total number of rendered fetched data/Decoded Data: [SIZE1]KB / [SIZE2]KB + width="530"> + 8, Total number of rendered data: [SIZE1]KB, Decoded Data: [SIZE2]KB, [PIXEL]MPixels 14, Total time on entire fetching: [TIME] seconds + + 15, Refetching visibles from cache, Time: [TIME] seconds, Fetched: [SIZE]KB, [PIXEL]MPixels + + + 16, Refetching visibles from HTTP, Time: [TIME] seconds, Fetched: [SIZE]KB, [PIXEL]MPixels + + + -- cgit v1.2.3 From 1df7655588a26529882a0ec97a7f23195f813468 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 26 Apr 2012 16:55:06 -0600 Subject: for SH-3097: introducing texel pixel ration adjustment --- indra/newview/app_settings/settings.xml | 13 ++++++++++++- indra/newview/llfloatertexturefetchdebugger.cpp | 8 ++++---- indra/newview/llfloatertexturefetchdebugger.h | 3 +-- indra/newview/llviewertexture.cpp | 3 +++ .../skins/default/xui/en/floater_texture_fetch_debugger.xml | 5 +++-- 5 files changed, 23 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eb3fcc30ee..d24d1ebd6d 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10631,6 +10631,17 @@ Value 20.0 + TexelPixelRatio + + Comment + texel pixel ratio = texel / pixel + Persist + 1 + Type + F32 + Value + 1.0 + TextureCameraMotionThreshold Comment @@ -10640,7 +10651,7 @@ Type F32 Value - 0.2 + 0.2 TextureCameraMotionBoost diff --git a/indra/newview/llfloatertexturefetchdebugger.cpp b/indra/newview/llfloatertexturefetchdebugger.cpp index 448c562134..2b34b72055 100644 --- a/indra/newview/llfloatertexturefetchdebugger.cpp +++ b/indra/newview/llfloatertexturefetchdebugger.cpp @@ -37,9 +37,7 @@ #include "llviewerwindow.h" #include "llappviewer.h" #include "lltexturefetch.h" - -//static -F32 LLFloaterTextureFetchDebugger::sTexelPixelRatio = 1.0f; +#include "llviewercontrol.h" LLFloaterTextureFetchDebugger::LLFloaterTextureFetchDebugger(const LLSD& key) : LLFloater(key), @@ -83,6 +81,8 @@ BOOL LLFloaterTextureFetchDebugger::postBuild(void) updateButtons(); + getChild("texel_pixel_ratio")->setValue(gSavedSettings.getF32("TexelPixelRatio")); + return TRUE ; } @@ -165,7 +165,7 @@ void LLFloaterTextureFetchDebugger::idle() //---------------------- void LLFloaterTextureFetchDebugger::onChangeTexelPixelRatio() { - sTexelPixelRatio = getChild("texel_pixel_ratio")->getValue().asReal(); + gSavedSettings.setF32("TexelPixelRatio", getChild("texel_pixel_ratio")->getValue().asReal()); } void LLFloaterTextureFetchDebugger::onClickStart() diff --git a/indra/newview/llfloatertexturefetchdebugger.h b/indra/newview/llfloatertexturefetchdebugger.h index 7181dc04d5..33012c6a3d 100644 --- a/indra/newview/llfloatertexturefetchdebugger.h +++ b/indra/newview/llfloatertexturefetchdebugger.h @@ -62,9 +62,8 @@ private: void updateButtons(); void disableButtons(); -private: - static F32 sTexelPixelRatio; +private: LLTextureFetchDebugger* mDebugger; std::map mButtonStateMap; }; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a7e2ed85fa..6137b7176f 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -722,11 +722,14 @@ void LLViewerTexture::forceImmediateUpdate() void LLViewerTexture::addTextureStats(F32 virtual_size, BOOL needs_gltexture) const { + static LLCachedControl sTexelPixelRatio(gSavedSettings,"TexelPixelRatio"); + if(needs_gltexture) { mNeedsGLTexture = TRUE ; } + virtual_size *= sTexelPixelRatio; if(!mMaxVirtualSizeResetCounter) { //flag to reset the values because the old values are used. diff --git a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml index 7f95d0e84b..0e8b85e3a7 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml @@ -204,13 +204,14 @@ decimal_digits="1" follows="left|top" height="20" - increment="0.1" + increment="0.01" initial_value="1.0" label="17, Ratio of Texel/Pixel:" label_width="130" layout="topleft" left_delta="0" - max_val="128.0" + max_val="10.0" + min_val="0.01" name="texel_pixel_ratio" top_delta="30" width="200"> -- cgit v1.2.3 From e703232cae0e692c813ba119e283ffd2d150fec8 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Thu, 26 Apr 2012 18:01:17 -0600 Subject: a fix for SH-3097 --- indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml index 0e8b85e3a7..44b6a63bca 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_fetch_debugger.xml @@ -201,7 +201,7 @@ 16, Refetching visibles from HTTP, Time: [TIME] seconds, Fetched: [SIZE]KB, [PIXEL]MPixels Date: Thu, 26 Apr 2012 23:55:40 -0700 Subject: SH-3104 : Implemented HTTP bulk fetch for texture debug console --- indra/newview/lltexturefetch.cpp | 136 ++++++++++++++++++++++++++++++++++++++- indra/newview/lltexturefetch.h | 24 ++++++- 2 files changed, 154 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index d7742219bf..8b6f006db1 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3114,6 +3114,42 @@ private: S32 mID; }; +class LLDebuggerHTTPResponder : public LLCurl::Responder +{ +public: + LLDebuggerHTTPResponder(LLTextureFetchDebugger* debugger, S32 index) + : mDebugger(debugger), mIndex(index) + { + } + virtual void completedRaw(U32 status, const std::string& reason, + const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer) + { + bool success = false; + bool partial = false; + if (HTTP_OK <= status && status < HTTP_MULTIPLE_CHOICES) + { + success = true; + if (HTTP_PARTIAL_CONTENT == status) // partial information + { + partial = true; + } + } + if (!success) + { + llinfos << "Fetch Debugger : CURL GET FAILED, index = " << mIndex << ", status:" << status << " reason:" << reason << llendl; + } + mDebugger->callbackHTTP(mIndex, channels, buffer, partial, success); + } + virtual bool followRedir() + { + return true; + } +private: + LLTextureFetchDebugger* mDebugger; + S32 mIndex; +}; + LLTextureFetchDebugger::LLTextureFetchDebugger(LLTextureFetch* fetcher, LLTextureCache* cache, LLImageDecodeThread* imagedecodethread) : mFetcher(fetcher), mTextureCache(cache), @@ -3272,7 +3308,7 @@ void LLTextureFetchDebugger::addHistoryEntry(LLTextureFetchWorker* worker) mFetchedData += worker->mFormattedImage->getDataSize(); mDecodedData += worker->mRawImage->getDataSize(); - mFetchingHistory.push_back(FetchEntry(worker->mID, worker->mDecodedDiscard, worker->mFormattedImage->getDataSize(), worker->mRawImage->getDataSize())); + mFetchingHistory.push_back(FetchEntry(worker->mID, worker->mDesiredSize, worker->mDecodedDiscard, worker->mFormattedImage->getDataSize(), worker->mRawImage->getDataSize())); //mFetchingHistory.push_back(FetchEntry(worker->mID, worker->mDesiredSize, worker->mHaveAllData ? 0 : worker->mLoadedDiscard, worker->mFormattedImage->getComponents(), //worker->mDecodedDiscard, worker->mFormattedImage->getDataSize(), worker->mRawImage->getDataSize())); } @@ -3362,7 +3398,71 @@ void LLTextureFetchDebugger::debugDecoder() void LLTextureFetchDebugger::debugHTTP() { - llinfos << "debug HTTP" << llendl; + llassert_always(mState == IDLE); + + LLViewerRegion* region = gAgent.getRegion(); + if (!region) + { + llinfos << "Fetch Debugger : Current region undefined. Cannot fetch textures through HTTP." << llendl; + return; + } + + mHTTPUrl = region->getHttpUrl(); + if (mHTTPUrl.empty()) + { + llinfos << "Fetch Debugger : Current region URL undefined. Cannot fetch textures through HTTP." << llendl; + return; + } + + mTimer.reset(); + mState = HTTP_FETCHING; + + S32 size = mFetchingHistory.size(); + for (S32 i = 0 ; i < size ; i++) + { + mFetchingHistory[i].mCurlState = FetchEntry::CURL_NOT_DONE; + mFetchingHistory[i].mCurlReceivedSize = 0; + } + mNbCurlRequests = 0; + mNbCurlCompleted = 0; + + fillCurlQueue(); +} + +S32 LLTextureFetchDebugger::fillCurlQueue() +{ + if (mNbCurlRequests == 24) + return mNbCurlRequests; + + S32 size = mFetchingHistory.size(); + for (S32 i = 0 ; i < size ; i++) + { + if (mFetchingHistory[i].mCurlState != FetchEntry::CURL_NOT_DONE) + continue; + std::string texture_url = mHTTPUrl + "/?texture_id=" + mFetchingHistory[i].mID.asString().c_str(); + S32 requestedSize = mFetchingHistory[i].mRequestedSize; + // We request the whole file if the size was not set. + requestedSize = llmax(0,requestedSize); + // We request the whole file if the size was set to an absurdly high value (meaning all file) + requestedSize = (requestedSize == 33554432 ? 0 : requestedSize); + std::vector headers; + headers.push_back("Accept: image/x-j2c"); + bool res = mCurlGetRequest->getByteRange(texture_url, headers, 0, requestedSize, new LLDebuggerHTTPResponder(this, i)); + if (res) + { + mFetchingHistory[i].mCurlState = FetchEntry::CURL_IN_PROGRESS; + mNbCurlRequests++; + // Hack + if (mNbCurlRequests == 24) + break; + } + else + { + break; + } + } + llinfos << "Fetch Debugger : Having " << mNbCurlRequests << " requests through the curl thread." << llendl; + return mNbCurlRequests; } void LLTextureFetchDebugger::debugGLTextureCreation() @@ -3432,7 +3532,13 @@ bool LLTextureFetchDebugger::update() } break; case HTTP_FETCHING: - mState = IDLE; + mCurlGetRequest->process(); + LLCurl::getCurlThread()->update(1); + if (!fillCurlQueue()) + { + mHTTPTime = mTimer.getElapsedTimeF32() ; + mState = IDLE; + } break; case GL_TEX: mState = IDLE; @@ -3471,6 +3577,30 @@ void LLTextureFetchDebugger::callbackDecoded(S32 id, bool success, LLImageRaw* r } } +void LLTextureFetchDebugger::callbackHTTP(S32 id, const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer, + bool partial, bool success) +{ + mNbCurlRequests--; + if (success) + { + S32 data_size = buffer->countAfter(channels.in(), NULL); + mFetchingHistory[id].mCurlReceivedSize += data_size; + llinfos << "Fetch Debugger : got results for " << id << ", data_size = " << data_size << ", received = " << mFetchingHistory[id].mCurlReceivedSize << ", requested = " << mFetchingHistory[id].mRequestedSize << ", partial = " << partial << llendl; + if ((mFetchingHistory[id].mCurlReceivedSize >= mFetchingHistory[id].mRequestedSize) || !partial || (mFetchingHistory[id].mRequestedSize == 600)) + { + mFetchingHistory[id].mCurlState = FetchEntry::CURL_DONE; + mNbCurlCompleted++; + } + } + else + { + // Fetch will have to be redone + mFetchingHistory[id].mCurlState = FetchEntry::CURL_NOT_DONE; + } +} + + //--------------------- /////////////////////////////////////////////////////////////////////////////////////////// //End LLTextureFetchDebugger diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 529a2e6834..892857c816 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -249,8 +249,14 @@ public: private: struct FetchEntry { + enum e_curl_state + { + CURL_NOT_DONE = 0, + CURL_IN_PROGRESS, + CURL_DONE + }; LLUUID mID; - //S32 mRequestedSize; + S32 mRequestedSize; //S32 mFetchedDiscard; //S32 mComponents; S32 mDecodedLevel; @@ -260,15 +266,17 @@ private: U32 mCacheHandle; LLPointer mFormattedImage; LLPointer mRawImage; + e_curl_state mCurlState; + S32 mCurlReceivedSize; FetchEntry() : mDecodedLevel(-1), mFetchedSize(0), mDecodedSize(0) {} - FetchEntry(LLUUID& id, /*S32 r_size, S32 f_discard, S32 c,*/ S32 level, S32 f_size, S32 d_size) : + FetchEntry(LLUUID& id, S32 r_size, /*S32 f_discard, S32 c,*/ S32 level, S32 f_size, S32 d_size) : mID(id), - //mRequestedSize(r_size), + mRequestedSize(r_size), //mFetchedDiscard(f_discard), //mComponents(c), mDecodedLevel(level), @@ -306,6 +314,10 @@ private: U32 mRenderedData; U32 mRenderedDecodedData; + std::string mHTTPUrl; + S32 mNbCurlRequests; + S32 mNbCurlCompleted; + public: bool update(); //called in the main thread once per frame @@ -327,6 +339,10 @@ public: S32 imagesize, BOOL islocal); void callbackCacheWrite(S32 id, bool success); void callbackDecoded(S32 id, bool success, LLImageRaw* raw, LLImageRaw* aux); + void callbackHTTP(S32 id, const LLChannelDescriptors& channels, + const LLIOPipe::buffer_ptr_t& buffer, + bool partial, bool success); + e_debug_state getState() {return mState;} S32 getNumFetchedTextures() {return mNumFetchedTextures;} @@ -359,6 +375,8 @@ private: void lockDecoder(); void unlockDecoder(); + + S32 fillCurlQueue(); }; #endif // LL_LLTEXTUREFETCH_H -- cgit v1.2.3 From ed78cc00008b13e4a108635e851b9936688647d0 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 27 Apr 2012 12:43:14 -0600 Subject: fix some flaws for SH-3104 --- indra/newview/lltexturefetch.cpp | 46 ++++++++++++++++++++++++++++++++-------- indra/newview/lltexturefetch.h | 8 +++---- 2 files changed, 40 insertions(+), 14 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 0906626743..f2d8c27db7 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3448,6 +3448,7 @@ void LLTextureFetchDebugger::debugHTTP() { mFetchingHistory[i].mCurlState = FetchEntry::CURL_NOT_DONE; mFetchingHistory[i].mCurlReceivedSize = 0; + mFetchingHistory[i].mHTTPFailCount = 0; } mNbCurlRequests = 0; mNbCurlCompleted = 0; @@ -3487,7 +3488,7 @@ S32 LLTextureFetchDebugger::fillCurlQueue() break; } } - llinfos << "Fetch Debugger : Having " << mNbCurlRequests << " requests through the curl thread." << llendl; + //llinfos << "Fetch Debugger : Having " << mNbCurlRequests << " requests through the curl thread." << llendl; return mNbCurlRequests; } @@ -3513,7 +3514,8 @@ void LLTextureFetchDebugger::debugGLTextureCreation() mTimer.reset(); S32 j = 0 ; - for(S32 i = 0 ; i < size ; i++) + S32 size1 = tex_list.size(); + for(S32 i = 0 ; i < size && j < size1; i++) { if(mFetchingHistory[i].mRawImage.notNull()) { @@ -3597,7 +3599,7 @@ bool LLTextureFetchDebugger::update() case HTTP_FETCHING: mCurlGetRequest->process(); LLCurl::getCurlThread()->update(1); - if (!fillCurlQueue()) + if (!fillCurlQueue() && mNbCurlCompleted == mFetchingHistory.size()) { mHTTPTime = mTimer.getElapsedTimeF32() ; mState = IDLE; @@ -3663,19 +3665,45 @@ void LLTextureFetchDebugger::callbackHTTP(S32 id, const LLChannelDescriptors& ch mNbCurlRequests--; if (success) { + mFetchingHistory[id].mCurlState = FetchEntry::CURL_DONE; + mNbCurlCompleted++; + S32 data_size = buffer->countAfter(channels.in(), NULL); mFetchingHistory[id].mCurlReceivedSize += data_size; - llinfos << "Fetch Debugger : got results for " << id << ", data_size = " << data_size << ", received = " << mFetchingHistory[id].mCurlReceivedSize << ", requested = " << mFetchingHistory[id].mRequestedSize << ", partial = " << partial << llendl; + //llinfos << "Fetch Debugger : got results for " << id << ", data_size = " << data_size << ", received = " << mFetchingHistory[id].mCurlReceivedSize << ", requested = " << mFetchingHistory[id].mRequestedSize << ", partial = " << partial << llendl; if ((mFetchingHistory[id].mCurlReceivedSize >= mFetchingHistory[id].mRequestedSize) || !partial || (mFetchingHistory[id].mRequestedSize == 600)) { - mFetchingHistory[id].mCurlState = FetchEntry::CURL_DONE; - mNbCurlCompleted++; + U8* d_buffer = (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), data_size); + buffer->readAfter(channels.in(), NULL, d_buffer, data_size); + + llassert_always(mFetchingHistory[id].mFormattedImage.isNull()); + { + // For now, create formatted image based on extension + std::string texture_url = mHTTPUrl + "/?texture_id=" + mFetchingHistory[id].mID.asString().c_str(); + std::string extension = gDirUtilp->getExtension(texture_url); + mFetchingHistory[id].mFormattedImage = LLImageFormatted::createFromType(LLImageBase::getCodecFromExtension(extension)); + if (mFetchingHistory[id].mFormattedImage.isNull()) + { + mFetchingHistory[id].mFormattedImage = new LLImageJ2C; // default + } + } + + mFetchingHistory[id].mFormattedImage->setData(d_buffer, data_size); } } - else + else //failed { - // Fetch will have to be redone - mFetchingHistory[id].mCurlState = FetchEntry::CURL_NOT_DONE; + mFetchingHistory[id].mHTTPFailCount++; + if(mFetchingHistory[id].mHTTPFailCount < 5) + { + // Fetch will have to be redone + mFetchingHistory[id].mCurlState = FetchEntry::CURL_NOT_DONE; + } + else //skip + { + mFetchingHistory[id].mCurlState = FetchEntry::CURL_DONE; + mNbCurlCompleted++; + } } } diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 1538fd78ab..3b08389042 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -261,8 +261,6 @@ private: }; LLUUID mID; S32 mRequestedSize; - //S32 mFetchedDiscard; - //S32 mComponents; S32 mDecodedLevel; S32 mFetchedSize; S32 mDecodedSize; @@ -272,6 +270,7 @@ private: LLPointer mRawImage; e_curl_state mCurlState; S32 mCurlReceivedSize; + S32 mHTTPFailCount; FetchEntry() : mDecodedLevel(-1), @@ -281,12 +280,11 @@ private: FetchEntry(LLUUID& id, S32 r_size, /*S32 f_discard, S32 c,*/ S32 level, S32 f_size, S32 d_size) : mID(id), mRequestedSize(r_size), - //mFetchedDiscard(f_discard), - //mComponents(c), mDecodedLevel(level), mFetchedSize(f_size), mDecodedSize(d_size), - mNeedsAux(false) + mNeedsAux(false), + mHTTPFailCount(0) {} }; std::vector mFetchingHistory; -- cgit v1.2.3 From 9c4380a03a7b9d18cdd44662ca56cf44c4766e6f Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 27 Apr 2012 14:27:48 -0600 Subject: fix a crash on cache write --- indra/newview/lltexturefetch.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index f2d8c27db7..59a125dcc5 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -3386,10 +3386,13 @@ void LLTextureFetchDebugger::debugCacheWrite() S32 size = mFetchingHistory.size(); for(S32 i = 0 ; i < size ; i++) { - mFetchingHistory[i].mCacheHandle = mTextureCache->writeToCache(mFetchingHistory[i].mID, LLWorkerThread::PRIORITY_NORMAL, - mFetchingHistory[i].mFormattedImage->getData(), mFetchingHistory[i].mFetchedSize, - mFetchingHistory[i].mDecodedLevel == 0 ? mFetchingHistory[i].mFetchedSize : mFetchingHistory[i].mFetchedSize + 1, - new LLDebuggerCacheWriteResponder(this, i)); + if(mFetchingHistory[i].mFormattedImage.notNull()) + { + mFetchingHistory[i].mCacheHandle = mTextureCache->writeToCache(mFetchingHistory[i].mID, LLWorkerThread::PRIORITY_NORMAL, + mFetchingHistory[i].mFormattedImage->getData(), mFetchingHistory[i].mFetchedSize, + mFetchingHistory[i].mDecodedLevel == 0 ? mFetchingHistory[i].mFetchedSize : mFetchingHistory[i].mFetchedSize + 1, + new LLDebuggerCacheWriteResponder(this, i)); + } } } -- cgit v1.2.3 From 3a9aa29a44f8b20ff9aa5c5eeaf7efccc81ae608 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 27 Apr 2012 16:38:16 -0600 Subject: fix for a crash on "refetch vis cache" --- indra/newview/llviewertexture.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6137b7176f..1b468a7b96 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1305,6 +1305,7 @@ void LLViewerFetchedTexture::cleanup() mCachedRawDiscardLevel = -1 ; mCachedRawImageReady = FALSE ; mSavedRawImage = NULL ; + mSavedRawDiscardLevel = -1; } void LLViewerFetchedTexture::setForSculpt() -- cgit v1.2.3 From 164de6c1807a5517cbd2ccf7d16b536aa333e64a Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 27 Apr 2012 18:32:42 -0600 Subject: fix for a crash on sculpt --- indra/llrender/llimagegl.cpp | 4 ++-- indra/newview/llviewertexture.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index ab744fb7ff..bd9953e418 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1464,10 +1464,10 @@ void LLImageGL::destroyGLTexture() } LLImageGL::deleteTextures(1, &mTexName); - mTexName = 0; - mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. + mTexName = 0; mGLTextureCreated = FALSE ; } + mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 1b468a7b96..f27e20c2a2 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1146,7 +1146,7 @@ S32 LLViewerTexture::getDiscardLevelInAtlas() const void LLViewerTexture::destroyGLTexture() { - if(mGLTexturep.notNull() && mGLTexturep->getHasGLTexture()) + if(mGLTexturep.notNull()) { mGLTexturep->destroyGLTexture() ; mTextureState = DELETED ; -- cgit v1.2.3 From 3f31c82a1c7a9419891ff2c7b81324e99414395e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 30 Apr 2012 17:44:44 -0700 Subject: SH-3124 : Fix crash on exit on Mac --- indra/newview/llviewertexture.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index f27e20c2a2..a889cd9637 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -390,6 +390,7 @@ void LLViewerTextureManager::cleanup() LLImageGL::sDefaultGLTexture = NULL ; LLViewerTexture::sNullImagep = NULL; LLViewerTexture::sBlackImagep = NULL; + LLViewerTexture::sCheckerBoardImagep = NULL; LLViewerFetchedTexture::sDefaultImagep = NULL; LLViewerFetchedTexture::sSmokeImagep = NULL; LLViewerFetchedTexture::sMissingAssetImagep = NULL; @@ -2156,16 +2157,16 @@ void LLViewerFetchedTexture::clearFetchedResults() destroyGLTexture(); } -void LLViewerFetchedTexture::forceToDeleteRequest() -{ - if (mHasFetcher) - { - LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); - mHasFetcher = FALSE; - mIsFetching = FALSE ; - resetTextureStats(); - } -} +void LLViewerFetchedTexture::forceToDeleteRequest() +{ + if (mHasFetcher) + { + LLAppViewer::getTextureFetch()->deleteRequest(getID(), true); + mHasFetcher = FALSE; + mIsFetching = FALSE ; + resetTextureStats(); + } +} void LLViewerFetchedTexture::setIsMissingAsset() { -- cgit v1.2.3 From c0855030de1e0811b3db8b8d98d089956fda24c8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 30 Apr 2012 19:10:55 -0700 Subject: Fix sculpties being deleted while being still in use in the scene --- indra/newview/llviewertexture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index a889cd9637..90ba21ef34 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1147,7 +1147,7 @@ S32 LLViewerTexture::getDiscardLevelInAtlas() const void LLViewerTexture::destroyGLTexture() { - if(mGLTexturep.notNull()) + if(mGLTexturep.notNull() && mGLTexturep->getHasGLTexture()) { mGLTexturep->destroyGLTexture() ; mTextureState = DELETED ; -- cgit v1.2.3 From aa44ec81e18fa91e718e1a22606b3f385bb8170f Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 1 May 2012 16:49:28 -0600 Subject: for SH-3118: add a toggle "TextureFetchDebuggerEnabled" to turn the console on and off. --- indra/newview/app_settings/settings.xml | 11 ++++++++++ indra/newview/llappviewer.cpp | 13 +++++++----- indra/newview/lltexturefetch.cpp | 23 ++++++++++++++++----- indra/newview/lltexturefetch.h | 6 ++++++ indra/newview/llviewerfloaterreg.cpp | 6 +++++- indra/newview/llviewermenu.cpp | 11 ++++++++++ indra/newview/llviewertexture.cpp | 5 +++-- indra/newview/llviewertexture.h | 1 + indra/newview/skins/default/xui/en/menu_viewer.xml | 24 ++++++++++++++-------- 9 files changed, 78 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d24d1ebd6d..c2f3d244f3 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10697,6 +10697,17 @@ Value 0 + TextureFetchDebuggerEnabled + + Comment + Enable the texture fetching debugger if set + Persist + 1 + Type + Boolean + Value + 0 + TextureLoadFullRes Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index bb6658dc48..178b96e42e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1405,12 +1405,15 @@ bool LLAppViewer::mainLoop() } //texture fetching debugger - LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = - LLFloaterReg::findTypedInstance("tex_fetch_debugger"); - if(tex_fetch_debugger_instance) + if(LLTextureFetchDebugger::isEnabled()) { - tex_fetch_debugger_instance->idle() ; - } + LLFloaterTextureFetchDebugger* tex_fetch_debugger_instance = + LLFloaterReg::findTypedInstance("tex_fetch_debugger"); + if(tex_fetch_debugger_instance) + { + tex_fetch_debugger_instance->idle() ; + } + } if ((LLStartUp::getStartupState() >= STATE_CLEANUP) && (frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD)) diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 59a125dcc5..efb6ed6079 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -56,6 +56,7 @@ #include "llstartup.h" #include "llviewerstats.h" +bool LLTextureFetchDebugger::sDebuggerEnabled = false ; LLStat LLTextureFetch::sCacheHitRate("texture_cache_hits", 128); LLStat LLTextureFetch::sCacheReadLatency("texture_cache_read_latency", 128); @@ -1424,7 +1425,7 @@ bool LLTextureFetchWorker::doWork(S32 param) { if (mDecoded) { - if(!mInLocalCache) + if(mFetcher->getFetchDebugger() && !mInLocalCache) { mFetcher->getFetchDebugger()->addHistoryEntry(this); } @@ -1858,13 +1859,18 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mHTTPTextureBits(0), mTotalHTTPRequests(0), mCurlGetRequest(NULL), - mQAMode(qa_mode) + mQAMode(qa_mode), + mFetchDebugger(NULL) { mCurlPOSTRequestCount = 0; mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold")); - mFetchDebugger = new LLTextureFetchDebugger(this, cache, imagedecodethread) ; + LLTextureFetchDebugger::sDebuggerEnabled = gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"); + if(LLTextureFetchDebugger::isEnabled()) + { + mFetchDebugger = new LLTextureFetchDebugger(this, cache, imagedecodethread) ; + } } LLTextureFetch::~LLTextureFetch() @@ -2311,7 +2317,11 @@ void LLTextureFetch::startThread() { // Construct mCurlGetRequest from Worker Thread mCurlGetRequest = new LLCurlRequest(); - mFetchDebugger->setCurlGetRequest(mCurlGetRequest); + + if(mFetchDebugger) + { + mFetchDebugger->setCurlGetRequest(mCurlGetRequest); + } } // WORKER THREAD @@ -2320,7 +2330,10 @@ void LLTextureFetch::endThread() // Destroy mCurlGetRequest from Worker Thread delete mCurlGetRequest; mCurlGetRequest = NULL; - mFetchDebugger->setCurlGetRequest(NULL); + if(mFetchDebugger) + { + mFetchDebugger->setCurlGetRequest(NULL); + } } // WORKER THREAD diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 3b08389042..107e1623b0 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -230,6 +230,7 @@ public: //debug use class LLTextureFetchDebugger { + friend class LLTextureFetch; public: LLTextureFetchDebugger(LLTextureFetch* fetcher, LLTextureCache* cache, LLImageDecodeThread* imagedecodethread) ; ~LLTextureFetchDebugger(); @@ -398,6 +399,11 @@ private: void unlockDecoder(); S32 fillCurlQueue(); + +private: + static bool sDebuggerEnabled; +public: + static bool isEnabled() {return sDebuggerEnabled;} }; #endif // LL_LLTEXTUREFETCH_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 986b8ac3c5..a7ca7a0836 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -228,7 +228,11 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("tex_fetch_debugger", "floater_texture_fetch_debugger.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + + if(gSavedSettings.getBOOL("TextureFetchDebuggerEnabled")) + { + LLFloaterReg::add("tex_fetch_debugger", "floater_texture_fetch_debugger.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + } LLFloaterReg::add("media_settings", "floater_media_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("message_critical", "floater_critical.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("message_tos", "floater_tos.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 7bdfd6df1d..2a3ba4e603 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2286,6 +2286,14 @@ class LLDevelopSetLoggingLevel : public view_listener_t } }; +class LLDevelopTextureFetchDebugger : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return gSavedSettings.getBOOL("TextureFetchDebuggerEnabled"); + } +}; + ////////////////// // ADMIN MENU // ////////////////// @@ -8308,6 +8316,9 @@ void initialize_menus() // Develop >Set logging level view_listener_t::addMenu(new LLDevelopCheckLoggingLevel(), "Develop.CheckLoggingLevel"); view_listener_t::addMenu(new LLDevelopSetLoggingLevel(), "Develop.SetLoggingLevel"); + + //Develop (Texture Fetch Debug Console) + view_listener_t::addMenu(new LLDevelopTextureFetchDebugger(), "Develop.SetTexFetchDebugger"); // Admin >Object view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy"); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 90ba21ef34..d83a595220 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -98,6 +98,8 @@ S32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA ; BOOL LLViewerTexture::sFreezeImageScalingDown = FALSE ; F32 LLViewerTexture::sCurrentTime = 0.0f ; BOOL LLViewerTexture::sUseTextureAtlas = FALSE ; +F32 LLViewerTexture::sTexelPixelRatio = 1.0f; + LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF; const F32 desired_discard_bias_min = -2.0f; // -max number of levels to improve image quality by @@ -407,6 +409,7 @@ void LLViewerTextureManager::cleanup() void LLViewerTexture::initClass() { LLImageGL::sDefaultGLTexture = LLViewerFetchedTexture::sDefaultImagep->getGLTexture() ; + sTexelPixelRatio = gSavedSettings.getF32("TexelPixelRatio"); } // static @@ -723,8 +726,6 @@ void LLViewerTexture::forceImmediateUpdate() void LLViewerTexture::addTextureStats(F32 virtual_size, BOOL needs_gltexture) const { - static LLCachedControl sTexelPixelRatio(gSavedSettings,"TexelPixelRatio"); - if(needs_gltexture) { mNeedsGLTexture = TRUE ; diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 95896f9d41..41bf625225 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -310,6 +310,7 @@ protected: } LLGLTextureState; LLGLTextureState mTextureState ; + static F32 sTexelPixelRatio; public: static const U32 sCurrentFileVersion; static S32 sImageCount; diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index a1f17ffc17..5d46b0f98d 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1876,14 +1876,7 @@ - - - - + - + + + + + + Date: Tue, 1 May 2012 21:29:19 -0600 Subject: fix a sculpt crash --- indra/llrender/llimagegl.cpp | 17 ++++++++++++++--- indra/llrender/llimagegl.h | 1 + indra/newview/llviewertexture.cpp | 5 +++++ 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index bd9953e418..2c13fead97 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1464,13 +1464,24 @@ void LLImageGL::destroyGLTexture() } LLImageGL::deleteTextures(1, &mTexName); + mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. mTexName = 0; mGLTextureCreated = FALSE ; - } - mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. + } } - +//force to invalidate the gl texture, most likely a sculpty texture +void LLImageGL::forceToInvalidateGLTexture() +{ + if (mTexName != 0) + { + destroyGLTexture(); + } + else + { + mCurrentDiscardLevel = -1 ; //invalidate mCurrentDiscardLevel. + } +} //---------------------------------------------------------------------------- diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h index 2060be914b..e515d6b324 100755 --- a/indra/llrender/llimagegl.h +++ b/indra/llrender/llimagegl.h @@ -114,6 +114,7 @@ public: // Read back a raw image for this discard level, if it exists BOOL readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compressed_ok) const; void destroyGLTexture(); + void forceToInvalidateGLTexture(); void setExplicitFormat(LLGLint internal_format, LLGLenum primary_format, LLGLenum type_format = 0, BOOL swap_bytes = FALSE); void setComponents(S8 ncomponents) { mComponents = ncomponents; } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index d83a595220..ea329f6aac 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -2156,6 +2156,11 @@ void LLViewerFetchedTexture::clearFetchedResults() cleanup(); destroyGLTexture(); + + if(getDiscardLevel() >= 0) //sculpty texture, force to invalidate + { + mGLTexturep->forceToInvalidateGLTexture(); + } } void LLViewerFetchedTexture::forceToDeleteRequest() -- cgit v1.2.3 From 681c5de92bd09622de360818682240b0a17403f7 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 2 May 2012 16:48:09 -0400 Subject: SH-3128 FIX - log message cleanup for avatar rezzing --- indra/newview/app_settings/logcontrol.xml | 7 ++++--- indra/newview/llagent.cpp | 4 ++-- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llappearancemgr.cpp | 34 +++++++++++++++---------------- indra/newview/llviewerinventory.cpp | 4 ++-- indra/newview/llvoavatar.cpp | 24 +++++++++++----------- indra/newview/llvoavatarself.cpp | 10 +++++---- 7 files changed, 44 insertions(+), 41 deletions(-) mode change 100644 => 100755 indra/newview/llappearancemgr.cpp mode change 100644 => 100755 indra/newview/llviewerinventory.cpp (limited to 'indra') diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 81e0b5602c..64122bbb6c 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -42,9 +42,10 @@ tags - Avatar - - + diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e74b7281fd..3367604753 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -3786,7 +3786,7 @@ void LLAgent::sendAgentSetAppearance() } gAgentAvatarp->sendAppearanceChangeMetrics(); - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sent AgentSetAppearance: " << gAgentAvatarp->getBakedStatusForPrintout() << LL_ENDL; //dumpAvatarTEs( "sendAgentSetAppearance()" ); LLMessageSystem* msg = gMessageSystem; @@ -3833,7 +3833,7 @@ void LLAgent::sendAgentSetAppearance() // only update cache entries if we have all our baked textures if (textures_current) { - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "TAT: Sending cached texture data" << LL_ENDL; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { BOOL generate_valid_hash = TRUE; diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 1aae1714f7..e441f21f90 100755 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -1645,7 +1645,7 @@ void LLAgentWearables::queryWearableCache() gAgentAvatarp->outputRezTiming("Fetching textures from cache"); } - LL_DEBUGS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; + LL_INFOS("Avatar") << gAgentAvatarp->avString() << "Requesting texture cache entry for " << num_queries << " baked textures" << LL_ENDL; gMessageSystem->sendReliable(gAgent.getRegion()->getHost()); gAgentQueryManager.mNumPendingQueries++; gAgentQueryManager.mWearablesCacheQueryID++; diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp old mode 100644 new mode 100755 index 73dd64dffe..faadfb4b87 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -162,7 +162,7 @@ public: mCatID = cat_id; mAppend = append; - LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; selfStartPhase("wear_inventory_category_callback"); } @@ -182,7 +182,7 @@ public: protected: ~LLWearInventoryCategoryCallback() { - LL_DEBUGS("Avatar") << self_av_string() << "done all inventory callbacks" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "done all inventory callbacks" << LL_ENDL; selfStopPhase("wear_inventory_category_callback"); @@ -229,7 +229,7 @@ LLUpdateAppearanceOnDestroy::LLUpdateAppearanceOnDestroy(bool update_base_outfit LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy() { - LL_DEBUGS("Avatar") << self_av_string() << "done update appearance on destroy" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "done update appearance on destroy" << LL_ENDL; selfStopPhase("update_appearance_on_destroy"); @@ -492,7 +492,7 @@ void LLWearableHoldingPattern::onAllComplete() } // Update wearables. - LL_DEBUGS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "Updating agent wearables with " << mResolved << " wearable items " << LL_ENDL; LLAppearanceMgr::instance().updateAgentWearables(this, false); // Update attachments to match those requested. @@ -542,7 +542,7 @@ bool LLWearableHoldingPattern::pollFetchCompletion() if (done) { - LL_DEBUGS("Avatar") << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out + LL_INFOS("Avatar") << self_av_string() << "polling, done status: " << completed << " timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() << LL_ENDL; mFired = true; @@ -696,7 +696,7 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable)) { // Wearable link that was never resolved; remove links to it from COF - LL_DEBUGS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "removing link for unresolved item " << data.mItemID.asString() << LL_ENDL; LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false); } } @@ -716,7 +716,7 @@ bool LLWearableHoldingPattern::pollMissingWearables() if (!done) { - LL_DEBUGS("Avatar") << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() + LL_INFOS("Avatar") << self_av_string() << "polling missing wearables, waiting for items " << mTypesToRecover.size() << " links " << mTypesToLink.size() << " wearables, timed out " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() @@ -763,7 +763,7 @@ void LLWearableHoldingPattern::handleLateArrivals() llwarns << self_av_string() << "Late arrivals not handled - in middle of missing wearables processing" << llendl; } - LL_DEBUGS("Avatar") << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << LL_ENDL; // Update mFoundList using late-arriving wearables. std::set replaced_types; @@ -1450,7 +1450,7 @@ void LLAppearanceMgr::linkAll(const LLUUID& cat_uuid, void LLAppearanceMgr::updateCOF(const LLUUID& category, bool append) { LLViewerInventoryCategory *pcat = gInventory.getCategory(category); - LL_DEBUGS("Avatar") << self_av_string() << "starting, cat " << (pcat ? pcat->getName() : "[UNKNOWN]") << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "starting, cat '" << (pcat ? pcat->getName() : "[UNKNOWN]") << "'" << LL_ENDL; const LLUUID cof = getCOF(); @@ -1716,7 +1716,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool update_base_outfit_ordering) BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF); - LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; //checking integrity of the COF in terms of ordering of wearables, //checking and updating links' descriptions of wearables in the COF (before analyzed for "dirty" state) @@ -1892,7 +1892,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool gAgentWearables.notifyLoadingStarted(); - LL_DEBUGS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName() + LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategory( " << category->getName() << " )" << LL_ENDL; selfStartPhase("wear_inventory_category_fetch"); @@ -1903,7 +1903,7 @@ void LLAppearanceMgr::wearInventoryCategory(LLInventoryCategory* category, bool void LLAppearanceMgr::wearCategoryFinal(LLUUID& cat_id, bool copy_items, bool append) { - LL_DEBUGS("Avatar") << self_av_string() << "starting" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "starting" << LL_ENDL; selfStopPhase("wear_inventory_category_fetch"); @@ -1988,8 +1988,8 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego // wearables being dirty. if(!category) return; - LL_DEBUGS("Avatar") << self_av_string() << "wearInventoryCategoryOnAvatar( " << category->getName() - << " )" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "wearInventoryCategoryOnAvatar '" << category->getName() + << "'" << LL_ENDL; if (gAgentCamera.cameraCustomizeAvatar()) { @@ -2002,7 +2002,7 @@ void LLAppearanceMgr::wearInventoryCategoryOnAvatar( LLInventoryCategory* catego void LLAppearanceMgr::wearOutfitByName(const std::string& name) { - LL_DEBUGS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "Wearing category " << name << LL_ENDL; //inc_busy_count(); LLInventoryModel::cat_array_t cat_array; @@ -2325,7 +2325,7 @@ const std::string OTHER_GESTURES_FOLDER = "Other Gestures"; void LLAppearanceMgr::copyLibraryGestures() { - LL_DEBUGS("Avatar") << self_av_string() << "Copying library gestures" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "Copying library gestures" << LL_ENDL; // Copy gestures LLUUID lib_gesture_cat_id = @@ -2399,7 +2399,7 @@ void LLAppearanceMgr::autopopulateOutfits() // If this is the very first time the user has logged into viewer2+ (from a legacy viewer, or new account) // then auto-populate outfits from the library into the My Outfits folder. - LL_DEBUGS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL; + LL_INFOS("Avatar") << self_av_string() << "avatar fully visible" << LL_ENDL; static bool check_populate_my_outfits = true; if (check_populate_my_outfits && diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp old mode 100644 new mode 100755 index 45ca23cdfe..b47a41c44c --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -342,8 +342,8 @@ void LLViewerInventoryItem::cloneViewerItem(LLPointer& ne void LLViewerInventoryItem::removeFromServer() { - llinfos << "Removing inventory item " << mUUID << " from server." - << llendl; + lldebugs << "Removing inventory item " << mUUID << " from server." + << llendl; LLInventoryModel::LLCategoryUpdate up(mParentUUID, -1); gInventory.accountForUpdate(up); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 275c326ef6..ffe5837249 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -786,13 +786,13 @@ std::string LLVOAvatar::avString() const void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string comment) { - LL_DEBUGS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() - << "sec ]" - << avString() - << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() - << " Notification " << notification_name - << " : " << comment - << llendl; + LL_INFOS("Avatar") << "REZTIME: [ " << (U32)mDebugExistenceTimer.getElapsedTimeF32() + << "sec ]" + << avString() + << "RuthTimer " << (U32)mRuthDebugTimer.getElapsedTimeF32() + << " Notification " << notification_name + << " : " << comment + << llendl; if (gSavedSettings.getBOOL("DebugAvatarRezTime")) { @@ -2859,13 +2859,13 @@ void LLVOAvatar::idleUpdateLoadingEffect() { if (isFullyLoaded() && mFirstFullyVisible && isSelf()) { - LL_DEBUGS("Avatar") << avString() << "self isFullyLoaded, mFirstFullyVisible" << LL_ENDL; + LL_INFOS("Avatar") << avString() << "self isFullyLoaded, mFirstFullyVisible" << LL_ENDL; mFirstFullyVisible = FALSE; LLAppearanceMgr::instance().onFirstFullyVisible(); } if (isFullyLoaded() && mFirstFullyVisible && !isSelf()) { - LL_DEBUGS("Avatar") << avString() << "other isFullyLoaded, mFirstFullyVisible" << LL_ENDL; + LL_INFOS("Avatar") << avString() << "other isFullyLoaded, mFirstFullyVisible" << LL_ENDL; mFirstFullyVisible = FALSE; } if (isFullyLoaded()) @@ -6494,7 +6494,7 @@ void LLVOAvatar::updateRezzedStatusTimers() S32 rez_status = getRezzedStatus(); if (rez_status != mLastRezzedStatus) { - llinfos << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << llendl; + LL_DEBUGS("Avatar") << avString() << "rez state change: " << mLastRezzedStatus << " -> " << rez_status << LL_ENDL; bool is_cloud_or_gray = (rez_status==0 || rez_status==1); bool was_cloud_or_gray = (mLastRezzedStatus==0 || mLastRezzedStatus==1); bool is_cloud = (rez_status==0); @@ -7180,7 +7180,7 @@ void LLVOAvatar::rebuildHUD() //----------------------------------------------------------------------------- void LLVOAvatar::onFirstTEMessageReceived() { - LL_DEBUGS("Avatar") << avString() << LL_ENDL; + LL_INFOS("Avatar") << avString() << LL_ENDL; if( !mFirstTEMessageReceived ) { mFirstTEMessageReceived = TRUE; @@ -7271,7 +7271,7 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) BOOL is_first_appearance_message = !mFirstAppearanceMessageReceived; mFirstAppearanceMessageReceived = TRUE; - LL_DEBUGS("Avatar") << avString() << "processAvatarAppearance start " << mID + LL_INFOS("Avatar") << avString() << "processAvatarAppearance start " << mID << " first? " << is_first_appearance_message << " self? " << isSelf() << LL_ENDL; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 9a77e21184..d2609e5587 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -2167,12 +2167,12 @@ public: { if (isGoodStatus(status)) { - llinfos << "OK" << llendl; + LL_DEBUGS("Avatar") << "OK" << LL_ENDL; result(content); } else { - llwarns << "Failed " << status << " reason " << reason << llendl; + LL_WARNS("Avatar") << "Failed " << status << " reason " << reason << LL_ENDL; error(status,reason); } } @@ -2462,7 +2462,9 @@ void LLVOAvatarSelf::outputRezDiagnostics() const // Don't print out non-existent textures. if (j != 0) - LL_DEBUGS("Avatar") << out.str() << llendl; + { + LL_DEBUGS("Avatar") << out.str() << LL_ENDL; + } } LL_DEBUGS("Avatar") << "\t Time points for each upload (start / finish)" << llendl; for (U32 i = 0; i < LLVOAvatarDefines::BAKED_NUM_INDICES; ++i) @@ -2485,7 +2487,7 @@ void LLVOAvatarSelf::outputRezDiagnostics() const void LLVOAvatarSelf::outputRezTiming(const std::string& msg) const { - LL_DEBUGS("Avatar") + LL_INFOS("Avatar") << avString() << llformat("%s. Time from avatar creation: %.2f", msg.c_str(), mDebugSelfLoadTimer.getElapsedTimeF32()) << LL_ENDL; -- cgit v1.2.3 From 5c11b6b2e59ea8042d8dac6071b8be4c81293889 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 May 2012 10:16:14 -0700 Subject: SH-3047 : Tweak of the performance compression data gathering code --- indra/llimage/llimagej2c.cpp | 6 +++++- indra/llimage/llimagej2c.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 4435e0d2a4..452aad25cb 100755 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -464,6 +464,7 @@ LLImageCompressionTester::LLImageCompressionTester() : LLMetricPerformanceTester addMetric("Perf Compression (kB/s)"); mRunBytesInDecompression = 0; + mRunBytesOutDecompression = 0; mRunBytesInCompression = 0; mTotalBytesInDecompression = 0; @@ -556,13 +557,16 @@ void LLImageCompressionTester::updateDecompressionStats(const S32 bytesIn, const mTotalBytesInDecompression += bytesIn; mRunBytesInDecompression += bytesIn; mTotalBytesOutDecompression += bytesOut; + mRunBytesOutDecompression += bytesOut; //if (mRunBytesInDecompression > (1000000)) - if ((mTotalTimeDecompression - mRunTimeDecompression) >= (5.0f)) + if (mRunBytesOutDecompression > (10000000)) + //if ((mTotalTimeDecompression - mRunTimeDecompression) >= (5.0f)) { // Output everything outputTestResults(); // Reset the decompression data of the run mRunBytesInDecompression = 0; + mRunBytesOutDecompression = 0; mRunTimeDecompression = mTotalTimeDecompression; } } diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index 42093e0e64..ce8195940d 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -156,7 +156,8 @@ class LLImageCompressionTester : public LLMetricPerformanceTesterBasic U32 mTotalBytesOutDecompression; // Total bytes produced by decompressor U32 mTotalBytesInCompression; // Total bytes fed to compressor U32 mTotalBytesOutCompression; // Total bytes produced by compressor - U32 mRunBytesInDecompression; // Bytes fed to decompressor in this run + U32 mRunBytesInDecompression; // Bytes fed to decompressor in this run + U32 mRunBytesOutDecompression; // Bytes produced by the decompressor in this run U32 mRunBytesInCompression; // Bytes fed to compressor in this run // // Time -- cgit v1.2.3 From 005ce31f41fc60b7b9c7890d354943b3e3568ac9 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 May 2012 21:42:53 -0700 Subject: SH-3047 : Fix lossless compression for small textures. --- indra/llkdu/llimagej2ckdu.cpp | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index cbfc34ebb8..53d2a2f3c5 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -619,36 +619,27 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co // This code is where we specify the target number of bytes for each quality layer. // We're using a logarithmic spacing rule that fits with our way of fetching texture data. // Note: For more info on this layers business, read kdu_codestream::flush() doc in kdu_compressed.h - U32 i = FIRST_PACKET_SIZE; + layer_bytes[nb_layers++] = FIRST_PACKET_SIZE; + U32 i = MIN_LAYER_SIZE; while ((i < max_bytes) && (nb_layers < (MAX_NB_LAYERS-1))) { - if (i == FIRST_PACKET_SIZE * 4) - { - // That really just means that the first layer is FIRST_PACKET_SIZE and the second is MIN_LAYER_SIZE - i = MIN_LAYER_SIZE; - } - layer_bytes[nb_layers] = i; - nb_layers++; + layer_bytes[nb_layers++] = i; i *= 4; } + if (layer_bytes[nb_layers-1] < max_bytes) + { + // Set the last quality layer if necessary so to fit the preset compression ratio + // Use 0 for that last layer for reversible images so all remaining code blocks will be flushed + layer_bytes[nb_layers++] = (reversible ? 0 : max_bytes); + } if (reversible) { codestream.access_siz()->parse_string("Creversible=yes"); - // *TODO: we should use yuv in reversible mode and one res level since those images are small. - // Don't turn this on now though as both create problems on decoding for the moment - //codestream.access_siz()->parse_string("Clevels=1"); + // *TODO: we should use yuv in reversible mode + // Don't turn this on now though as it creates problems on decoding for the moment //codestream.access_siz()->parse_string("Cycc=no"); - // In the reversible case, set the last entry of that table to 0 so that all generated bits will - // indeed be output by the time the last quality layer is encountered. - layer_bytes[nb_layers] = 0; - } - else - { - // Truncate the last quality layer if necessary so to fit the set compression ratio - layer_bytes[nb_layers] = max_bytes; } - nb_layers++; std::string layer_string = llformat("Clayers=%d",nb_layers); codestream.access_siz()->parse_string(layer_string.c_str()); -- cgit v1.2.3 From 7fd22901774ff9dcdfbf4388550275e30200307f Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Wed, 9 May 2012 17:04:02 -0700 Subject: SH-3075 : Fix reversible compression for very small textures. Also supress the forcing to reversible for small textures. --- indra/llkdu/llimagej2ckdu.cpp | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 53d2a2f3c5..cf88de12b4 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -609,13 +609,6 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co llassert (base.mRate > 0.f); max_bytes = (U32)((F32)(max_bytes) * base.mRate); - // If the image is very small, code it in a lossless way. - // Note: it'll also have only 1 layer which is fine as there's no point reordering blocks in that case. - if (max_bytes < FIRST_PACKET_SIZE) - { - reversible = true; - } - // This code is where we specify the target number of bytes for each quality layer. // We're using a logarithmic spacing rule that fits with our way of fetching texture data. // Note: For more info on this layers business, read kdu_codestream::flush() doc in kdu_compressed.h @@ -626,27 +619,32 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co layer_bytes[nb_layers++] = i; i *= 4; } + // Note: for small images, we can have (max_bytes < FIRST_PACKET_SIZE), hence the test if (layer_bytes[nb_layers-1] < max_bytes) { - // Set the last quality layer if necessary so to fit the preset compression ratio - // Use 0 for that last layer for reversible images so all remaining code blocks will be flushed - layer_bytes[nb_layers++] = (reversible ? 0 : max_bytes); + // Set the last quality layer so to fit the preset compression ratio + layer_bytes[nb_layers++] = max_bytes; } if (reversible) { + // Use 0 for a last quality layer for reversible images so all remaining code blocks will be flushed + // Hack: KDU encoding for reversible images has a bug for small images that leads to j2c images that + // cannot be open or are very blurry. Avoiding that last layer prevents the problem to happen. + if ((base.getWidth() >= 32) || (base.getHeight() >= 32)) + { + layer_bytes[nb_layers++] = 0; + } codestream.access_siz()->parse_string("Creversible=yes"); // *TODO: we should use yuv in reversible mode // Don't turn this on now though as it creates problems on decoding for the moment //codestream.access_siz()->parse_string("Cycc=no"); } - + std::string layer_string = llformat("Clayers=%d",nb_layers); codestream.access_siz()->parse_string(layer_string.c_str()); // Set up data ordering, markers, etc... if precincts or blocks specified - // Note: This code is *not* used in the encoding made by the viewer. It is currently used only - // by llimage_libtest to create various j2c and test alternative compression schemes. if ((mBlocksSize != -1) || (mPrecinctsSize != -1)) { if (mPrecinctsSize != -1) -- cgit v1.2.3 From c4dfdcb338aaeeb4e3adc4e1aef4f5b190ef5c57 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 14 May 2012 18:02:53 -0400 Subject: partial fix for SH-3132 - reduce max concurrent http requests to same level as in release --- indra/newview/lltexturefetch.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index efb6ed6079..e2af497a7d 100755 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -1161,7 +1161,7 @@ bool LLTextureFetchWorker::doWork(S32 param) //1, not openning too many file descriptors at the same time; //2, control the traffic of http so udp gets bandwidth. // - static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 24 ; + static const S32 MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE = 8 ; if(mFetcher->getNumHTTPRequests() > MAX_NUM_OF_HTTP_REQUESTS_IN_QUEUE) { return false ; //wait. -- cgit v1.2.3