From c57c8c21881f0ee543f63f45b524f442a59fa7d2 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 17 May 2011 18:33:59 -0400 Subject: SH-1246 WIP fix render cost in the viewer Modified avatar display to compute values correctly. Also changed build tools XML temporarily so build tool costs can be seen. --- indra/newview/llvoavatar.cpp | 26 +++++++++++++++++----- .../newview/skins/default/xui/en/floater_tools.xml | 22 +++++++++--------- 2 files changed, 32 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a195f0fb68..cd98fe6d7e 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -8282,6 +8282,7 @@ void LLVOAvatar::idleUpdateRenderCost() const LLViewerObject* attached_object = (*attachment_iter); if (attached_object && !attached_object->isHUDAttachment()) { + textures.clear(); const LLDrawable* drawable = attached_object->mDrawable; if (drawable) { @@ -8289,6 +8290,25 @@ void LLVOAvatar::idleUpdateRenderCost() if (volume) { cost += volume->getRenderCost(textures); + + const_child_list_t children = volume->getChildren(); + for (const_child_list_t::const_iterator child_iter = children.begin(); + child_iter != children.end(); + ++child_iter) + { + LLViewerObject* child_obj = *child_iter; + LLVOVolume *child = dynamic_cast( child_obj ); + if (child) + { + cost += volume->getRenderCost(textures); + } + } + + for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + { + // add the cost of each individual texture in the linkset + cost += iter->second; + } } } } @@ -8296,11 +8316,7 @@ void LLVOAvatar::idleUpdateRenderCost() } - for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) - { - // add the cost of each individual texture in the linkset - cost += iter->second; - } + // Diagnostic output to identify all avatar-related textures. // Does not affect rendering cost calculation. diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 05d47506db..b99a8b6228 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -788,35 +788,35 @@ name="linked_set_count" top="144" width="80"> - Linked Sets: [COUNT] + L: [COUNT] - Cost: [COST] / [PHYSICS] + O: [COUNT] - Objects: [COUNT] + Cost: [COST] / [PHYSICS]