diff options
author | Oz Linden <oz@lindenlab.com> | 2014-12-03 10:13:50 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2014-12-03 10:13:50 -0500 |
commit | 9785a88ba447087fb547794430f24d7513909cbe (patch) | |
tree | 1c3cf93a869c07e11bc01e45fe0e2b5651a96d38 /indra/newview | |
parent | 6c534dff5f30e503d6f5b63cdeeb4c0e2a29ae28 (diff) |
further improvements to avatar render info display and logging of associated server messages
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llavatarrenderinfoaccountant.cpp | 119 | ||||
-rw-r--r-- | indra/newview/llavatarrenderinfoaccountant.h | 2 | ||||
-rwxr-xr-x | indra/newview/llvoavatar.cpp | 54 |
3 files changed, 81 insertions, 94 deletions
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<bool> 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<U32> 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<U32> 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<F32> 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<U32> 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<U32> 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 } } |