From 4046a9082d793e71cac26a31d44c127decd6821f Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Fri, 11 Feb 2011 17:37:07 -0500 Subject: re-applying render cost changes for experimentations --- indra/newview/llselectmgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 93c9131424..90c2cf1eb4 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6391,7 +6391,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() return count; } -/*S32 LLObjectSelection::getSelectedObjectRenderCost() +S32 LLObjectSelection::getSelectedObjectRenderCost() { S32 cost = 0; LLVOVolume::texture_cost_t textures; @@ -6415,7 +6415,7 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() return cost; -}*/ +} //----------------------------------------------------------------------------- -- cgit v1.2.3 From 543df6736fb0ae312b9a5e056a35bf8fffd2b6c9 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Wed, 17 Aug 2011 01:42:21 +0300 Subject: SH-2171 FIXED New prim weights added to weights detail floater. - Fixed detecting cross-parcel objects selection. - Various fixes in LLAccountingCostManager. - getSelectedObjectRenderCost() moved from LLFloaterTools to LLObjectSelection where it used to reside. Previous commented out implementation of this method removed. --- indra/newview/llselectmgr.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 8fa4065fa6..7ff58f5d34 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6522,32 +6522,32 @@ U32 LLObjectSelection::getSelectedObjectTriangleCount() return count; } -/*S32 LLObjectSelection::getSelectedObjectRenderCost() +S32 LLObjectSelection::getSelectedObjectRenderCost() { S32 cost = 0; - LLVOVolume::texture_cost_t textures; - for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) - { - LLSelectNode* node = *iter; - LLVOVolume* object = (LLVOVolume*)node->getObject(); - - if (object) - { - cost += object->getRenderCost(textures); - } + std::set textures; - for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + for (list_t::iterator selection_iter = mList.begin(); selection_iter != mList.end(); + ++selection_iter) + { + LLSelectNode *select_node = *selection_iter; + if (select_node) { - // add the cost of each individual texture in the linkset - cost += iter->second; + LLViewerObject *vobj = select_node->getObject(); + if (vobj->getVolume()) + { + LLVOVolume* volume = (LLVOVolume*) vobj; + + cost += volume->getRenderCost(textures); + cost += textures.size() * LLVOVolume::ARC_TEXTURE_COST; + textures.clear(); + } } - textures.clear(); } return cost; -}*/ - +} //----------------------------------------------------------------------------- // getTECount() -- cgit v1.2.3 From cfe0a3cbe445900574b82e8c843bddc347f1b269 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 18 Aug 2011 19:16:08 -0400 Subject: BUILDFIX SH-1246 fixed a bug in the ARC computations, and texture cost computations in build tools Minor bug in ARC display computations, where wrong numbers were being used for child prims Feature enhancement to not double-count textures reused within a linkset. --- indra/newview/llselectmgr.cpp | 62 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 53 insertions(+), 9 deletions(-) (limited to 'indra/newview/llselectmgr.cpp') diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 9c85817a28..1880bb87d3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6526,24 +6526,68 @@ S32 LLObjectSelection::getSelectedObjectRenderCost() { S32 cost = 0; LLVOVolume::texture_cost_t textures; + typedef std::set uuid_list_t; + uuid_list_t computed_objects; + + typedef std::list > child_list_t; + typedef const child_list_t const_child_list_t; + + // add render cost of complete linksets first, to get accurate texture counts for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) { LLSelectNode* node = *iter; + LLVOVolume* object = (LLVOVolume*)node->getObject(); - if (object) - { - cost += object->getRenderCost(textures); - } - - for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + if (object && object->isRootEdit()) { - // add the cost of each individual texture in the linkset - cost += iter->second; + cost += object->getRenderCost(textures); + computed_objects.insert(object->getID()); + + const_child_list_t children = object->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 += child->getRenderCost(textures); + computed_objects.insert(child->getID()); + } + } + + 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; + } + + textures.clear(); } - textures.clear(); } + + // add any partial linkset objects, texture cost may be slightly misleading + for (list_t::iterator iter = mList.begin(); iter != mList.end(); ++iter) + { + LLSelectNode* node = *iter; + LLVOVolume* object = (LLVOVolume*)node->getObject(); + if (object && computed_objects.find(object->getID()) == computed_objects.end() ) + { + cost += object->getRenderCost(textures); + computed_objects.insert(object->getID()); + } + + 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; + } + + textures.clear(); + } return cost; } -- cgit v1.2.3