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.meow-7.2.2
parent
1f97cca856
commit
cfe0a3cbe4
|
|
@ -6526,24 +6526,68 @@ S32 LLObjectSelection::getSelectedObjectRenderCost()
|
|||
{
|
||||
S32 cost = 0;
|
||||
LLVOVolume::texture_cost_t textures;
|
||||
typedef std::set<LLUUID> uuid_list_t;
|
||||
uuid_list_t computed_objects;
|
||||
|
||||
typedef std::list<LLPointer<LLViewerObject> > 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)
|
||||
if (object && object->isRootEdit())
|
||||
{
|
||||
cost += object->getRenderCost(textures);
|
||||
}
|
||||
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;
|
||||
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<LLVOVolume*>( 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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8354,6 +8354,7 @@ void LLVOAvatar::idleUpdateRenderCost()
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin();
|
||||
iter != mAttachmentPoints.end();
|
||||
++iter)
|
||||
|
|
@ -8384,7 +8385,7 @@ void LLVOAvatar::idleUpdateRenderCost()
|
|||
LLVOVolume *child = dynamic_cast<LLVOVolume*>( child_obj );
|
||||
if (child)
|
||||
{
|
||||
cost += volume->getRenderCost(textures);
|
||||
cost += child->getRenderCost(textures);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue