Catch up with viewer-beta. Primarily sim transition alterations to reduce frame hitching, and some optimization in LLViewerObjectList (std::set -> std::vector and and some allocation tweakage).

This commit is contained in:
Shyotl
2012-10-20 17:02:43 -05:00
parent 43271f290e
commit b73f4dd8e4
20 changed files with 218 additions and 96 deletions

View File

@@ -63,6 +63,8 @@ const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f;
static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
extern bool gShiftFrame;
////////////////////////
//
@@ -722,6 +724,11 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
return;
}
if (gShiftFrame)
{
return;
}
//switch LOD with the spatial group to avoid artifacts
//LLSpatialGroup* sg = getSpatialGroup();
@@ -820,14 +827,19 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
mXform.setPosition(mVObjp->getPositionAgent());
}
mXform.setRotation(mVObjp->getRotation());
mXform.setScale(1,1,1);
mXform.updateMatrix();
if (isStatic())
{
LLVOVolume* volume = getVOVolume();
if (!volume)
bool rebuild = (!volume &&
getRenderType() != LLPipeline::RENDER_TYPE_TREE &&
getRenderType() != LLPipeline::RENDER_TYPE_TERRAIN &&
getRenderType() != LLPipeline::RENDER_TYPE_SKY &&
getRenderType() != LLPipeline::RENDER_TYPE_GROUND);
if (rebuild)
{
gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE);
}
@@ -841,7 +853,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
facep->mExtents[0].add(shift_vector);
facep->mExtents[1].add(shift_vector);
if (!volume && facep->hasGeometry())
if (rebuild && facep->hasGeometry())
{
facep->clearVertexBuffer();
}
@@ -960,6 +972,12 @@ LLSpatialGroup* LLDrawable::getSpatialGroup() const
void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
{
//precondition: mSpatialGroupp MUST be null or DEAD or mSpatialGroupp MUST NOT contain this
llassert(!mSpatialGroupp || mSpatialGroupp->isDead() || !mSpatialGroupp->hasElement(this));
//precondition: groupp MUST be null or groupp MUST contain this
llassert(!groupp || groupp->hasElement(this));
/*if (mSpatialGroupp && (groupp != mSpatialGroupp))
{
mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY);
@@ -979,9 +997,12 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
}
}
mSpatialGroupp = groupp;
//postcondition: if next group is NULL, previous group must be dead OR NULL OR binIndex must be -1
//postcondition: if next group is NOT NULL, binIndex must not be -1
llassert(groupp == NULL ? (mSpatialGroupp == NULL || mSpatialGroupp->isDead()) || getBinIndex() == -1 :
getBinIndex() != -1);
llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
mSpatialGroupp = groupp;
}
LLSpatialPartition* LLDrawable::getSpatialPartition()
@@ -1416,6 +1437,11 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
return;
}
if (gShiftFrame)
{
return;
}
if (mDrawable->getVObj())
{
if (mDrawable->getVObj()->isAttachment())
@@ -1499,13 +1525,11 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable::cleanupReferences();
if (mDrawable)
{
LLSpatialGroup* group = mDrawable->getSpatialGroup();
if (group)
{
group->mOctreeNode->remove(mDrawable);
mDrawable->setSpatialGroup(NULL);
}
/*
DON'T DO THIS -- this should happen through octree destruction
mDrawable->setSpatialGroup(NULL);
if (mDrawable->getVObj())
{
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
@@ -1516,15 +1540,10 @@ void LLSpatialBridge::cleanupReferences()
LLDrawable* drawable = child->mDrawable;
if (drawable)
{
LLSpatialGroup* group = drawable->getSpatialGroup();
if (group)
{
group->mOctreeNode->remove(drawable);
drawable->setSpatialGroup(NULL);
}
drawable->setSpatialGroup(NULL);
}
}
}
}*/
LLDrawable* drawablep = mDrawable;
mDrawable = NULL;