From c71cf9cf23ff7a9928695367e9b62db3bed38ed7 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 1 Dec 2014 13:45:48 -0500 Subject: Improve display of avatar rendering info, remove last use of RenderAutoMuteFunctions --- indra/newview/llavatarrenderinfoaccountant.cpp | 29 -------------------------- 1 file changed, 29 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 38e153137c..ca2674bf94 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -335,35 +335,6 @@ void LLAvatarRenderInfoAccountant::idle() // We scanned all the regions, reset the request timer. sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); } - - static LLCachedControl render_auto_mute_functions(gSavedSettings, "RenderAutoMuteFunctions", 0); - static U32 prev_render_auto_mute_functions = (U32) -1; - if (prev_render_auto_mute_functions != render_auto_mute_functions) - { - prev_render_auto_mute_functions = render_auto_mute_functions; - - // Adjust menus - BOOL show_items = (BOOL)(render_auto_mute_functions & 0x04); - gMenuAvatarOther->setItemVisible( std::string("Normal"), show_items); - gMenuAvatarOther->setItemVisible( std::string("Always use impostor"), show_items); - gMenuAvatarOther->setItemVisible( std::string("Never use impostor"), show_items); - gMenuAvatarOther->setItemVisible( std::string("Impostor seperator"), show_items); - - gMenuAttachmentOther->setItemVisible( std::string("Normal"), show_items); - gMenuAttachmentOther->setItemVisible( std::string("Always use impostor"), show_items); - gMenuAttachmentOther->setItemVisible( std::string("Never use impostor"), show_items); - gMenuAttachmentOther->setItemVisible( std::string("Impostor seperator"), show_items); - - if (!show_items) - { // Turning off visual muting - for (std::vector::iterator iter = LLCharacter::sInstances.begin(); - iter != LLCharacter::sInstances.end(); ++iter) - { // Make sure all AVs have the setting cleared - LLVOAvatar* inst = (LLVOAvatar*) *iter; - inst->setCachedVisualMute(false); - } - } - } } -- cgit v1.3 From 9785a88ba447087fb547794430f24d7513909cbe Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 3 Dec 2014 10:13:50 -0500 Subject: further improvements to avatar render info display and logging of associated server messages --- indra/newview/llavatarrenderinfoaccountant.cpp | 119 +++++++++++-------------- indra/newview/llavatarrenderinfoaccountant.h | 2 - indra/newview/llvoavatar.cpp | 54 +++++------ 3 files changed, 81 insertions(+), 94 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index ca2674bf94..83ae0438d9 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -70,14 +70,14 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - LL_WARNS() << "HTTP error result for avatar weight GET: " << statusNum + LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight GET: " << statusNum << ", " << reason << " returned by region " << regionp->getName() << LL_ENDL; } else { - LL_WARNS() << "Avatar render weight GET error recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight GET error recieved but region not found for " << mRegionHandle << ", error " << statusNum << ", " << reason @@ -91,10 +91,7 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights request for region '" << regionp->getName() << "':" << LL_ENDL; if (content.isMap()) { @@ -109,40 +106,57 @@ public: LLUUID target_agent_id = LLUUID(report_iter->first); const LLSD & agent_info_map = report_iter->second; LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); - if (avatarp && - avatarp->isAvatar() && - agent_info_map.isMap()) + if ( avatarp + && avatarp->isAvatar() + && agent_info_map.isMap()) { // Extract the data for this avatar - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; if (agent_info_map.has(KEY_WEIGHT)) { ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); } } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } report_iter++; } } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response agents content is not map" << LL_ENDL; + } + } // has "agents" else if (content.has(KEY_ERROR)) { const LLSD & error = content[KEY_ERROR]; - LL_WARNS() << "Avatar render info GET error: " + LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " << error[KEY_IDENTIFIER] << ": " << error[KEY_MESSAGE] << " from region " << regionp->getName() << LL_ENDL; } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: no agent key in get response" << LL_ENDL; + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response is not map" << LL_ENDL; } } else { - LL_INFOS() << "Avatar render weight info recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight info recieved but region not found for " << mRegionHandle << LL_ENDL; } } @@ -165,14 +179,14 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - LL_WARNS() << "HTTP error result for avatar weight POST: " << statusNum + LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight POST: " << statusNum << ", " << reason << " returned by region " << regionp->getName() << LL_ENDL; } else { - LL_WARNS() << "Avatar render weight POST error recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight POST error recieved but region not found for " << mRegionHandle << ", error " << statusNum << ", " << reason @@ -185,18 +199,15 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Result for avatar weights POST for region " << regionp->getName() - << ": " << content << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights POST for region " << regionp->getName() + << ": " << content << LL_ENDL; if (content.isMap()) { if (content.has(KEY_ERROR)) { const LLSD & error = content[KEY_ERROR]; - LL_WARNS() << "Avatar render info POST error: " + LL_WARNS("AvatarRenderInfo") << "Avatar render info POST error: " << error[KEY_IDENTIFIER] << ": " << error[KEY_MESSAGE] << " from region " << regionp->getName() @@ -206,7 +217,7 @@ public: } else { - LL_INFOS() << "Avatar render weight POST result recieved but region not found for " + LL_INFOS("AvatarRenderInfo") << "Avatar render weight POST result recieved but region not found for " << mRegionHandle << LL_ENDL; } } @@ -223,13 +234,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Sending avatar render info to region " - << regionp->getName() - << " from " << url - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Checking for avatar render info to send to region " + << regionp->getName() + << " from " << url + << LL_ENDL; // Build the render info to POST to the region LLSD report = LLSD::emptyMap(); @@ -252,14 +260,8 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio info[KEY_WEIGHT] = avatar->getVisualComplexity(); agents[avatar->getID().asString()] = info; - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Sending avatar render info for " << avatar->getID() - << ": " << info << LL_ENDL; - LL_INFOS() << "LRI: other info geometry " << avatar->getAttachmentGeometryBytes() - << ", area " << avatar->getAttachmentSurfaceArea() - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Sending avatar render info for " << avatar->getID() + << ": " << info << LL_ENDL; } } iter++; @@ -268,6 +270,9 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio report[KEY_AGENTS] = agents; if (agents.size() > 0) { + LL_INFOS("AvatarRenderInfo") << "LRI: Sending info for " << agents.size() + << " avatars to region " << regionp->getName() + << LL_ENDL; LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); } } @@ -283,13 +288,10 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << LL_ENDL; // First send a request to get the latest data LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); @@ -308,11 +310,8 @@ void LLAvatarRenderInfoAccountant::idle() S32 num_avs = LLCharacter::sInstances.size(); - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Scanning all regions and checking for render info updates" - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Scanning all regions and checking for render info updates" + << LL_ENDL; // Check all regions and see if it's time to fetch/send data for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); @@ -344,12 +343,9 @@ void LLAvatarRenderInfoAccountant::idle() // are returned for a new LLViewerRegion, and is the earliest time to get render info void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Viewer has new region capabilities, clearing global render info timer" - << " and timer for region " << region_id - << LL_ENDL; - } + LL_INFOS("AvatarRenderInfo") << "LRI: Viewer has new region capabilities, clearing global render info timer" + << " and timer for region " << region_id + << LL_ENDL; // Reset the global timer so it will scan regions immediately sRenderInfoReportTimer.reset(); @@ -360,10 +356,3 @@ void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& reg regionp->getRenderInfoRequestTimer().reset(); } } - -// static -bool LLAvatarRenderInfoAccountant::logRenderInfo() -{ - static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging", false); - return render_mute_logging_enabled; -} diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h index d68f2dccfb..62c899f7a4 100644 --- a/indra/newview/llavatarrenderinfoaccountant.h +++ b/indra/newview/llavatarrenderinfoaccountant.h @@ -46,8 +46,6 @@ public: static void idle(); - static bool logRenderInfo(); - private: // Send data updates about once per minute, only need per-frame resolution static LLFrameTimer sRenderInfoReportTimer; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3a83943209..816b2c8b67 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7948,7 +7948,6 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d angle.mV[2] = da; } - void LLVOAvatar::idleUpdateRenderCost() { if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO)) @@ -7962,30 +7961,35 @@ void LLVOAvatar::idleUpdateRenderCost() if ( !mText ) { initDebugTextHud(); + mText->setFadeDistance(15.0, 5.0); // limit clutter in large crowds } else { mText->clearString(); // clear debug text } - static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); - info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f); - if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this + calculateUpdateRenderCost(); // Update mVisualComplexity if needed + + static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); + info_line = llformat("%d arc", mVisualComplexity); + + if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this { - green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f); - red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f); + green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f); + red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f); info_color.set(red_level, green_level, 0.0, 1.0); - info_style = ( mAttachmentGeometryBytes > max_attachment_bytes + info_style = ( mVisualComplexity > max_render_cost ? LLFontGL::BOLD : LLFontGL::NORMAL ); + } else { - info_color.setToWhite(); + info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max bytes " << info_line << LL_ENDL; - mText->addLine(info_line, info_color); - + LL_DEBUGS() << "adding max cost " << info_line << LL_ENDL; + mText->addLine(info_line, info_color, info_style); + static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0); info_line = llformat("%.2f m^2", mAttachmentSurfaceArea); @@ -7994,40 +7998,36 @@ void LLVOAvatar::idleUpdateRenderCost() green_level = 1.f-llclamp((mAttachmentSurfaceArea-max_attachment_area)/max_attachment_area, 0.f, 1.f); red_level = llmin(mAttachmentSurfaceArea/max_attachment_area, 1.f); info_color.set(red_level, green_level, 0.0, 1.0); - info_style = ( max_attachment_area > mAttachmentSurfaceArea + info_style = ( mAttachmentSurfaceArea > max_attachment_area ? LLFontGL::BOLD : LLFontGL::NORMAL ); } else { - info_color.setToWhite(); + info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } LL_DEBUGS() << "adding max area " << info_line << LL_ENDL; mText->addLine(info_line, info_color, info_style); - calculateUpdateRenderCost(); // Update mVisualComplexity if needed - - static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); - info_line = llformat("%d arc", mVisualComplexity); - - if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this + static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); + info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f); + if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this { - green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f); - red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f); + green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f); + red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f); info_color.set(red_level, green_level, 0.0, 1.0); - info_style = ( mVisualComplexity > max_render_cost + info_style = ( mAttachmentGeometryBytes > max_attachment_bytes ? LLFontGL::BOLD : LLFontGL::NORMAL ); - } else { - info_color.setToWhite(); + info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max cost " << info_line << LL_ENDL; - mText->addLine(info_line, info_color, info_style); - + LL_DEBUGS() << "adding max bytes " << info_line << LL_ENDL; + mText->addLine(info_line, info_color); + updateText(); // corrects position } } -- cgit v1.3 From fe627f64742cbec698df0a907cb8aaea297df599 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 15 Dec 2014 15:59:49 -0500 Subject: MAINT-4716: correct reading of and debug display for avatar render cost info --- indra/newview/llappviewer.cpp | 2 +- indra/newview/llavatarrenderinfoaccountant.cpp | 470 ++++++++++++++----------- indra/newview/llavatarrenderinfoaccountant.h | 33 +- indra/newview/llviewerregion.cpp | 3 +- indra/newview/llviewerregion.h | 6 +- indra/newview/llvoavatar.cpp | 59 +++- 6 files changed, 337 insertions(+), 236 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3a5008507a..4ad8181055 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5090,7 +5090,7 @@ void LLAppViewer::idle() } // Update AV render info - LLAvatarRenderInfoAccountant::idle(); + LLAvatarRenderInfoAccountant::getInstance()->idle(); { LL_RECORD_BLOCK_TIME(FTM_AUDIO_UPDATE); diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 83ae0438d9..8631f245a9 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -28,14 +28,16 @@ // Precompiled header #include "llviewerprecompiledheaders.h" -// associated header -#include "llavatarrenderinfoaccountant.h" // STL headers // std headers // external library headers // other Linden headers #include "llcharacter.h" -#include "llhttpclient.h" +#include "httprequest.h" +#include "httphandler.h" +#include "httpresponse.h" +#include "llcorehttputil.h" +#include "llappcorehttp.h" #include "lltimer.h" #include "llviewercontrol.h" #include "llviewermenu.h" @@ -43,6 +45,8 @@ #include "llviewerregion.h" #include "llvoavatar.h" #include "llworld.h" +// associated header +#include "llavatarrenderinfoaccountant.h" static const std::string KEY_AGENTS = "agents"; // map @@ -53,228 +57,259 @@ static const std::string KEY_MESSAGE = "message"; static const std::string KEY_ERROR = "error"; -// Send data updates about once per minute, only need per-frame resolution -LLFrameTimer LLAvatarRenderInfoAccountant::sRenderInfoReportTimer; +static const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds +static const F32 SECS_BETWEEN_REGION_REQUEST = 15.0; // Look for new avs every 15 seconds +static const F32 SECS_BETWEEN_REGION_REPORTS = 60.0; // Update each region every 60 seconds + + +// The policy class for HTTP traffic; this is the right value for all capability requests. +static LLCore::HttpRequest::policy_t http_policy(LLAppCoreHttp::AP_REPORTING); + +// Priority for HTTP requests. Use 0U. +static LLCore::HttpRequest::priority_t http_priority(0U); +LLAvatarRenderInfoAccountant::LLAvatarRenderInfoAccountant() + : mHttpRequest(new LLCore::HttpRequest) + , mHttpHeaders(new LLCore::HttpHeaders) + , mHttpOptions(new LLCore::HttpOptions) +{ + mHttpOptions->setTransferTimeout(SECS_BETWEEN_REGION_SCANS); + + mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); + mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML); +} + +LLAvatarRenderInfoAccountant::~LLAvatarRenderInfoAccountant() +{ + mHttpOptions->release(); + mHttpHeaders->release(); + // delete mHttpRequest; ??? +} // HTTP responder class for GET request for avatar render weight information -class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder +class LLAvatarRenderInfoGetHandler : public LLCore::HttpHandler { +private: + LOG_CLASS(LLAvatarRenderInfoGetHandler); + public: - LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle) + LLAvatarRenderInfoGetHandler() : LLCore::HttpHandler() { } - virtual void error(U32 statusNum, const std::string& reason) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) + void onCompleted(LLCore::HttpHandle handle, + LLCore::HttpResponse* response) { - LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight GET: " << statusNum - << ", " << reason - << " returned by region " << regionp->getName() - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight GET error recieved but region not found for " - << mRegionHandle - << ", error " << statusNum - << ", " << reason - << LL_ENDL; - } - - } - - virtual void result(const LLSD& content) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) - { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights request for region '" << regionp->getName() << "':" << LL_ENDL; - - if (content.isMap()) - { - if (content.has(KEY_AGENTS)) + LLCore::HttpStatus status = response->getStatus(); + if (status) + { + LLSD avatar_render_info; + if (LLCoreHttpUtil::responseToLLSD(response, false /* quiet logging */, + avatar_render_info)) { - const LLSD & agents = content[KEY_AGENTS]; - if (agents.isMap()) + if (avatar_render_info.isMap()) { - LLSD::map_const_iterator report_iter = agents.beginMap(); - while (report_iter != agents.endMap()) + if (avatar_render_info.has(KEY_AGENTS)) { - LLUUID target_agent_id = LLUUID(report_iter->first); - const LLSD & agent_info_map = report_iter->second; - LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); - if ( avatarp - && avatarp->isAvatar() - && agent_info_map.isMap()) - { // Extract the data for this avatar - - LL_DEBUGS("AvatarRenderInfo") << "LRI: Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - - if (agent_info_map.has(KEY_WEIGHT)) + const LLSD & agents = avatar_render_info[KEY_AGENTS]; + if (agents.isMap()) + { + for (LLSD::map_const_iterator agent_iter = agents.beginMap(); + agent_iter != agents.endMap(); + agent_iter++ + ) { - ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); - } + LLUUID target_agent_id = LLUUID(agent_iter->first); + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && avatarp->isAvatar()) + { + const LLSD & agent_info_map = agent_iter->second; + if (agent_info_map.isMap()) + { + LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; + + if (agent_info_map.has(KEY_WEIGHT)) + { + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } + } + else + { + LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL; + } + } // for agent_iter } else { - LL_WARNS("AvatarRenderInfo") << "LRI: agent entry invalid" - << " agent " << target_agent_id - << " map " << agent_info_map - << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response agents avatar_render_info is not map" << LL_ENDL; } - report_iter++; + } // has "agents" + else if (avatar_render_info.has(KEY_ERROR)) + { + const LLSD & error = avatar_render_info[KEY_ERROR]; + LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << LL_ENDL; + } + else + { + LL_WARNS("AvatarRenderInfo") << "no agent key in get response" << LL_ENDL; } } else { - LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response agents content is not map" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response is not map" << LL_ENDL; } - - } // has "agents" - else if (content.has(KEY_ERROR)) - { - const LLSD & error = content[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() - << LL_ENDL; - } + } else { - LL_WARNS("AvatarRenderInfo") << "LRI: no agent key in get response" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response parse failure" << LL_ENDL; } - } - else - { - LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response is not map" << LL_ENDL; - } - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight info recieved but region not found for " - << mRegionHandle << LL_ENDL; + } + else + { + // Something went wrong. Translate the status to + // a meaningful message. + LL_WARNS("AvatarRenderInfo") << "GET failed Status: " + << status.toTerseString() + << ", Reason: " << status.toString() + << LL_ENDL; + } + + delete this; // release the handler object } - } - -private: - U64 mRegionHandle; }; // HTTP responder class for POST request for avatar render weight information -class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder +class LLAvatarRenderInfoPostHandler : public LLCore::HttpHandler { -public: - LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle) - { - } + private: + LOG_CLASS(LLAvatarRenderInfoPostHandler); - virtual void error(U32 statusNum, const std::string& reason) + public: + LLAvatarRenderInfoPostHandler() : LLCore::HttpHandler() { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) - { - LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight POST: " << statusNum - << ", " << reason - << " returned by region " << regionp->getName() - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight POST error recieved but region not found for " - << mRegionHandle - << ", error " << statusNum - << ", " << reason - << LL_ENDL; - } } - virtual void result(const LLSD& content) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) + void onCompleted(LLCore::HttpHandle handle, + LLCore::HttpResponse* response) { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights POST for region " << regionp->getName() - << ": " << content << LL_ENDL; - - if (content.isMap()) + LLCore::HttpStatus status = response->getStatus(); + if (status) { - if (content.has(KEY_ERROR)) - { - const LLSD & error = content[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info POST error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "post succeeded" << LL_ENDL; } + else + { + // Something went wrong. Translate the status to + // a meaningful message. + LL_WARNS("AvatarRenderInfo") << "POST failed Status: " + << status.toTerseString() + << ", Reason: " << status.toString() + << LL_ENDL; + } + + delete this; // release the handler object } - else - { - LL_INFOS("AvatarRenderInfo") << "Avatar render weight POST result recieved but region not found for " - << mRegionHandle << LL_ENDL; - } - } - -private: - U64 mRegionHandle; }; -// static // Send request for one region, no timer checks +// called when the void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp) { - std::string url = regionp->getCapability("AvatarRenderInfo"); - if (!url.empty()) + if ( regionp->getRenderInfoReportTimer().hasExpired() ) // Time to make request { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Checking for avatar render info to send to region " - << regionp->getName() - << " from " << url - << LL_ENDL; - - // Build the render info to POST to the region - LLSD report = LLSD::emptyMap(); - LLSD agents = LLSD::emptyMap(); - - std::vector::iterator iter = LLCharacter::sInstances.begin(); - while( iter != LLCharacter::sInstances.end() ) + U32 num_avs = 0; + + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) { - LLVOAvatar* avatar = dynamic_cast(*iter); - if (avatar && - avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) - !avatar->isDead() && // Not dead yet - avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region + // Build the render info to POST to the region + LLSD agents = LLSD::emptyMap(); + + std::vector::iterator iter = LLCharacter::sInstances.begin(); + while( iter != LLCharacter::sInstances.end() ) { - avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date - - LLSD info = LLSD::emptyMap(); - if (avatar->getVisualComplexity() > 0) + LLVOAvatar* avatar = dynamic_cast(*iter); + if (avatar && + avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) + !avatar->isDead() && // Not dead yet + avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region { - info[KEY_WEIGHT] = avatar->getVisualComplexity(); - agents[avatar->getID().asString()] = info; + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date - LL_DEBUGS("AvatarRenderInfo") << "LRI: Sending avatar render info for " << avatar->getID() - << ": " << info << LL_ENDL; + LLSD info = LLSD::emptyMap(); + if (avatar->getVisualComplexity() > 0) + { + info[KEY_WEIGHT] = avatar->getVisualComplexity(); + agents[avatar->getID().asString()] = info; + + LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() + << ": " << info << LL_ENDL; + num_avs++; + } } + iter++; } - iter++; - } - report[KEY_AGENTS] = agents; - if (agents.size() > 0) + if (num_avs > 0) + { + LLSD report = LLSD::emptyMap(); + report[KEY_AGENTS] = agents; + + LLCore::HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); + LLAvatarRenderInfoPostHandler* handler = new LLAvatarRenderInfoPostHandler; + + handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest, + http_policy, + http_priority, + url, + report, + mHttpOptions, + mHttpHeaders, + handler); + if (LLCORE_HTTP_HANDLE_INVALID == handle) + { + LLCore::HttpStatus status(mHttpRequest->getStatus()); + LL_WARNS("AvatarRenderInfo") << "HTTP POST request failed" + << " Status: " << status.toTerseString() + << " Reason: '" << status.toString() << "'" + << LL_ENDL; + delete handler; + } + else + { + LL_INFOS("AvatarRenderInfo") << "Sent render costs for " << num_avs + << " avatars to region " << regionp->getName() + << LL_ENDL; + + + } + } + else + { + LL_DEBUGS("AvatarRenderInfo") << "no agent info to send" << LL_ENDL; + } + } + else { - LL_INFOS("AvatarRenderInfo") << "LRI: Sending info for " << agents.size() - << " avatars to region " << regionp->getName() - << LL_ENDL; - LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); + LL_WARNS("AvatarRenderInfo") << "AvatarRenderInfo cap is empty" << LL_ENDL; } + + // Reset this regions timer, moving to longer intervals if there are lots of avatars around + regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_REPORTS + (2.f * num_avs)); } } @@ -285,16 +320,39 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio // Send request for one region, no timer checks void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp) { - std::string url = regionp->getCapability("AvatarRenderInfo"); - if (!url.empty()) + if (regionp->getRenderInfoRequestTimer().hasExpired()) { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << LL_ENDL; + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + + LLAvatarRenderInfoGetHandler* handler = new LLAvatarRenderInfoGetHandler; + // First send a request to get the latest data + LLCore::HttpHandle handle = mHttpRequest->requestGet(http_policy, + http_priority, + url, + NULL, + NULL, + handler); + if (LLCORE_HTTP_HANDLE_INVALID != handle) + { + LL_INFOS("AvatarRenderInfo") << "Requested avatar render info for region " + << regionp->getName() + << LL_ENDL; + } + else + { + LL_WARNS("AvatarRenderInfo") << "Failed to launch HTTP GET request. Try again." + << LL_ENDL; + delete handler; + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "no AvatarRenderInfo cap for " << regionp->getName() << LL_ENDL; + } - // First send a request to get the latest data - LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST); } } @@ -303,56 +361,60 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi // Called every frame - send render weight requests to every region void LLAvatarRenderInfoAccountant::idle() { - if (sRenderInfoReportTimer.hasExpired()) - { - const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds - const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds + mHttpRequest->update(0); // give any pending http operations a chance to call completion methods - S32 num_avs = LLCharacter::sInstances.size(); - - LL_DEBUGS("AvatarRenderInfo") << "LRI: Scanning all regions and checking for render info updates" + if (mRenderInfoScanTimer.hasExpired()) + { + LL_DEBUGS("AvatarRenderInfo") << "Scanning regions for render info updates" << LL_ENDL; - // Check all regions and see if it's time to fetch/send data + // Check all regions for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + iter != LLWorld::getInstance()->getRegionList().end(); + ++iter) { LLViewerRegion* regionp = *iter; - if (regionp && - regionp->isAlive() && - regionp->capabilitiesReceived() && // Region has capability URLs available - regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request + if ( regionp + && regionp->isAlive() + && regionp->capabilitiesReceived()) { + // each of these is further governed by and resets its own timer sendRenderInfoToRegion(regionp); getRenderInfoFromRegion(regionp); - - // Reset this regions timer, moving to longer intervals if there are lots of avatars around - regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs)); } } // We scanned all the regions, reset the request timer. - sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + mRenderInfoScanTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); } } +void LLAvatarRenderInfoAccountant::resetRenderInfoScanTimer() +{ + // this will force the next frame to rescan + mRenderInfoScanTimer.reset(); +} // static -// Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region -// called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities +// Called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities // are returned for a new LLViewerRegion, and is the earliest time to get render info -void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id) +void LLAvatarRenderInfoAccountant::scanNewRegion(const LLUUID& region_id) { - LL_INFOS("AvatarRenderInfo") << "LRI: Viewer has new region capabilities, clearing global render info timer" - << " and timer for region " << region_id - << LL_ENDL; + LL_INFOS("AvatarRenderInfo") << region_id << LL_ENDL; - // Reset the global timer so it will scan regions immediately - sRenderInfoReportTimer.reset(); + // Reset the global timer so it will scan regions on the next call to ::idle + LLAvatarRenderInfoAccountant::getInstance()->resetRenderInfoScanTimer(); LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); if (regionp) - { // Reset the region's timer so it will request data immediately + { // Reset the region's timers so we will: + // * request render info from it immediately + // * report on the following scan regionp->getRenderInfoRequestTimer().reset(); + regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + } + else + { + LL_WARNS("AvatarRenderInfo") << "unable to resolve region "< { -public: - LLAvatarRenderInfoAccountant() {}; - ~LLAvatarRenderInfoAccountant() {}; + private: + LOG_CLASS(LLAvatarRenderInfoAccountant); - static void sendRenderInfoToRegion(LLViewerRegion * regionp); - static void getRenderInfoFromRegion(LLViewerRegion * regionp); + public: + LLAvatarRenderInfoAccountant(); + ~LLAvatarRenderInfoAccountant(); - static void expireRenderInfoReportTimer(const LLUUID& region_id); + void sendRenderInfoToRegion(LLViewerRegion * regionp); + void getRenderInfoFromRegion(LLViewerRegion * regionp); - static void idle(); + void idle(); // called once per frame -private: - // Send data updates about once per minute, only need per-frame resolution - static LLFrameTimer sRenderInfoReportTimer; + void resetRenderInfoScanTimer(); + + static void scanNewRegion(const LLUUID& region_id); + + private: + // frequency of region scans, + // further limited by per region Request and Report timers + LLFrameTimer mRenderInfoScanTimer; + + // + LLCore::HttpRequest* mHttpRequest; + LLCore::HttpHeaders* mHttpHeaders; + LLCore::HttpOptions* mHttpOptions; }; #endif /* ! defined(LL_llavatarrenderinfoaccountant_H) */ diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 11cbf3fc24..31493ca6ce 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -475,8 +475,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE mImpl->mVOCachePartition = getVOCachePartition(); - mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired - setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer, _1)); + setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::scanNewRegion, _1)); } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 1e225553b8..fbe229e00f 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -431,7 +431,8 @@ public: static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not. static S32 sLastCameraUpdated; - LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; }; + LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; }; + LLFrameTimer & getRenderInfoReportTimer() { return mRenderInfoReportTimer; }; struct CompareRegionByLastUpdate { @@ -536,7 +537,8 @@ private: // the materials capability throttle LLFrameTimer mMaterialsCapThrottleTimer; -LLFrameTimer mRenderInfoRequestTimer; + LLFrameTimer mRenderInfoRequestTimer; + LLFrameTimer mRenderInfoReportTimer; }; inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 816b2c8b67..7e9f098172 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3121,12 +3121,10 @@ bool LLVOAvatar::isVisuallyMuted() else { // Determine if visually muted or not - U32 max_cost = (U32) (max_render_cost); - muted = LLMuteList::getInstance()->isMuted(getID()) || (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) || (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || - (mVisualComplexity > max_cost && max_render_cost > 0); + (mVisualComplexity > max_render_cost && max_render_cost > 0); // Could be part of the grand || collection above, but yanked out to make the logic visible if (!muted) @@ -7967,11 +7965,17 @@ void LLVOAvatar::idleUpdateRenderCost() { mText->clearString(); // clear debug text } - + + /* + * NOTE: the logic for whether or not each of the values below + * controls muting MUST match that in the isVisuallyMuted method. + */ + + // Render Cost (ARC) calculateUpdateRenderCost(); // Update mVisualComplexity if needed static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); - info_line = llformat("%d arc", mVisualComplexity); + info_line = llformat("%d ARC", mVisualComplexity); if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this { @@ -7980,16 +7984,37 @@ void LLVOAvatar::idleUpdateRenderCost() info_color.set(red_level, green_level, 0.0, 1.0); info_style = ( mVisualComplexity > max_render_cost ? LLFontGL::BOLD : LLFontGL::NORMAL ); + } + else + { + info_color.set(LLColor4::grey); + info_style = LLFontGL::NORMAL; + } + mText->addLine(info_line, info_color, info_style); + + // TEMPORARY Reported Cost + info_line = llformat("%d reported ARC", mReportedVisualComplexity); + mText->addLine(info_line, info_color /* same as real ARC */, LLFontGL::ITALIC); + + // Visual rank + info_line = llformat("%d rank", mVisibilityRank); + if (sMaxVisible != 0) // zero means no limit, so don't bother coloring based on this + { + green_level = 1.f-llclamp(((F32)sMaxVisible-(F32)mVisibilityRank)/(F32)sMaxVisible, 0.f, 1.f); + red_level = llmin((F32) mVisibilityRank/(F32)sMaxVisible, 1.f); + info_color.set(red_level, green_level, 0.0, 1.0); + info_style = ( mVisibilityRank > sMaxVisible + ? LLFontGL::BOLD : LLFontGL::NORMAL ); } else { info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max cost " << info_line << LL_ENDL; mText->addLine(info_line, info_color, info_style); + // Attachment Surface Area static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0); info_line = llformat("%.2f m^2", mAttachmentSurfaceArea); @@ -8007,9 +8032,9 @@ void LLVOAvatar::idleUpdateRenderCost() info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max area " << info_line << LL_ENDL; mText->addLine(info_line, info_color, info_style); + // Attachment byte limit static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f); if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this @@ -8025,8 +8050,7 @@ void LLVOAvatar::idleUpdateRenderCost() info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max bytes " << info_line << LL_ENDL; - mText->addLine(info_line, info_color); + mText->addLine(info_line, info_color, info_style); updateText(); // corrects position } @@ -8049,7 +8073,8 @@ void LLVOAvatar::calculateUpdateRenderCost() for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict + = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); ETextureIndex tex_index = baked_dict->mTextureIndex; if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT))) { @@ -8061,11 +8086,11 @@ void LLVOAvatar::calculateUpdateRenderCost() } - for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) + for (attachment_map_t::const_iterator attachment_point = mAttachmentPoints.begin(); + attachment_point != mAttachmentPoints.end(); + ++attachment_point) { - LLViewerJointAttachment* attachment = iter->second; + LLViewerJointAttachment* attachment = attachment_point->second; for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); attachment_iter != attachment->mAttachedObjects.end(); ++attachment_iter) @@ -8095,10 +8120,12 @@ void LLVOAvatar::calculateUpdateRenderCost() } } - for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); + volume_texture != textures.end(); + ++volume_texture) { // add the cost of each individual texture in the linkset - cost += iter->second; + cost += volume_texture->second; } } } -- cgit v1.3 From c1e73c77f1181010059d0364500220bf1ac08d45 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Sun, 22 Feb 2015 08:30:13 -0500 Subject: add visual mute status to rendering info reported to the simulator --- indra/newview/llavatarrenderinfoaccountant.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index cdaf97ff62..44e19b1449 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -51,6 +51,7 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer +static const std::string KEY_MUTED = "muted"; // bool static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -254,6 +255,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); + info[KEY_MUTED] = avatar->isVisuallyMuted(); agents[avatar->getID().asString()] = info; LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() -- cgit v1.3 From 1da60c1d92e7af7d9f3de141574179717cf1e9cd Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 17 Apr 2015 13:37:46 -0400 Subject: reorganize visual muting, impostors, and complexity criteria [does not render correctly yet] --- indra/newview/llavatarrenderinfoaccountant.cpp | 4 +- indra/newview/llviewermenu.cpp | 1 - indra/newview/llviewertexturelist.cpp | 2 +- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/llvoavatar.cpp | 202 +++++++++++++------------ indra/newview/llvoavatar.h | 20 ++- indra/newview/llvoavatarself.cpp | 8 +- indra/newview/pipeline.cpp | 40 +++-- 8 files changed, 150 insertions(+), 129 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 44e19b1449..5746a43306 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -51,7 +51,7 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer -static const std::string KEY_MUTED = "muted"; // bool +static const std::string KEY_TOO_COMPLEX = "tooComplex"; // bool static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -255,7 +255,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); - info[KEY_MUTED] = avatar->isVisuallyMuted(); + info[KEY_TOO_COMPLEX] = avatar->isTooComplex(); agents[avatar->getID().asString()] = info; LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 213dee9328..793697b3df 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3020,7 +3020,6 @@ class LLAvatarSetImpostorMode : public view_listener_t return false; } - avatar->forceUpdateVisualMuteSettings(); LLVOAvatar::cullAvatarsByPixelArea(); return true; } // handleEvent() diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 8c27ddc63c..33bf4f823e 100755 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -447,7 +447,7 @@ LLViewerFetchedTexture* LLViewerTextureList::getImage(const LLUUID &image_id, // If the image is not found, creates new image and // enqueues a request for transmission - if ((&image_id == NULL) || image_id.isNull()) + if (image_id.isNull()) { return (LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI)); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 57c1643b8d..09173f0742 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -680,7 +680,7 @@ public: avatar->calculateUpdateRenderComplexity(); // Make sure the numbers are up-to-date trunc_name = utf8str_truncate(avatar->getFullname(), 16); - addText(xpos, ypos, llformat("%s : rez %d, weight %d, bytes %d area %.2f", + addText(xpos, ypos, llformat("%s : rez %d, complexity %d, bytes %d area %.2f", trunc_name.c_str(), avatar->getRezzedStatus(), avatar->getVisualComplexity(), diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 7bd4ab4bb4..b3129a85cd 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -114,8 +114,6 @@ extern U32 JOINT_COUNT_REQUIRED_FOR_FULLRIG; const F32 MAX_HOVER_Z = 2.0; const F32 MIN_HOVER_Z = -2.0; -// #define OUTPUT_BREAST_DATA - using namespace LLAvatarAppearanceDefines; //----------------------------------------------------------------------------- @@ -182,6 +180,8 @@ const F32 NAMETAG_UPDATE_THRESHOLD = 0.3f; const F32 NAMETAG_VERTICAL_SCREEN_OFFSET = 25.f; const F32 NAMETAG_VERT_OFFSET_WEIGHT = 0.17f; +const S32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; + enum ERenderName { RENDER_NAME_NEVER, @@ -645,7 +645,7 @@ BOOL LLVOAvatar::sShowFootPlane = FALSE; BOOL LLVOAvatar::sVisibleInFirstPerson = FALSE; F32 LLVOAvatar::sLODFactor = 1.f; F32 LLVOAvatar::sPhysicsLODFactor = 1.f; -bool LLVOAvatar::sUseImpostors = false; +bool LLVOAvatar::sUseImpostors = false; // overwridden by RenderAvatarMaxNonImpostors BOOL LLVOAvatar::sJointDebug = FALSE; F32 LLVOAvatar::sUnbakedTime = 0.f; F32 LLVOAvatar::sUnbakedUpdateTime = 0.f; @@ -668,7 +668,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mSpecialRenderMode(0), mAttachmentGeometryBytes(-1), mAttachmentSurfaceArea(-1.f), - mReportedVisualComplexity(-1), + mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mTurning(FALSE), mLastSkeletonSerialNum( 0 ), mIsSitting(FALSE), @@ -698,12 +698,14 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mNeedsSkin(FALSE), mLastSkinTime(0.f), mUpdatePeriod(1), + mVisualComplexityStale(true), + mVisuallyMuteSetting(VISUAL_MUTE_NOT_SET), + mMutedAVColor(calcMutedAVColor(getID())), mFirstFullyVisible(TRUE), mFullyLoaded(FALSE), mPreviousFullyLoaded(FALSE), mFullyLoadedInitialized(FALSE), - mVisualComplexity(0), - mVisualComplexityStale(TRUE), + mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mLoadedCallbacksPaused(FALSE), mRenderUnloadedAvatar(LLCachedControl(gSavedSettings, "RenderUnloadedAvatar", false)), mLastRezzedStatus(-1), @@ -712,6 +714,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, mLastUpdateRequestCOFVersion(-1), mLastUpdateReceivedCOFVersion(-1) { + LL_DEBUGS("AvatarRender") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; + //VTResume(); // VTune setHoverOffset(LLVector3(0.0, 0.0, 0.0)); @@ -719,8 +723,6 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim ); - LL_DEBUGS("Avatar") << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << LL_ENDL; - mPelvisp = NULL; mDirtyMesh = 2; // Dirty geometry, need to regenerate. @@ -771,14 +773,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, if(LLSceneMonitor::getInstance()->isEnabled()) { - LLSceneMonitor::getInstance()->freezeAvatar((LLCharacter*)this); + LLSceneMonitor::getInstance()->freezeAvatar((LLCharacter*)this); } - - mCachedVisualMute = !isSelf(); // default to muting everyone else? hmmm.... - mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() + 5.0; - mVisuallyMuteSetting = VISUAL_MUTE_NOT_SET; - - mMutedAVColor = calcMutedAVColor(getID()); } std::string LLVOAvatar::avString() const @@ -2535,7 +2531,10 @@ void LLVOAvatar::idleUpdateLoadingEffect() LLPartData::LL_PART_EMISSIVE_MASK | // LLPartData::LL_PART_FOLLOW_SRC_MASK | LLPartData::LL_PART_TARGET_POS_MASK ); - setParticleSource(particle_parameters, getID()); + if (!isTooComplex()) // do not generate particles for overly-complex avatars + { + setParticleSource(particle_parameters, getID()); + } } } } @@ -3080,62 +3079,9 @@ void LLVOAvatar::slamPosition() bool LLVOAvatar::isVisuallyMuted() const { - bool muted = false; - - // Priority order (highest priority first) - // * own avatar is never visually muted - // * if on the "always draw normally" list, draw them normally - // * if on the "always visually mute" list, mute them - // * check against the render cost and attachment limits - if (!isSelf()) - { - static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); - static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0.0); - static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); - - if (mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE) - { // Always want to see this AV as an impostor - muted = true; - } - else if (mVisuallyMuteSetting == NEVER_VISUAL_MUTE) - { // Never show as impostor - muted = false; - } - else - { - F64 now = LLFrameTimer::getTotalSeconds(); - - if (now < mCachedVisualMuteUpdateTime) - { // Use cached mute value - muted = mCachedVisualMute; - } - else - { // Determine if visually muted or not - - muted = ( (max_render_cost > 0 && mVisualComplexity > max_render_cost) - || (max_attachment_bytes > 0 && mAttachmentGeometryBytes > max_attachment_bytes) - || (max_attachment_area > 0.f && mAttachmentSurfaceArea > max_attachment_area) - || LLMuteList::getInstance()->isMuted(getID()) - ); - - // Save visual mute state and set interval for updating - const F64 SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES = 1.5; - mCachedVisualMuteUpdateTime = now + SECONDS_BETWEEN_RENDER_AUTO_MUTE_UPDATES; - mCachedVisualMute = muted; - } - } - } - - return muted; + return ( mVisuallyMuteSetting == ALWAYS_VISUAL_MUTE ); } -void LLVOAvatar::forceUpdateVisualMuteSettings() -{ - // Set the cache time so it's updated ASAP - mCachedVisualMuteUpdateTime = LLFrameTimer::getTotalSeconds() - 1.0; -} - - void LLVOAvatar::updateDebugText() { // clear debug text @@ -3279,18 +3225,18 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent) { // visually muted avatars update at 16 hz mUpdatePeriod = 16; } - else if ( mVisibilityRank <= LLVOAvatar::sMaxNonImpostors + else if ( ! isImpostor() || mDrawable->mDistanceWRTCamera < 1.f + mag) { // first 25% of max visible avatars are not impostored // also, don't impostor avatars whose bounding box may be penetrating the // impostor camera near clip plane mUpdatePeriod = 1; } - else if (mVisibilityRank > LLVOAvatar::sMaxNonImpostors * 4) + else if ( isImpostor(4) ) { //background avatars are REALLY slow updating impostors mUpdatePeriod = 16; } - else if (mVisibilityRank > LLVOAvatar::sMaxNonImpostors * 3) + else if ( isImpostor(3) ) { //back 25% of max visible avatars are slow updating impostors mUpdatePeriod = 8; } @@ -3874,6 +3820,10 @@ void LLVOAvatar::updateVisibility() } } + if ( visible != mVisible ) + { + LL_DEBUGS("AvatarRender") << "visible was " << mVisible << " now " << visible << LL_ENDL; + } mVisible = visible; } @@ -4146,8 +4096,8 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) } // Can't test for baked hair being defined, since that won't always be the case (not all viewers send baked hair) // TODO: 1.25 will be able to switch this logic back to calling isTextureVisible(); - if ( ( getImage(TEX_HAIR_BAKED, 0) && - getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE ) || LLDrawPoolAlpha::sShowDebugAlpha) + if ( (getImage(TEX_HAIR_BAKED, 0) && getImage(TEX_HAIR_BAKED, 0)->getID() != IMG_INVISIBLE) + || LLDrawPoolAlpha::sShowDebugAlpha) { LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); if (hair_mesh) @@ -5765,7 +5715,7 @@ const LLViewerJointAttachment *LLVOAvatar::attachObject(LLViewerObject *viewer_o return 0; } - mVisualComplexityStale = TRUE; + updateVisualComplexity(); if (viewer_object->isSelected()) { @@ -5914,7 +5864,7 @@ BOOL LLVOAvatar::detachObject(LLViewerObject *viewer_object) if (attachment->isObjectAttached(viewer_object)) { - mVisualComplexityStale = TRUE; + updateVisualComplexity(); cleanupAttachedMesh( viewer_object ); attachment->removeObject(viewer_object); @@ -6460,6 +6410,32 @@ BOOL LLVOAvatar::isFullyLoaded() const return (mRenderUnloadedAvatar || mFullyLoaded); } +bool LLVOAvatar::isTooComplex() const +{ + static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); + static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); + static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0.0); + bool too_complex; + + if (isSelf()) + { + too_complex = false; + } + else + { + too_complex = ( (max_render_cost > 0 && mVisualComplexity > max_render_cost) + || (max_attachment_bytes > 0 && mAttachmentGeometryBytes > max_attachment_bytes) + || (max_attachment_area > 0.f && mAttachmentSurfaceArea > max_attachment_area) + ); + } + + return too_complex; +} + +bool LLVOAvatar::isImpostor(const U32 rank_factor) const +{ + return (!isSelf() && sMaxNonImpostors != 0 && mVisibilityRank > (sMaxNonImpostors * rank_factor)); +} //----------------------------------------------------------------------------- // findMotion() @@ -8064,20 +8040,29 @@ void LLVOAvatar::updateImpostors() iter != LLCharacter::sInstances.end(); ++iter) { LLVOAvatar* avatar = (LLVOAvatar*) *iter; - if (!avatar->isDead() && avatar->needsImpostorUpdate() && avatar->isVisible() && avatar->isImpostor()) + + if (!avatar->isDead() && avatar->isVisible() + && ( (avatar->isImpostor() && avatar->needsImpostorUpdate()) + || avatar->isTooComplex() + )) { gPipeline.generateImpostor(avatar); } + else + { + LL_DEBUGS_ONCE("AvatarRender") << "Avatar " << avatar->getID() + << (avatar->isDead() ? " _is_ " : " is not ") << "dead" + << (avatar->needsImpostorUpdate() ? " needs " : " _does_not_need_ ") << "impostor update" + << (avatar->isVisible() ? " is " : " _is_not_ ") << "visible" + << (avatar->isImpostor() ? " is " : " is not ") << "impostor" + << (avatar->isTooComplex() ? " is " : " is not ") << "too complex" + << LL_ENDL; + } } LLCharacter::sAllowInstancesChange = TRUE ; } -BOOL LLVOAvatar::isImpostor() -{ - return sUseImpostors && (isVisuallyMuted() || (mUpdatePeriod >= IMPOSTOR_PERIOD)) ? TRUE : FALSE; -} - BOOL LLVOAvatar::needsImpostorUpdate() const { @@ -8138,16 +8123,21 @@ void LLVOAvatar::updateImpostorRendering(U32 newMaxNonImpostorsValue) } // the sUseImpostors flag depends on whether or not sMaxNonImpostors is set to the no-limit value (0) sUseImpostors = (0 != sMaxNonImpostors); - - LL_DEBUGS("AvatarRender") - << "was " << (oldflg ? "use" : "don't use" ) << " impostors (max " << oldmax << "); " - << "now " << (sUseImpostors ? "use" : "don't use" ) << " impostors (max " << sMaxNonImpostors << "); " - << LL_ENDL; + if ( oldflg != sUseImpostors ) + { + LL_DEBUGS("AvatarRender") + << "was " << (oldflg ? "use" : "don't use" ) << " impostors (max " << oldmax << "); " + << "now " << (sUseImpostors ? "use" : "don't use" ) << " impostors (max " << sMaxNonImpostors << "); " + << LL_ENDL; + } } void LLVOAvatar::idleUpdateRenderComplexity() { + // Render Complexity + calculateUpdateRenderComplexity(); // Update mVisualComplexity if needed + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO)) { std::string info_line; @@ -8168,12 +8158,9 @@ void LLVOAvatar::idleUpdateRenderComplexity() /* * NOTE: the logic for whether or not each of the values below - * controls muting MUST match that in the isVisuallyMuted method. + * controls muting MUST match that in the isVisuallyMuted and isTooComplex methods. */ - // Render Complexity - calculateUpdateRenderComplexity(); // Update mVisualComplexity if needed - static LLCachedControl max_render_cost(gSavedSettings, "RenderAvatarMaxComplexity", 0); info_line = llformat("%d Complexity", mVisualComplexity); @@ -8195,7 +8182,7 @@ void LLVOAvatar::idleUpdateRenderComplexity() // Visual rank info_line = llformat("%d rank", mVisibilityRank); // Use grey for imposters, white for normal rendering or no impostors - info_color.set((sMaxNonImpostors > 0 && mVisibilityRank > sMaxNonImpostors) ? LLColor4::grey : LLColor4::white); + info_color.set(isImpostor() ? LLColor4::grey : LLColor4::white); info_style = LLFontGL::NORMAL; mText->addLine(info_line, info_color, info_style); @@ -8242,6 +8229,13 @@ void LLVOAvatar::idleUpdateRenderComplexity() } +void LLVOAvatar::updateVisualComplexity() +{ + LL_DEBUGS("AvatarRender") << "avatar " << this->getID() << " appearance changed" << LL_ENDL; + // Set the cache time to in the past so it's updated ASAP + mVisualComplexityStale = true; +} + // Calculations for mVisualComplexity value void LLVOAvatar::calculateUpdateRenderComplexity() { @@ -8252,8 +8246,7 @@ void LLVOAvatar::calculateUpdateRenderComplexity() if (mVisualComplexityStale) { - mVisualComplexityStale = FALSE; - U32 cost = 0; + U32 cost = VISUAL_COMPLEXITY_UNKNOWN; LLVOVolume::texture_cost_t textures; for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) @@ -8357,7 +8350,21 @@ void LLVOAvatar::calculateUpdateRenderComplexity() } } + if ( cost != mVisualComplexity ) + { + LL_DEBUGS("AvatarRender") << "Avatar "<< getID() + << " complexity updated was " << mVisualComplexity << " now " << cost + << " reported " << mReportedVisualComplexity + << LL_ENDL; + } + { + LL_DEBUGS("AvatarRender") << "Avatar "<< getID() + << " complexity updated no change " << mVisualComplexity + << " reported " << mReportedVisualComplexity + << LL_ENDL; + } mVisualComplexity = cost; + mVisualComplexityStale = false; } } @@ -8383,10 +8390,7 @@ LLColor4 LLVOAvatar::calcMutedAVColor(const LLUUID av_id) new_color.normalize(); new_color *= 0.5f; // Tone it down - LL_DEBUGS("AvatarRender") << "avatar "<< av_id << " color " << std::setprecision(3) << color_value << " returning color " << new_color - << " using indexes " << spectrum_index_1 << ", " << spectrum_index_2 - << " and fractBetween " << fractBetween - << LL_ENDL; + LL_DEBUGS("AvatarRender") << "avatar "<< av_id << " muted color " << std::setprecision(3) << new_color << LL_ENDL; return new_color; } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index aa1dc43a11..48f7ea92e1 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -253,7 +253,8 @@ public: void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderComplexity(); void calculateUpdateRenderComplexity(); - void updateVisualComplexity() { mVisualComplexityStale = TRUE; } + static const S32 VISUAL_COMPLEXITY_UNKNOWN; + void updateVisualComplexity(); S32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry @@ -303,6 +304,8 @@ public: //-------------------------------------------------------------------- public: BOOL isFullyLoaded() const; + bool isTooComplex() const; + bool isImpostor(const U32 rank_factor = 1) const; bool visualParamWeightsAreDefault(); virtual bool getIsCloud() const; BOOL isFullyTextured() const; @@ -335,8 +338,6 @@ private: BOOL mPreviousFullyLoaded; BOOL mFullyLoadedInitialized; S32 mFullyLoadedFrameCounter; - S32 mVisualComplexity; - BOOL mVisualComplexityStale; LLColor4 mMutedAVColor; LLFrameTimer mFullyLoadedTimer; LLFrameTimer mRuthTimer; @@ -384,7 +385,6 @@ public: public: U32 renderImpostor(LLColor4U color = LLColor4U(255,255,255,255), S32 diffuse_channel = 0); bool isVisuallyMuted() const; - void setCachedVisualMute(bool muted) { mCachedVisualMute = muted; }; void forceUpdateVisualMuteSettings(); enum VisualMuteSettings @@ -409,8 +409,6 @@ public: S32 mAttachmentGeometryBytes; //number of bytes in attached geometry F32 mAttachmentSurfaceArea; //estimated surface area of attachments - S32 mReportedVisualComplexity; // Numbers as reported by the SL server - private: bool shouldAlphaMask(); @@ -420,9 +418,11 @@ private: S32 mUpdatePeriod; S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. - // the isVisuallyMuted method uses these mutable values to avoid recalculating too frequently - mutable bool mCachedVisualMute; // cached return value for isVisuallyMuted() - mutable F64 mCachedVisualMuteUpdateTime; // Time to update mCachedVisualMute + // the isTooComplex method uses these mutable values to avoid recalculating too frequently + mutable S32 mVisualComplexity; + mutable bool mVisualComplexityStale; + S32 mReportedVisualComplexity; // from other viewers through the simulator + VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV @@ -464,7 +464,6 @@ private: // Impostors //-------------------------------------------------------------------- public: - BOOL isImpostor(); BOOL needsImpostorUpdate() const; const LLVector3& getImpostorOffset() const; const LLVector2& getImpostorDim() const; @@ -699,7 +698,6 @@ private: public: BOOL isVisible() const; void setVisibilityRank(U32 rank); - U32 getVisibilityRank() const { return mVisibilityRank; } // unused static S32 sNumVisibleAvatars; // Number of instances of this class /** Appearance ** ** diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index d0bdd5bc03..32ccc75d39 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -434,7 +434,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if (attachment->getGroup() == i) + if (attachment && attachment->getGroup() == i) { LLMenuItemCallGL::Params item_params; @@ -473,7 +473,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if (attachment->getGroup() == i) + if (attachment && attachment->getGroup() == i) { LLMenuItemCallGL::Params item_params; std::string sub_piemenu_name = attachment->getName(); @@ -506,7 +506,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if (attachment->getGroup() == 8) + if (attachment && attachment->getGroup() == 8) { LLMenuItemCallGL::Params item_params; std::string sub_piemenu_name = attachment->getName(); @@ -608,7 +608,7 @@ BOOL LLVOAvatarSelf::buildMenus() ++iter) { LLViewerJointAttachment* attachment = iter->second; - if(attachment->getGroup() == group) + if(attachment && attachment->getGroup() == group) { // use multimap to provide a partial order off of the pie slice key S32 pie_index = attachment->getPieSlice(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6002b5a4eb..0536a2bbcf 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -11294,6 +11294,17 @@ static LLTrace::BlockTimerStatHandle FTM_IMPOSTOR_RESIZE("Impostor Resize"); void LLPipeline::generateImpostor(LLVOAvatar* avatar) { + LL_WARNS("AvatarRenderPipeline"); + if (avatar) + { + LL_CONT << "Avatar " << avatar->getID() << " is " << (avatar->mDrawable?"":"not ") << "drawable"; + } + else + { + LL_CONT << " is null"; + } + LL_CONT << LL_ENDL; + LLGLState::checkStates(); LLGLState::checkTextureChannels(); LLGLState::checkClientArrays(); @@ -11310,10 +11321,17 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) assertInitialized(); bool visually_muted = avatar->isVisuallyMuted(); + LL_DEBUGS("AvatarRenderPipeline") << "Avatar " << avatar->getID() + << " is " << ( visually_muted ? "" : "not ") << "visually muted" + << LL_ENDL; + bool too_complex = avatar->isTooComplex(); + LL_DEBUGS("AvatarRenderPipeline") << "Avatar " << avatar->getID() + << " is " << ( too_complex ? "" : "not ") << "too complex" + << LL_ENDL; pushRenderTypeMask(); - if (visually_muted) + if (visually_muted || too_complex) { andRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); } @@ -11358,7 +11376,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) { LL_RECORD_BLOCK_TIME(FTM_IMPOSTOR_MARK_VISIBLE); markVisible(avatar->mDrawable, *viewer_camera); - LLVOAvatar::sUseImpostors = false; // @TODO why? + LLVOAvatar::sUseImpostors = false; // @TODO ??? LLVOAvatar::attachment_map_t::iterator iter; for (iter = avatar->mAttachmentPoints.begin(); @@ -11471,7 +11489,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) F32 old_alpha = LLDrawPoolAvatar::sMinimumAlpha; - if (visually_muted) + if (visually_muted || too_complex) { //disable alpha masking for muted avatars (get whole skin silhouette) LLDrawPoolAvatar::sMinimumAlpha = 0.f; } @@ -11533,7 +11551,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) LLGLDisable blend(GL_BLEND); - if (visually_muted) + if (too_complex) { gGL.setColorMask(true, true); } @@ -11562,14 +11580,16 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) } - if (LLMuteList::getInstance()->isMuted(avatar->getID())) - { //grey muted avatar - gGL.diffuseColor4ub(64,64,64,255); - } - else + if (avatar->isTooComplex()) { // Visually muted avatar + LL_DEBUGS("AvatarRenderPipeline") << "Avatar " << avatar->getID() << " set jellybaby" << LL_ENDL; gGL.diffuseColor4fv( avatar->getMutedAVColor().mV ); } + else + { //grey muted avatar + LL_DEBUGS("AvatarRenderPipeline") << "Avatar " << avatar->getID() << " set grey" << LL_ENDL; + gGL.diffuseColor4ub(64,64,64,255); + } { gGL.begin(LLRender::QUADS); @@ -11595,7 +11615,7 @@ void LLPipeline::generateImpostor(LLVOAvatar* avatar) avatar->setImpostorDim(tdim); - LLVOAvatar::sUseImpostors = true; // @TODO why? + LLVOAvatar::sUseImpostors = true; // @TODO ??? sUseOcclusion = occlusion; sReflectionRender = FALSE; sImpostorRender = FALSE; -- cgit v1.3 From 3537b6a70e618390696dcf71bd0db9e2a2136ca0 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 15 May 2015 15:30:04 -0400 Subject: add reception of how many avatars report that you are over their limit --- indra/newview/llavatarrenderinfoaccountant.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 5746a43306..76d8d98186 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -52,6 +52,8 @@ static const std::string KEY_AGENTS = "agents"; // map static const std::string KEY_WEIGHT = "weight"; // integer static const std::string KEY_TOO_COMPLEX = "tooComplex"; // bool +static const std::string KEY_OVER_COMPLEXITY_LIMIT = "overlimit"; // integer +static const std::string KEY_REPORTING_COMPLEXITY_LIMIT = "reportinglimit"; // integer static const std::string KEY_IDENTIFIER = "identifier"; static const std::string KEY_MESSAGE = "message"; @@ -104,12 +106,23 @@ public: LLCore::HttpStatus status = response->getStatus(); if (status) { + LL_DEBUGS("AvatarRenderInfo") << "response"<getRenderInfoReportTimer().hasExpired() ) // Time to make request @@ -255,7 +268,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio if (avatar->getVisualComplexity() > 0) { info[KEY_WEIGHT] = avatar->getVisualComplexity(); - info[KEY_TOO_COMPLEX] = avatar->isTooComplex(); + info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() -- cgit v1.3 From 90590a06040d95bf0853d0c1b340b3a2aae46e51 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 8 Jul 2015 12:09:00 -0400 Subject: add markers for where the UI notice hooks go --- indra/newview/llavatarrenderinfoaccountant.cpp | 3 ++- indra/newview/llvoavatar.cpp | 34 +++++++++----------------- 2 files changed, 14 insertions(+), 23 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 76d8d98186..b8ec1e150b 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -120,7 +120,8 @@ public: U32 overlimit = avatar_render_info[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "<isMuted(getID()); - - const F64 SECONDS_BETWEEN_MUTE_UPDATES = 1; - mCachedMuteListUpdateTime = now + SECONDS_BETWEEN_MUTE_UPDATES; - mCachedInMuteList = muted; - } - return muted; -} -#endif - void LLVOAvatar::updateDebugText() { // clear debug text @@ -8278,9 +8257,20 @@ void LLVOAvatar::idleUpdateRenderComplexity() void LLVOAvatar::updateVisualComplexity() { - LL_DEBUGS("AvatarRender") << "avatar " << this->getID() << " appearance changed" << LL_ENDL; + LL_DEBUGS("AvatarRender") << "avatar " << getID() << " appearance changed" << LL_ENDL; // Set the cache time to in the past so it's updated ASAP mVisualComplexityStale = true; + LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 5); + + if ( isSelf() && show_my_complexity_changes ) + { + // @TODO + LL_INFOS("AvatarRender") << "popup that displays my complexity (" << mVisualComplexity << ")" + << " for " << show_my_complexity_changes << " seconds" + << LL_ENDL; + } + + } // Calculations for mVisualComplexity value -- cgit v1.3 From 75304b4ca81e3fdb9164ec607997a6c30616d8ca Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 19 Aug 2015 15:43:06 -0400 Subject: MAINT-5378 Add notices for avatar complexity changes --- indra/newview/CMakeLists.txt | 2 + indra/newview/llavatarrenderinfoaccountant.cpp | 7 +- indra/newview/llavatarrendernotifier.cpp | 182 +++++++++++++++++++++ indra/newview/llavatarrendernotifier.h | 73 +++++++++ indra/newview/llnotificationtiphandler.cpp | 16 +- indra/newview/llvoavatar.cpp | 25 ++- .../newview/skins/default/xui/en/notifications.xml | 24 +++ 7 files changed, 310 insertions(+), 19 deletions(-) create mode 100644 indra/newview/llavatarrendernotifier.cpp create mode 100644 indra/newview/llavatarrendernotifier.h (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b5a6912da0..73b60a8ffe 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -133,6 +133,7 @@ set(viewer_SOURCE_FILES llavatarlist.cpp llavatarlistitem.cpp llavatarrenderinfoaccountant.cpp + llavatarrendernotifier.cpp llavatarpropertiesprocessor.cpp llblockedlistitem.cpp llblocklist.cpp @@ -755,6 +756,7 @@ set(viewer_HEADER_FILES llavatarlistitem.h llavatarpropertiesprocessor.h llavatarrenderinfoaccountant.h + llavatarrendernotifier.h llblockedlistitem.h llblocklist.h llbox.h diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index b8ec1e150b..595a5f0224 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -38,6 +38,7 @@ #include "httpresponse.h" #include "llcorehttputil.h" #include "llappcorehttp.h" +#include "llavatarrendernotifier.h" #include "lltimer.h" #include "llviewercontrol.h" #include "llviewermenu.h" @@ -102,7 +103,7 @@ public: void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse* response) - { + { LLCore::HttpStatus status = response->getStatus(); if (status) { @@ -120,8 +121,8 @@ public: U32 overlimit = avatar_render_info[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "<updateNotificationRegion(reporting, overlimit); } if (avatar_render_info.has(KEY_AGENTS)) diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp new file mode 100644 index 0000000000..c7fdf4cce4 --- /dev/null +++ b/indra/newview/llavatarrendernotifier.cpp @@ -0,0 +1,182 @@ +/** + * @file llavatarrendernotifier.cpp + * @author andreykproductengine + * @date 2015-08-05 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, 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$ + */ + +// Pre-compiled headers +#include "llviewerprecompiledheaders.h" +// STL headers +// std headers +// external library headers +// other Linden headers +#include "llagentwearables.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llnotificationtemplate.h" +#include "lltimer.h" +#include "llviewercontrol.h" +// associated header +#include "llavatarrendernotifier.h" + +// when change exceeds this ration, notification is shown +static const F32 RENDER_ALLOWED_CHANGE_PCT = 0.1; + + +LLAvatarRenderNotifier::LLAvatarRenderNotifier() : +mAgentsCount(0), +mOverLimitAgents(0), +mAgentComplexity(0), +mOverLimitPct(0.0f), +mLatestAgentsCount(0), +mLatestOverLimitAgents(0), +mLatestAgentComplexity(0), +mLatestOverLimitPct(0.0f), +mShowOverLimitAgents(false) +{ +} + +void LLAvatarRenderNotifier::displayNotification() +{ + static LLCachedControl expire_delay(gSavedSettings, "ShowMyComplexityChanges", 20); + + LLDate expire_date(LLDate::now().secondsSinceEpoch() + expire_delay); + LLSD args; + args["AGENT_COMPLEXITY"] = LLSD::Integer(mLatestAgentComplexity); + std::string notification_name; + if (mShowOverLimitAgents) + { + notification_name = "RegionAndAgentComplexity"; + args["OVERLIMIT_PCT"] = LLSD::Integer(mLatestOverLimitPct); + } + else + { + notification_name = "AgentComplexity"; + } + + if (mNotificationPtr != NULL && mNotificationPtr->getName() != notification_name) + { + // since unique tag works only for same notification, + // old notification needs to be canceled manually + LLNotifications::instance().cancel(mNotificationPtr); + } + + mNotificationPtr = LLNotifications::instance().add(LLNotification::Params() + .name(notification_name) + .expiry(expire_date) + .substitutions(args)); +} + +bool LLAvatarRenderNotifier::isNotificationVisible() +{ + return mNotificationPtr != NULL && mNotificationPtr->isActive(); +} + +void LLAvatarRenderNotifier::updateNotification() +{ + if (mAgentsCount == mLatestAgentsCount + && mOverLimitAgents == mLatestOverLimitAgents + && mAgentComplexity == mLatestAgentComplexity) + { + //no changes since last notification + return; + } + + if (mLatestAgentComplexity == 0 + || !gAgentWearables.areWearablesLoaded()) + { + // data not ready, nothing to show. + return; + } + + bool display_notification = false; + bool is_visible = isNotificationVisible(); + + if (mLatestOverLimitPct > 0 || mOverLimitPct > 0) + { + //include 'over limit' information into notification + mShowOverLimitAgents = true; + } + else + { + // make sure that 'over limit' won't be displayed only to be hidden in a second + mShowOverLimitAgents &= is_visible; + } + + if (mAgentComplexity != mLatestAgentComplexity) + { + // if we have an agent complexity update, we always display it + display_notification = true; + + // next 'over limit' update should be displayed as soon as possible if there is anything noteworthy + mPopUpDelayTimer.resetWithExpiry(0); + } + else if ((mPopUpDelayTimer.hasExpired() || is_visible) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT) + { + // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes + display_notification = true; + + // default timeout before next notification + static LLCachedControl pop_up_delay(gSavedSettings, "ComplexityChangesPopUpDelay", 300); + mPopUpDelayTimer.resetWithExpiry(pop_up_delay); + } + + if (display_notification) + { + mAgentComplexity = mLatestAgentComplexity; + mAgentsCount = mLatestAgentsCount; + mOverLimitAgents = mLatestOverLimitAgents; + mOverLimitPct = mLatestOverLimitPct; + + displayNotification(); + } +} + +void LLAvatarRenderNotifier::updateNotificationRegion(U32 agentcount, U32 overLimit) +{ + if (agentcount == 0) + { + // Data not ready + return; + } + + // save current values for later use + mLatestAgentsCount = agentcount > overLimit ? agentcount - 1 : agentcount; // subtract self + mLatestOverLimitAgents = overLimit; + mLatestOverLimitPct = mLatestAgentsCount != 0 ? ((F32)overLimit / (F32)mLatestAgentsCount) * 100.0 : 0; + + updateNotification(); +} + +void LLAvatarRenderNotifier::updateNotificationAgent(U32 agentComplexity) +{ + // save the value for use in following messages + mLatestAgentComplexity = agentComplexity; + + updateNotification(); +} + diff --git a/indra/newview/llavatarrendernotifier.h b/indra/newview/llavatarrendernotifier.h new file mode 100644 index 0000000000..264c616543 --- /dev/null +++ b/indra/newview/llavatarrendernotifier.h @@ -0,0 +1,73 @@ +/** + * @file llavatarrendernotifier.h + * @author andreykproductengine + * @date 2015-08-05 + * @brief + * + * $LicenseInfo:firstyear=2013&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2013, 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$ + */ + +#if ! defined(LL_llavatarrendernotifier_H) +#define LL_llavatarrendernotifier_H + +#include "llnotificationptr.h" + +class LLViewerRegion; + +// Class to notify user about drastic changes in agent's render weights or if other agents +// reported that user's agent is too 'heavy' for their settings +class LLAvatarRenderNotifier : public LLSingleton +{ +public: + LLAvatarRenderNotifier(); + + void displayNotification(); + bool isNotificationVisible(); + + void updateNotification(); + void updateNotificationRegion(U32 agentcount, U32 overLimit); + void updateNotificationAgent(U32 agentComplexity); + +private: + + LLNotificationPtr mNotificationPtr; + + // to prevent notification from popping up too often, show it only + // if certain amount of time passed since previous notification + LLFrameTimer mPopUpDelayTimer; + + // values since last notification for comparison purposes + U32 mAgentsCount; + U32 mOverLimitAgents; + U32 mAgentComplexity; + F32 mOverLimitPct; + + // last reported values + U32 mLatestAgentsCount; + U32 mLatestOverLimitAgents; + U32 mLatestAgentComplexity; + F32 mLatestOverLimitPct; + + bool mShowOverLimitAgents; +}; + +#endif /* ! defined(LL_llavatarrendernotifier_H) */ diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 4ca961c1f9..596327e8f1 100755 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -113,11 +113,23 @@ bool LLTipHandler::processNotification(const LLNotificationPtr& notification) LLToast::Params p; p.notif_id = notification->getID(); p.notification = notification; - p.lifetime_secs = gSavedSettings.getS32("NotificationTipToastLifeTime"); p.panel = notify_box; p.is_tip = true; p.can_be_stored = false; - + + LLDate cur_time = LLDate::now(); + LLDate exp_time = notification->getExpiration(); + if (exp_time > cur_time) + { + // we have non-default expiration time - keep visible until expires + p.lifetime_secs = exp_time.secondsSinceEpoch() - cur_time.secondsSinceEpoch(); + } + else + { + // use default time + p.lifetime_secs = gSavedSettings.getS32("NotificationTipToastLifeTime"); + } + LLScreenChannel* channel = dynamic_cast(mChannel.get()); if(channel) channel->addToast(p); diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a073ac10b8..86db3689c7 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -43,6 +43,7 @@ #include "llanimationstates.h" #include "llavatarnamecache.h" #include "llavatarpropertiesprocessor.h" +#include "llavatarrendernotifier.h" #include "llexperiencecache.h" #include "llphysicsmotion.h" #include "llviewercontrol.h" @@ -8285,20 +8286,9 @@ void LLVOAvatar::idleUpdateRenderComplexity() void LLVOAvatar::updateVisualComplexity() { - LL_DEBUGS("AvatarRender") << "avatar " << getID() << " appearance changed" << LL_ENDL; - // Set the cache time to in the past so it's updated ASAP - mVisualComplexityStale = true; - LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 5); - - if ( isSelf() && show_my_complexity_changes ) - { - // @TODO - LL_INFOS("AvatarRender") << "popup that displays my complexity (" << mVisualComplexity << ")" - << " for " << show_my_complexity_changes << " seconds" - << LL_ENDL; - } - - + LL_DEBUGS("AvatarRender") << "avatar " << getID() << " appearance changed" << LL_ENDL; + // Set the cache time to in the past so it's updated ASAP + mVisualComplexityStale = true; } // Calculations for mVisualComplexity value @@ -8430,6 +8420,13 @@ void LLVOAvatar::calculateUpdateRenderComplexity() } mVisualComplexity = cost; mVisualComplexityStale = false; + + LLCachedControl show_my_complexity_changes(gSavedSettings, "ShowMyComplexityChanges", 20); + + if (isSelf() && show_my_complexity_changes) + { + LLAvatarRenderNotifier::getInstance()->updateNotificationAgent(mVisualComplexity); + } } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index d0ccf2e2d8..97c4c924e7 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3293,6 +3293,30 @@ You can use [SECOND_LIFE] normally and other people will see you correctly. + + + AgentComplexityNotice + + Your visual complexity is [AGENT_COMPLEXITY]. +[OVERLIMIT_PCT]% of nearby users may not fully show you +with complexity this high. + + + + + AgentComplexityNotice + +Your visual complexity is [AGENT_COMPLEXITY]. + + Date: Tue, 25 Aug 2015 17:51:35 -0400 Subject: MAINT-5560: Correct imposter rendering flaws for avatars that have not had any attachments --- indra/newview/llavatarrenderinfoaccountant.cpp | 5 +++-- indra/newview/llavatarrendernotifier.cpp | 7 ++++--- indra/newview/llspatialpartition.cpp | 6 ++---- indra/newview/llvoavatar.cpp | 16 +++++++++++++--- indra/newview/llvoavatar.h | 18 ++++++++++-------- indra/newview/llvovolume.cpp | 24 ++++-------------------- 6 files changed, 36 insertions(+), 40 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 595a5f0224..03204ea48f 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -267,9 +267,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio avatar->calculateUpdateRenderComplexity(); // Make sure the numbers are up-to-date LLSD info = LLSD::emptyMap(); - if (avatar->getVisualComplexity() > 0) + U32 avatar_complexity = avatar->getVisualComplexity(); + if (avatar_complexity > 0) { - info[KEY_WEIGHT] = avatar->getVisualComplexity(); + info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX); info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; diff --git a/indra/newview/llavatarrendernotifier.cpp b/indra/newview/llavatarrendernotifier.cpp index c7fdf4cce4..2596035f95 100644 --- a/indra/newview/llavatarrendernotifier.cpp +++ b/indra/newview/llavatarrendernotifier.cpp @@ -133,9 +133,10 @@ void LLAvatarRenderNotifier::updateNotification() // next 'over limit' update should be displayed as soon as possible if there is anything noteworthy mPopUpDelayTimer.resetWithExpiry(0); } - else if ((mPopUpDelayTimer.hasExpired() || is_visible) - && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) - && abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT) + else if ( (mPopUpDelayTimer.hasExpired() || is_visible) + && (mOverLimitPct > 0 || mLatestOverLimitPct > 0) + && std::abs(mOverLimitPct - mLatestOverLimitPct) > mLatestOverLimitPct * RENDER_ALLOWED_CHANGE_PCT + ) { // display in case of drop to/from zero and in case of significant (RENDER_ALLOWED_CHANGE_PCT) changes display_notification = true; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 5e342099d7..11b619ba00 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -862,10 +862,8 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { if (bridge->mAvatar.notNull()) { - bridge->mAvatar->mAttachmentGeometryBytes -= mGeometryBytes; - bridge->mAvatar->mAttachmentGeometryBytes = llmax(bridge->mAvatar->mAttachmentGeometryBytes, 0); - bridge->mAvatar->mAttachmentSurfaceArea -= mSurfaceArea; - bridge->mAvatar->mAttachmentSurfaceArea = llmax(bridge->mAvatar->mAttachmentSurfaceArea, 0.f); + bridge->mAvatar->modifyAttachmentGeometryBytes( -mGeometryBytes ); + bridge->mAvatar->modifyAttachmentSurfaceArea( -mSurfaceArea ); } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 86db3689c7..303b677dcf 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -182,7 +182,7 @@ const F32 NAMETAG_UPDATE_THRESHOLD = 0.3f; const F32 NAMETAG_VERTICAL_SCREEN_OFFSET = 25.f; const F32 NAMETAG_VERT_OFFSET_WEIGHT = 0.17f; -const S32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; +const U32 LLVOAvatar::VISUAL_COMPLEXITY_UNKNOWN = 0; enum ERenderName { @@ -668,8 +668,8 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id, LLAvatarAppearance(&gAgentWearables), LLViewerObject(id, pcode, regionp), mSpecialRenderMode(0), - mAttachmentGeometryBytes(-1), - mAttachmentSurfaceArea(-1.f), + mAttachmentGeometryBytes(0), + mAttachmentSurfaceArea(0.f), mReportedVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN), mTurning(FALSE), mLastSkeletonSerialNum( 0 ), @@ -8283,6 +8283,16 @@ void LLVOAvatar::idleUpdateRenderComplexity() } } +void LLVOAvatar::modifyAttachmentGeometryBytes(S32 delta) +{ + mAttachmentGeometryBytes = llmax(mAttachmentGeometryBytes + delta, 0); +} + +void LLVOAvatar::modifyAttachmentSurfaceArea(F32 delta) +{ + F32 newval = mAttachmentSurfaceArea + delta; + mAttachmentSurfaceArea = ( newval > 0.0 ? newval : 0.0 ); +} void LLVOAvatar::updateVisualComplexity() { diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index a49aa73035..5f690be4c5 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -253,15 +253,17 @@ public: void addNameTagLine(const std::string& line, const LLColor4& color, S32 style, const LLFontGL* font); void idleUpdateRenderComplexity(); void calculateUpdateRenderComplexity(); - static const S32 VISUAL_COMPLEXITY_UNKNOWN; + static const U32 VISUAL_COMPLEXITY_UNKNOWN; void updateVisualComplexity(); - S32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV + U32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry + void modifyAttachmentGeometryBytes(S32 delta); F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments + void modifyAttachmentSurfaceArea(F32 delta); - S32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server - void setReportedVisualComplexity(S32 value) { mReportedVisualComplexity = value; }; + U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server + void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; }; S32 getUpdatePeriod() { return mUpdatePeriod; }; const LLColor4 & getMutedAVColor() { return mMutedAVColor; }; @@ -405,10 +407,10 @@ public: static void destroyGL(); static void restoreGL(); S32 mSpecialRenderMode; // special lighting + + private: S32 mAttachmentGeometryBytes; //number of bytes in attached geometry F32 mAttachmentSurfaceArea; //estimated surface area of attachments - -private: bool shouldAlphaMask(); BOOL mNeedsSkin; // avatar has been animated and verts have not been updated @@ -418,9 +420,9 @@ private: S32 mNumInitFaces; //number of faces generated when creating the avatar drawable, does not inculde splitted faces due to long vertex buffer. // the isTooComplex method uses these mutable values to avoid recalculating too frequently - mutable S32 mVisualComplexity; + mutable U32 mVisualComplexity; mutable bool mVisualComplexityStale; - S32 mReportedVisualComplexity; // from other viewers through the simulator + U32 mReportedVisualComplexity; // from other viewers through the simulator VisualMuteSettings mVisuallyMuteSetting; // Always or never visually mute this AV diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 0432f6f27c..160e2fbdb3 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4703,10 +4703,8 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - pAvatarVO->mAttachmentGeometryBytes -= group->mGeometryBytes; - pAvatarVO->mAttachmentGeometryBytes = llmax(pAvatarVO->mAttachmentGeometryBytes, 0); - pAvatarVO->mAttachmentSurfaceArea -= group->mSurfaceArea; - pAvatarVO->mAttachmentSurfaceArea = llmax(pAvatarVO->mAttachmentSurfaceArea, 0.f); + pAvatarVO->modifyAttachmentGeometryBytes( -group->mGeometryBytes ); + pAvatarVO->modifyAttachmentSurfaceArea( -group->mSurfaceArea ); } group->mGeometryBytes = 0; @@ -5260,24 +5258,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - if (pAvatarVO->mAttachmentGeometryBytes < 0) - { // First time through value is -1 - pAvatarVO->mAttachmentGeometryBytes = group->mGeometryBytes; - } - else - { - pAvatarVO->mAttachmentGeometryBytes += group->mGeometryBytes; - } - if (pAvatarVO->mAttachmentSurfaceArea < 0.f) - { // First time through value is -1 - pAvatarVO->mAttachmentSurfaceArea = group->mSurfaceArea; - } - else - { - pAvatarVO->mAttachmentSurfaceArea += group->mSurfaceArea; + pAvatarVO->modifyAttachmentGeometryBytes( group->mGeometryBytes ); + pAvatarVO->modifyAttachmentSurfaceArea( group->mSurfaceArea ); } } -} static LLTrace::BlockTimerStatHandle FTM_REBUILD_MESH_FLUSH("Flush Mesh"); -- cgit v1.3 From 712a4e70c81c1908e4e7668ff1695a9415ec4b71 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 26 Aug 2015 12:07:16 -0400 Subject: refine fix for MAINT-5560 based on review feedback and to fix VS objection --- indra/newview/llavatarrenderinfoaccountant.cpp | 4 +++- indra/newview/llspatialpartition.cpp | 3 +-- indra/newview/llvoavatar.cpp | 11 ++++++----- indra/newview/llvoavatar.h | 4 ++-- indra/newview/llvovolume.cpp | 6 ++---- 5 files changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 03204ea48f..d351b38653 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -268,8 +268,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio LLSD info = LLSD::emptyMap(); U32 avatar_complexity = avatar->getVisualComplexity(); - if (avatar_complexity > 0) + if (avatar_complexity > 0) { + // the weight/complexity is unsigned, but LLSD only stores signed integers, + // so if it's over that (which would be ridiculously high), just store the maximum signed int value info[KEY_WEIGHT] = (S32)(avatar_complexity < S32_MAX ? avatar_complexity : S32_MAX); info[KEY_TOO_COMPLEX] = LLSD::Boolean(avatar->isTooComplex()); agents[avatar->getID().asString()] = info; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 11b619ba00..da3f344e00 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -862,8 +862,7 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { if (bridge->mAvatar.notNull()) { - bridge->mAvatar->modifyAttachmentGeometryBytes( -mGeometryBytes ); - bridge->mAvatar->modifyAttachmentSurfaceArea( -mSurfaceArea ); + bridge->mAvatar->subtractAttachmentSizes( mGeometryBytes, mSurfaceArea ); } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 303b677dcf..5d83a20f50 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8283,15 +8283,16 @@ void LLVOAvatar::idleUpdateRenderComplexity() } } -void LLVOAvatar::modifyAttachmentGeometryBytes(S32 delta) +void LLVOAvatar::addAttachmentSizes(U32 delta_bytes, F32 delta_area) { - mAttachmentGeometryBytes = llmax(mAttachmentGeometryBytes + delta, 0); + mAttachmentGeometryBytes += delta_bytes; + mAttachmentSurfaceArea += delta_area; } -void LLVOAvatar::modifyAttachmentSurfaceArea(F32 delta) +void LLVOAvatar::subtractAttachmentSizes(U32 delta_bytes, F32 delta_area) { - F32 newval = mAttachmentSurfaceArea + delta; - mAttachmentSurfaceArea = ( newval > 0.0 ? newval : 0.0 ); + mAttachmentGeometryBytes = delta_bytes > mAttachmentGeometryBytes ? 0 : mAttachmentGeometryBytes - delta_bytes; + mAttachmentSurfaceArea = delta_area > mAttachmentSurfaceArea ? 0.0 : mAttachmentSurfaceArea - delta_area; } void LLVOAvatar::updateVisualComplexity() diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 5f690be4c5..fb19f4eb2e 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -258,9 +258,9 @@ public: U32 getVisualComplexity() { return mVisualComplexity; }; // Numbers calculated here by rendering AV S32 getAttachmentGeometryBytes() { return mAttachmentGeometryBytes; }; // number of bytes in attached geometry - void modifyAttachmentGeometryBytes(S32 delta); F32 getAttachmentSurfaceArea() { return mAttachmentSurfaceArea; }; // estimated surface area of attachments - void modifyAttachmentSurfaceArea(F32 delta); + void addAttachmentSizes(U32 delta_bytes, F32 delta_area); + void subtractAttachmentSizes(U32 delta_bytes, F32 delta_area); U32 getReportedVisualComplexity() { return mReportedVisualComplexity; }; // Numbers as reported by the SL server void setReportedVisualComplexity(U32 value) { mReportedVisualComplexity = value; }; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 160e2fbdb3..44ba09c171 100755 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4703,8 +4703,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - pAvatarVO->modifyAttachmentGeometryBytes( -group->mGeometryBytes ); - pAvatarVO->modifyAttachmentSurfaceArea( -group->mSurfaceArea ); + pAvatarVO->subtractAttachmentSizes( group->mGeometryBytes, group->mSurfaceArea ); } group->mGeometryBytes = 0; @@ -5258,8 +5257,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (pAvatarVO) { - pAvatarVO->modifyAttachmentGeometryBytes( group->mGeometryBytes ); - pAvatarVO->modifyAttachmentSurfaceArea( group->mSurfaceArea ); + pAvatarVO->addAttachmentSizes( group->mGeometryBytes, group->mSurfaceArea ); } } -- cgit v1.3 From 2dcfa3b6bd3ebeeab62174d86f9dc85558bcb7c8 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 12 Feb 2016 16:58:41 -0500 Subject: Suppress some overly verbose logging --- indra/llmessage/llavatarnamecache.cpp | 2 +- indra/newview/app_settings/logcontrol.xml | 26 +++++++++++++++++--------- indra/newview/llavatarrenderinfoaccountant.cpp | 4 ++-- indra/newview/llviewermessage.cpp | 8 ++++---- indra/newview/llwaterparammanager.cpp | 2 +- indra/newview/llwldaycycle.cpp | 2 +- 6 files changed, 26 insertions(+), 18 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/llmessage/llavatarnamecache.cpp b/indra/llmessage/llavatarnamecache.cpp index 549708097a..360d239e61 100755 --- a/indra/llmessage/llavatarnamecache.cpp +++ b/indra/llmessage/llavatarnamecache.cpp @@ -355,7 +355,7 @@ void LLAvatarNameCache::requestNamesViaCapability() if (!url.empty()) { - LL_INFOS("AvNameCache") << "LLAvatarNameCache::requestNamesViaCapability getting " << ids << " ids" << LL_ENDL; + LL_DEBUGS("AvNameCache") << " getting " << ids << " ids" << LL_ENDL; LLHTTPClient::get(url, new LLAvatarNameResponder(agent_ids)); } } diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index de3732f339..ecd7c4bc36 100755 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -5,7 +5,23 @@ print-location false settings - + + + levelERROR + functions + + + classes + + + files + + + tags + + ShaderLoading + + levelINFO functions @@ -19,14 +35,6 @@ tags - AppInit - Capabilities - SystemInfo - TextureCache - AppCache - Window - RenderInit - MediaAuth diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index d351b38653..2760a97bda 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -311,7 +311,7 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio } else { - LL_INFOS("AvatarRenderInfo") << "Sent render costs for " << num_avs + LL_DEBUGS("AvatarRenderInfo") << "Sent render costs for " << num_avs << " avatars to region " << regionp->getName() << LL_ENDL; @@ -356,7 +356,7 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi handler); if (LLCORE_HTTP_HANDLE_INVALID != handle) { - LL_INFOS("AvatarRenderInfo") << "Requested avatar render info for region " + LL_DEBUGS("AvatarRenderInfo") << "Requested avatar render info for region " << regionp->getName() << LL_ENDL; } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 6ba10373b9..6ab7a324cb 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2468,7 +2468,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) buffer = message; - LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; + LL_DEBUGS("Messaging") << "session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; // add to IM panel, but do not bother the user gIMMgr->addMessage( @@ -2517,7 +2517,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) } buffer = saved + message; - LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; + LL_DEBUGS("Messaging") << "session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; bool mute_im = is_muted; if(accept_im_from_only_friend && !is_friend && !is_linden) @@ -2982,7 +2982,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) buffer = message; - LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; + LL_DEBUGS("Messaging") << "message in dnd; session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; // add to IM panel, but do not bother the user gIMMgr->addMessage( @@ -3009,7 +3009,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) buffer = saved + message; - LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; + LL_DEBUGS("Messaging") << "standard message session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL; gIMMgr->addMessage( session_id, diff --git a/indra/newview/llwaterparammanager.cpp b/indra/newview/llwaterparammanager.cpp index 374792193c..28ae569ba2 100755 --- a/indra/newview/llwaterparammanager.cpp +++ b/indra/newview/llwaterparammanager.cpp @@ -89,7 +89,7 @@ void LLWaterParamManager::loadAllPresets() void LLWaterParamManager::loadPresetsFromDir(const std::string& dir) { - LL_INFOS("AppInit", "Shaders") << "Loading water presets from " << dir << LL_ENDL; + LL_DEBUGS("AppInit", "Shaders") << "Loading water presets from " << dir << LL_ENDL; LLDirIterator dir_iter(dir, "*.xml"); while (1) diff --git a/indra/newview/llwldaycycle.cpp b/indra/newview/llwldaycycle.cpp index 88079c5d26..106f17f61b 100755 --- a/indra/newview/llwldaycycle.cpp +++ b/indra/newview/llwldaycycle.cpp @@ -107,7 +107,7 @@ void LLWLDayCycle::loadDayCycleFromFile(const std::string & fileName) // static LLSD LLWLDayCycle::loadDayCycleFromPath(const std::string& file_path) { - LL_INFOS("Windlight") << "Loading DayCycle settings from " << file_path << LL_ENDL; + LL_DEBUGS("Windlight") << "Loading DayCycle settings from " << file_path << LL_ENDL; llifstream day_cycle_xml(file_path.c_str()); if (day_cycle_xml.is_open()) -- cgit v1.3 From f0107eb8aae46a928b0b3e6564cc4ed3031e1271 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 5 Apr 2016 17:01:15 -0400 Subject: fix merge error that broke reading avatar complexity reports from simulator --- indra/newview/llavatarrenderinfoaccountant.cpp | 113 ++++++++++--------------- 1 file changed, 46 insertions(+), 67 deletions(-) (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 2be3e8546f..5431daca32 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -103,89 +103,68 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64 if (result.has(KEY_AGENTS)) { - const LLSD & avatar_render_info = result[KEY_AGENTS]; - if (avatar_render_info.isMap()) + const LLSD & agents = result[KEY_AGENTS]; + if (agents.isMap()) { - if ( avatar_render_info.has(KEY_REPORTING_COMPLEXITY_LIMIT) - && avatar_render_info.has(KEY_OVER_COMPLEXITY_LIMIT)) + for (LLSD::map_const_iterator agent_iter = agents.beginMap(); + agent_iter != agents.endMap(); + agent_iter++ + ) { - U32 reporting = avatar_render_info[KEY_REPORTING_COMPLEXITY_LIMIT].asInteger(); - U32 overlimit = avatar_render_info[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); - - LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "<updateNotificationRegion(reporting, overlimit); - } - - if (avatar_render_info.has(KEY_AGENTS)) - { - const LLSD & agents = avatar_render_info[KEY_AGENTS]; - if (agents.isMap()) + LLUUID target_agent_id = LLUUID(agent_iter->first); + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && avatarp->isAvatar()) { - for (LLSD::map_const_iterator agent_iter = agents.beginMap(); - agent_iter != agents.endMap(); - agent_iter++ - ) + const LLSD & agent_info_map = agent_iter->second; + if (agent_info_map.isMap()) { - LLUUID target_agent_id = LLUUID(agent_iter->first); - LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); - if (avatarp && avatarp->isAvatar()) - { - const LLSD & agent_info_map = agent_iter->second; - if (agent_info_map.isMap()) - { - LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - - if (agent_info_map.has(KEY_WEIGHT)) - { - ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); - } - } - else - { - LL_WARNS("AvatarRenderInfo") << "agent entry invalid" - << " agent " << target_agent_id - << " map " << agent_info_map - << LL_ENDL; - } - } - else + LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; + + if (agent_info_map.has(KEY_WEIGHT)) { - LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL; + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); } - } // for agent_iter + } + else + { + LL_WARNS("AvatarRenderInfo") << "agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } } else { - LL_WARNS("AvatarRenderInfo") << "malformed get response agents avatar_render_info is not map" << LL_ENDL; + LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL; } - } // has "agents" - else if (avatar_render_info.has(KEY_ERROR)) - { - const LLSD & error = avatar_render_info[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "no agent key in get response" << LL_ENDL; - } + } // for agent_iter } else { - LL_WARNS("AvatarRenderInfo") << "malformed get response is not map" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response '" << KEY_AGENTS << "' is not map" << LL_ENDL; } } // has "agents" - else if (result.has(KEY_ERROR)) + else + { + LL_INFOS("AvatarRenderInfo") << "no '"<< KEY_AGENTS << "' key in get response" << LL_ENDL; + } + + if ( result.has(KEY_REPORTING_COMPLEXITY_LIMIT) + && result.has(KEY_OVER_COMPLEXITY_LIMIT)) + { + U32 reporting = result[KEY_REPORTING_COMPLEXITY_LIMIT].asInteger(); + U32 overlimit = result[KEY_OVER_COMPLEXITY_LIMIT].asInteger(); + + LL_DEBUGS("AvatarRenderInfo") << "complexity limit: "<updateNotificationRegion(reporting, overlimit); + } + else { - const LLSD & error = result[KEY_ERROR]; - LL_WARNS() << "Avatar render info GET error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() + LL_WARNS("AvatarRenderInfo") + << "response is missing either '" << KEY_REPORTING_COMPLEXITY_LIMIT + << "' or '" << KEY_OVER_COMPLEXITY_LIMIT << "'" << LL_ENDL; } -- cgit v1.3