diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llagent.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llvieweroctree.h | 12 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 12 | ||||
-rwxr-xr-x | indra/newview/llvocache.cpp | 5 | ||||
-rwxr-xr-x | indra/newview/pipeline.cpp | 61 | ||||
-rwxr-xr-x | indra/newview/pipeline.h | 1 |
6 files changed, 77 insertions, 15 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/llvieweroctree.h b/indra/newview/llvieweroctree.h index 342d149491..5e3cac260a 100644 --- a/indra/newview/llvieweroctree.h +++ b/indra/newview/llvieweroctree.h @@ -70,7 +70,7 @@ S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVect S32 AABBSphereIntersectR2(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &radius_squared); //defines data needed for octree of an entry -LL_ALIGN_PREFIX(16) +//LL_ALIGN_PREFIX(16) class LLViewerOctreeEntry : public LLRefCount { friend class LLViewerOctreeEntryData; @@ -128,10 +128,10 @@ private: mutable S32 mBinIndex; mutable U32 mVisible; -} LL_ALIGN_POSTFIX(16); +} ;//LL_ALIGN_POSTFIX(16); //defines an abstract class for entry data -LL_ALIGN_PREFIX(16) +//LL_ALIGN_PREFIX(16) class LLViewerOctreeEntryData : public LLRefCount { protected: @@ -178,11 +178,11 @@ protected: LLPointer<LLViewerOctreeEntry> mEntry; LLViewerOctreeEntry::eEntryDataType_t mDataType; static U32 sCurVisible; // Counter for what value of mVisible means currently visible -}LL_ALIGN_POSTFIX(16); +};//LL_ALIGN_POSTFIX(16); //defines an octree group for an octree node, which contains multiple entries. -LL_ALIGN_PREFIX(16) +//LL_ALIGN_PREFIX(16) class LLviewerOctreeGroup : public LLOctreeListener<LLViewerOctreeEntry> { friend class LLViewerOctreeCull; @@ -279,7 +279,7 @@ protected: public: S32 mVisible[LLViewerCamera::NUM_CAMERAS]; -}LL_ALIGN_POSTFIX(16); +};//LL_ALIGN_POSTFIX(16); //octree group which has capability to support occlusion culling //LL_ALIGN_PREFIX(16) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 9c038d54d5..7cc4195a3d 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1207,12 +1207,7 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) max_update_time -= update_timer.getElapsedTimeF32(); - if(gViewerWindow->getProgressView()->getVisible()) - { - //in case rendering pipeline is not started yet. - mImpl->mVOCachePartition->cull(*(LLViewerCamera::getInstance()), false); - } - else if(max_update_time < 0.f) + if(max_update_time < 0.f && !gViewerWindow->getProgressView()->getVisible()) { return did_update; } @@ -1279,7 +1274,8 @@ F32 LLViewerRegion::killInvisibleObjects(F32 max_time) return max_time; } - size_t max_update = sNewObjectCreationThrottle < 0 ? mImpl->mActiveSet.size() : 64; + bool unstable = sNewObjectCreationThrottle < 0; + size_t max_update = unstable ? mImpl->mActiveSet.size() : 64; if(!mInvisibilityCheckHistory && isViewerCameraStatic()) { //history is clean, reduce number of checking @@ -1299,7 +1295,7 @@ F32 LLViewerRegion::killInvisibleObjects(F32 max_time) iter = mImpl->mActiveSet.begin(); } - if(!(*iter)->isRecentlyVisible() && (*iter)->mLastCameraUpdated < sLastCameraUpdated) + if(!(*iter)->isRecentlyVisible() && (unstable || (*iter)->mLastCameraUpdated < sLastCameraUpdated)) { killObject((*iter), delete_list); } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 3c09981f7d..f0c9546651 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -636,6 +636,11 @@ S32 LLVOCachePartition::cull(LLCamera &camera, bool do_occlusion) return 0; } + if(LLViewerCamera::sCurCameraID >= LLViewerCamera::CAMERA_WATER0) + { + return 0; //no need for those cameras. + } + if(mCulledTime[LLViewerCamera::sCurCameraID] == LLViewerOctreeEntryData::getCurrentFrame()) { return 0; //already culled diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6e0f3a3c70..38bef1f4f5 100755 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2103,6 +2103,13 @@ void LLPipeline::updateMove() part->mOctree->balance(); } } + + //balance the VO Cache tree + LLVOCachePartition* vo_part = region->getVOCachePartition(); + if(vo_part) + { + vo_part->mOctree->balance(); + } } } } @@ -2895,6 +2902,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() { LL_RECORD_BLOCK_TIME(FTM_REBUILD_PRIORITY_GROUPS); @@ -7314,7 +7367,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 178a935d98..465ab44294 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); |