diff options
Diffstat (limited to 'indra/newview/lldrawable.cpp')
-rw-r--r-- | indra/newview/lldrawable.cpp | 84 |
1 files changed, 53 insertions, 31 deletions
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index 507af56cb0..502ebbd4b1 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -58,8 +58,6 @@ const F32 MIN_INTERPOLATE_DISTANCE_SQUARED = 0.001f * 0.001f; const F32 MAX_INTERPOLATE_DISTANCE_SQUARED = 10.f * 10.f; const F32 OBJECT_DAMPING_TIME_CONSTANT = 0.06f; -static LLTrace::BlockTimerStatHandle FTM_CULL_REBOUND("Cull Rebound"); - extern bool gShiftFrame; @@ -93,7 +91,6 @@ void LLDrawable::incrementVisible() LLDrawable::LLDrawable(LLViewerObject *vobj, bool new_entry) : LLViewerOctreeEntryData(LLViewerOctreeEntry::LLDRAWABLE), - LLTrace::MemTrackable<LLDrawable, 16>("LLDrawable"), mVObjp(vobj) { init(new_entry); @@ -101,6 +98,8 @@ LLDrawable::LLDrawable(LLViewerObject *vobj, bool new_entry) void LLDrawable::init(bool new_entry) { + LL_PROFILE_ZONE_SCOPED + // mXform mParent = NULL; mRenderType = 0; @@ -261,19 +260,13 @@ BOOL LLDrawable::isLight() const } } -static LLTrace::BlockTimerStatHandle FTM_CLEANUP_DRAWABLE("Cleanup Drawable"); -static LLTrace::BlockTimerStatHandle FTM_DEREF_DRAWABLE("Deref"); -static LLTrace::BlockTimerStatHandle FTM_DELETE_FACES("Faces"); - void LLDrawable::cleanupReferences() { - LL_RECORD_BLOCK_TIME(FTM_CLEANUP_DRAWABLE); + LL_PROFILE_ZONE_SCOPED; - { - LL_RECORD_BLOCK_TIME(FTM_DELETE_FACES); - std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); - mFaces.clear(); - } + + std::for_each(mFaces.begin(), mFaces.end(), DeletePointer()); + mFaces.clear(); gObjectList.removeDrawable(this); @@ -281,12 +274,9 @@ void LLDrawable::cleanupReferences() removeFromOctree(); - { - LL_RECORD_BLOCK_TIME(FTM_DEREF_DRAWABLE); - // Cleanup references to other objects - mVObjp = NULL; - mParent = NULL; - } + // Cleanup references to other objects + mVObjp = NULL; + mParent = NULL; } void LLDrawable::removeFromOctree() @@ -331,14 +321,12 @@ S32 LLDrawable::findReferences(LLDrawable *drawablep) return count; } -static LLTrace::BlockTimerStatHandle FTM_ALLOCATE_FACE("Allocate Face"); - LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep) { + LL_PROFILE_ZONE_SCOPED LLFace *face; { - LL_RECORD_BLOCK_TIME(FTM_ALLOCATE_FACE); face = new LLFace(this, mVObjp); } @@ -363,13 +351,12 @@ LLFace* LLDrawable::addFace(LLFacePool *poolp, LLViewerTexture *texturep) LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep) { - LLFace *face; + LL_PROFILE_ZONE_SCOPED - { - LL_RECORD_BLOCK_TIME(FTM_ALLOCATE_FACE); - face = new LLFace(this, mVObjp); - } + LLFace *face; + face = new LLFace(this, mVObjp); + face->setTEOffset(mFaces.size()); face->setTexture(texturep); face->setPoolType(gPipeline.getPoolTypeFromTE(te, texturep)); @@ -387,6 +374,8 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep) LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLViewerTexture *normalp) { + LL_PROFILE_ZONE_SCOPED + LLFace *face; face = new LLFace(this, mVObjp); @@ -408,6 +397,8 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, LLViewerTexture *normalp, LLViewerTexture *specularp) { + LL_PROFILE_ZONE_SCOPED + LLFace *face; face = new LLFace(this, mVObjp); @@ -430,6 +421,8 @@ LLFace* LLDrawable::addFace(const LLTextureEntry *te, LLViewerTexture *texturep, void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep) { + LL_PROFILE_ZONE_SCOPED + if (newFaces == (S32)mFaces.size()) { return; @@ -453,6 +446,8 @@ void LLDrawable::setNumFaces(const S32 newFaces, LLFacePool *poolp, LLViewerText void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewerTexture *texturep) { + LL_PROFILE_ZONE_SCOPED + if (newFaces <= (S32)mFaces.size() && newFaces >= (S32)mFaces.size()/2) { return; @@ -476,6 +471,8 @@ void LLDrawable::setNumFacesFast(const S32 newFaces, LLFacePool *poolp, LLViewer void LLDrawable::mergeFaces(LLDrawable* src) { + LL_PROFILE_ZONE_SCOPED + U32 face_count = mFaces.size() + src->mFaces.size(); mFaces.reserve(face_count); @@ -509,6 +506,8 @@ void LLDrawable::updateMaterial() void LLDrawable::makeActive() { + LL_PROFILE_ZONE_SCOPED + #if !LL_RELEASE_FOR_DOWNLOAD if (mVObjp.notNull()) { @@ -572,6 +571,8 @@ void LLDrawable::makeActive() void LLDrawable::makeStatic(BOOL warning_enabled) { + LL_PROFILE_ZONE_SCOPED + if (isState(ACTIVE) && !isState(ACTIVE_CHILD) && !mVObjp->isAttachment() && @@ -618,6 +619,8 @@ void LLDrawable::makeStatic(BOOL warning_enabled) // Returns "distance" between target destination and resulting xfrom F32 LLDrawable::updateXform(BOOL undamped) { + LL_PROFILE_ZONE_SCOPED + BOOL damped = !undamped; // Position @@ -769,6 +772,8 @@ void LLDrawable::moveUpdatePipeline(BOOL moved) void LLDrawable::movePartition() { + LL_PROFILE_ZONE_SCOPED + LLSpatialPartition* part = getSpatialPartition(); if (part) { @@ -813,6 +818,8 @@ BOOL LLDrawable::updateMoveUndamped() void LLDrawable::updatePartition() { + LL_PROFILE_ZONE_SCOPED + if (!getVOVolume()) { movePartition(); @@ -830,6 +837,8 @@ void LLDrawable::updatePartition() BOOL LLDrawable::updateMoveDamped() { + LL_PROFILE_ZONE_SCOPED + F32 dist_squared = updateXform(FALSE); mGeneration++; @@ -853,6 +862,8 @@ BOOL LLDrawable::updateMoveDamped() void LLDrawable::updateDistance(LLCamera& camera, bool force_update) { + LL_PROFILE_ZONE_SCOPED + if (LLViewerCamera::sCurCameraID != LLViewerCamera::CAMERA_WORLD) { LL_WARNS() << "Attempted to update distance for non-world camera." << LL_ENDL; @@ -957,6 +968,8 @@ void LLDrawable::updateTexture() BOOL LLDrawable::updateGeometry(BOOL priority) { + LL_PROFILE_ZONE_SCOPED + llassert(mVObjp.notNull()); BOOL res = mVObjp->updateGeometry(this); return res; @@ -1034,6 +1047,8 @@ const LLVector3& LLDrawable::getBounds(LLVector3& min, LLVector3& max) const void LLDrawable::updateSpatialExtents() { + LL_PROFILE_ZONE_SCOPED + if (mVObjp) { const LLVector4a* exts = getSpatialExtents(); @@ -1164,6 +1179,8 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp) LLSpatialPartition* LLDrawable::getSpatialPartition() { + LL_PROFILE_ZONE_SCOPED + LLSpatialPartition* retval = NULL; if (!mVObjp || @@ -1247,6 +1264,8 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 dat LLDrawable(root->getVObj(), true), LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB, regionp) { + LL_PROFILE_ZONE_SCOPED + mBridge = this; mDrawable = root; root->setSpatialBridge(this); @@ -1292,12 +1311,11 @@ void LLSpatialBridge::destroyTree() void LLSpatialBridge::updateSpatialExtents() { + LL_PROFILE_ZONE_SCOPED + LLSpatialGroup* root = (LLSpatialGroup*) mOctree->getListener(0); - { - LL_RECORD_BLOCK_TIME(FTM_CULL_REBOUND); - root->rebound(); - } + root->rebound(); const LLVector4a* root_bounds = root->getBounds(); LLVector4a offset; @@ -1455,6 +1473,8 @@ public: void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* results, BOOL for_select) { + LL_PROFILE_ZONE_SCOPED + if (!gPipeline.hasRenderType(mDrawableType)) { return; @@ -1552,6 +1572,8 @@ void LLSpatialBridge::setVisible(LLCamera& camera_in, std::vector<LLDrawable*>* void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update) { + LL_PROFILE_ZONE_SCOPED + if (mDrawable == NULL) { markDead(); |