Cull orphaned attachments from render. Maybe dead av's are lingering?

This commit is contained in:
Shyotl
2011-10-10 00:46:42 -05:00
parent 080407d92f
commit 69e733ea86
2 changed files with 20 additions and 2 deletions

View File

@@ -1313,6 +1313,12 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>*
return;
}
}
else
{
static const LLCachedControl<bool> draw_orphans("ShyotlDrawOrphanAttachments",false);
if(!draw_orphans)
return;
}
}
@@ -1385,6 +1391,12 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
return;
}
}
else
{
static const LLCachedControl<bool> draw_orphans("ShyotlDrawOrphanAttachments",false);
if(!draw_orphans)
return;
}
}
LLCamera camera = transformCamera(camera_in);

View File

@@ -2382,6 +2382,8 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
root->getVObj()->isAttachment())
{
LLDrawable* rootparent = root->getParent();
static const LLCachedControl<bool> draw_orphans("ShyotlDrawOrphanAttachments",false);
if (rootparent) // this IS sometimes NULL
{
LLViewerObject *vobj = rootparent->getVObj();
@@ -2389,12 +2391,16 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera)
if (vobj) // this test may not be needed, see above
{
const LLVOAvatar* av = vobj->asAvatar();
if (av && av->isImpostor())
if (av && av->isImpostor() )
{
return;
return;
}
else if(!draw_orphans && (!av || av->isDead()))
return;
}
}
else if(!draw_orphans)
return;
}
sCull->pushBridge((LLSpatialBridge*) drawablep);
}