From 69e733ea86ebd7cd5a4acb40ef87735e5c428c53 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 10 Oct 2011 00:46:42 -0500 Subject: [PATCH] Cull orphaned attachments from render. Maybe dead av's are lingering? --- indra/newview/lldrawable.cpp | 12 ++++++++++++ indra/newview/pipeline.cpp | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 23633d74c..059198597 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1313,6 +1313,12 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector* return; } } + else + { + static const LLCachedControl 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 draw_orphans("ShyotlDrawOrphanAttachments",false); + if(!draw_orphans) + return; + } } LLCamera camera = transformCamera(camera_in); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 2612bf1e2..91ae2427f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2382,6 +2382,8 @@ void LLPipeline::markVisible(LLDrawable *drawablep, LLCamera& camera) root->getVObj()->isAttachment()) { LLDrawable* rootparent = root->getParent(); + static const LLCachedControl 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); }