diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-09-09 11:29:25 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-09-09 11:29:25 -0600 |
commit | 01098f5daba77e12fe739a3c8eaa722a95b83ea9 (patch) | |
tree | c0a90beda0f0e2d6e8b66fd1e74a04d54cb8b30e /indra | |
parent | f04fe8010ab1a0c980ecd197f37da66a7fda0ad6 (diff) |
eliminate some redundant geometry rebuilding operations during teleporting
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llagent.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/pipeline.cpp | 54 | ||||
-rwxr-xr-x | indra/newview/pipeline.h | 1 |
3 files changed, 55 insertions, 1 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a7bd628d5a..d7965c1e8f 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4015,6 +4015,7 @@ void LLAgent::teleportCancel() } clearTeleportRequest(); gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); + gPipeline.resetVertexBuffers(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 0ae9b08a4b..019b49b8fb 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2895,6 +2895,52 @@ void LLPipeline::clearRebuildGroups() mGroupQ2Locked = false; } +void LLPipeline::clearRebuildDrawables() +{ + // Clear all drawables on the priority build queue, + for (LLDrawable::drawable_list_t::iterator iter = mBuildQ1.begin(); + iter != mBuildQ1.end(); ++iter) + { + LLDrawable* drawablep = *iter; + if (drawablep && !drawablep->isDead()) + { + drawablep->clearState(LLDrawable::IN_REBUILD_Q2); + drawablep->clearState(LLDrawable::IN_REBUILD_Q1); + } + } + mBuildQ1.clear(); + + // clear drawables on the non-priority build queue + for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin(); + iter != mBuildQ2.end(); ++iter) + { + LLDrawable* drawablep = *iter; + if (!drawablep->isDead()) + { + drawablep->clearState(LLDrawable::IN_REBUILD_Q2); + } + } + mBuildQ2.clear(); + + //clear all moving bridges + for (LLDrawable::drawable_vector_t::iterator iter = mMovedBridge.begin(); + iter != mMovedBridge.end(); ++iter) + { + LLDrawable *drawablep = *iter; + drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD); + } + mMovedBridge.clear(); + + //clear all moving drawables + for (LLDrawable::drawable_vector_t::iterator iter = mMovedList.begin(); + iter != mMovedList.end(); ++iter) + { + LLDrawable *drawablep = *iter; + drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD); + } + mMovedList.clear(); +} + void LLPipeline::rebuildPriorityGroups() { LLFastTimer t(FTM_REBUILD_PRIORITY_GROUPS); @@ -7314,7 +7360,13 @@ void LLPipeline::doResetVertexBuffers() } } } - LLSpatialPartition::sTeleportRequested = FALSE; + if(LLSpatialPartition::sTeleportRequested) + { + LLSpatialPartition::sTeleportRequested = FALSE; + + clearRebuildGroups(); + clearRebuildDrawables(); + } resetDrawOrders(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index b12dc3edbb..867a515cd5 100755 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -245,6 +245,7 @@ public: void rebuildPriorityGroups(); void rebuildGroups(); void clearRebuildGroups(); + void clearRebuildDrawables(); //calculate pixel area of given box from vantage point of given camera static F32 calcPixelArea(LLVector3 center, LLVector3 size, LLCamera& camera); |