summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorsimon <none@none>2013-04-15 16:29:14 -0700
committersimon <none@none>2013-04-15 16:29:14 -0700
commit98f438656b3f4ae8a0b6fbd6327cfff3ef243545 (patch)
treef46c0010bf8de8dee06e503e8739b388ea112283 /indra/newview
parent205938b652bc9218494835afadce095b29f1d19d (diff)
MAINT-2548 : Add debug viewer render info for AV metrics. Reviewed by Kelly
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/app_settings/settings.xml11
-rwxr-xr-xindra/newview/llviewerwindow.cpp43
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml10
3 files changed, 61 insertions, 3 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c7895fbd99..75c38ad62f 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -2136,6 +2136,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>DebugShowAvatarRenderInfo</key>
+ <map>
+ <key>Comment</key>
+ <string>Show avatar render cost information</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>DebugShowColor</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index b3bb584881..bb71707db6 100755
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -332,9 +332,10 @@ public:
mTextColor = LLColor4( 0.86f, 0.86f, 0.86f, 1.f );
// Draw stuff growing up from right lower corner of screen
- U32 xpos = mWindow->getWorldViewWidthScaled() - 350;
- U32 ypos = 64;
- const U32 y_inc = 20;
+ S32 xpos = mWindow->getWorldViewWidthScaled() - 400;
+ xpos = llmax(xpos, 0);
+ S32 ypos = 64;
+ const S32 y_inc = 20;
clearText();
@@ -634,6 +635,42 @@ public:
LLVertexBuffer::sSetCount = LLImageGL::sUniqueCount =
gPipeline.mNumVisibleNodes = LLPipeline::sVisibleLightCount = 0;
}
+ if (gSavedSettings.getBOOL("DebugShowAvatarRenderInfo"))
+ {
+ std::map<std::string, LLVOAvatar*> sorted_avs;
+
+ std::vector<LLCharacter*>::iterator sort_iter = LLCharacter::sInstances.begin();
+ while (sort_iter != LLCharacter::sInstances.end())
+ {
+ LLVOAvatar* avatar = dynamic_cast<LLVOAvatar*>(*sort_iter);
+ if (avatar &&
+ !avatar->isDead()) // Not dead yet
+ {
+ // Stuff into a sorted map so the display is ordered
+ sorted_avs[avatar->getFullname()] = avatar;
+ }
+ sort_iter++;
+ }
+
+ std::string trunc_name;
+ std::map<std::string, LLVOAvatar*>::reverse_iterator av_iter = sorted_avs.rbegin(); // Put "A" at the top
+ while (av_iter != sorted_avs.rend())
+ {
+ LLVOAvatar* avatar = av_iter->second;
+
+ avatar->calculateUpdateRenderCost(); // 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",
+ trunc_name.c_str(),
+ avatar->getRezzedStatus(),
+ avatar->getVisualComplexity(),
+ avatar->getAttachmentGeometryBytes(),
+ avatar->getAttachmentSurfaceArea()));
+ ypos += y_inc;
+ av_iter++;
+ }
+ }
if (gSavedSettings.getBOOL("DebugShowRenderMatrices"))
{
addText(xpos, ypos, llformat("%.4f .%4f %.4f %.4f", gGLProjection[12], gGLProjection[13], gGLProjection[14], gGLProjection[15]));
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index 1197f1ce1f..f66272aa2e 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -2206,6 +2206,16 @@
function="ToggleControl"
parameter="DebugShowRenderInfo" />
</menu_item_check>
+ <menu_item_check
+ label="Show Avatar Render Info"
+ name="Show Avatar Render Info">
+ <menu_item_check.on_check
+ function="CheckControl"
+ parameter="DebugShowAvatarRenderInfo" />
+ <menu_item_check.on_click
+ function="ToggleControl"
+ parameter="DebugShowAvatarRenderInfo" />
+ </menu_item_check>
<menu_item_check
label="Show Texture Info"
name="Show Texture Info">