Replaced obsolete priority spatial queue lock with new group-specific variants
This commit is contained in:
@@ -317,11 +317,13 @@ BOOL LLVolumeImplFlexible::doIdleUpdate(LLAgent &agent, LLWorld &world, const F6
|
|||||||
return FALSE; // (we are not initialized or updated)
|
return FALSE; // (we are not initialized or updated)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force_update)
|
bool visible = mVO->mDrawable->isVisible();
|
||||||
|
|
||||||
|
if (force_update && visible)
|
||||||
{
|
{
|
||||||
gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_POSITION, FALSE);
|
gPipeline.markRebuild(mVO->mDrawable, LLDrawable::REBUILD_POSITION, FALSE);
|
||||||
}
|
}
|
||||||
else if (mVO->mDrawable->isVisible() &&
|
else if (visible &&
|
||||||
!mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) &&
|
!mVO->mDrawable->isState(LLDrawable::IN_REBUILD_Q1) &&
|
||||||
mVO->getPixelArea() > 256.f)
|
mVO->getPixelArea() > 256.f)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -784,7 +784,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
|||||||
{
|
{
|
||||||
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
|
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
|
||||||
gFrameStats.start(LLFrameStats::STATE_SORT);
|
gFrameStats.start(LLFrameStats::STATE_SORT);
|
||||||
gPipeline.sAllowRebuildPriorityGroup = TRUE ;
|
|
||||||
gPipeline.stateSort(*LLViewerCamera::getInstance(), result);
|
gPipeline.stateSort(*LLViewerCamera::getInstance(), result);
|
||||||
stop_glerror();
|
stop_glerror();
|
||||||
|
|
||||||
|
|||||||
@@ -271,7 +271,6 @@ BOOL LLPipeline::sRenderFrameTest = FALSE;
|
|||||||
BOOL LLPipeline::sRenderAttachedLights = TRUE;
|
BOOL LLPipeline::sRenderAttachedLights = TRUE;
|
||||||
BOOL LLPipeline::sRenderAttachedParticles = TRUE;
|
BOOL LLPipeline::sRenderAttachedParticles = TRUE;
|
||||||
BOOL LLPipeline::sRenderDeferred = FALSE;
|
BOOL LLPipeline::sRenderDeferred = FALSE;
|
||||||
BOOL LLPipeline::sAllowRebuildPriorityGroup = FALSE ;
|
|
||||||
S32 LLPipeline::sVisibleLightCount = 0;
|
S32 LLPipeline::sVisibleLightCount = 0;
|
||||||
F32 LLPipeline::sMinRenderSize = 0.f;
|
F32 LLPipeline::sMinRenderSize = 0.f;
|
||||||
|
|
||||||
@@ -318,6 +317,8 @@ LLPipeline::LLPipeline() :
|
|||||||
mRenderDebugFeatureMask(0),
|
mRenderDebugFeatureMask(0),
|
||||||
mRenderDebugMask(0),
|
mRenderDebugMask(0),
|
||||||
mOldRenderDebugMask(0),
|
mOldRenderDebugMask(0),
|
||||||
|
mGroupQ1Locked(false),
|
||||||
|
mGroupQ2Locked(false),
|
||||||
mLastRebuildPool(NULL),
|
mLastRebuildPool(NULL),
|
||||||
mAlphaPool(NULL),
|
mAlphaPool(NULL),
|
||||||
mSkyPool(NULL),
|
mSkyPool(NULL),
|
||||||
@@ -1866,17 +1867,13 @@ void LLPipeline::updateGL()
|
|||||||
|
|
||||||
void LLPipeline::rebuildPriorityGroups()
|
void LLPipeline::rebuildPriorityGroups()
|
||||||
{
|
{
|
||||||
if(!sAllowRebuildPriorityGroup)
|
|
||||||
{
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
sAllowRebuildPriorityGroup = FALSE ;
|
|
||||||
|
|
||||||
LLTimer update_timer;
|
LLTimer update_timer;
|
||||||
LLMemType mt(LLMemType::MTYPE_PIPELINE);
|
LLMemType mt(LLMemType::MTYPE_PIPELINE);
|
||||||
|
|
||||||
assertInitialized();
|
assertInitialized();
|
||||||
|
|
||||||
|
|
||||||
|
mGroupQ1Locked = true;
|
||||||
// Iterate through all drawables on the priority build queue,
|
// Iterate through all drawables on the priority build queue,
|
||||||
for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin();
|
for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ1.begin();
|
||||||
iter != mGroupQ1.end(); ++iter)
|
iter != mGroupQ1.end(); ++iter)
|
||||||
@@ -1887,6 +1884,8 @@ void LLPipeline::rebuildPriorityGroups()
|
|||||||
}
|
}
|
||||||
|
|
||||||
mGroupQ1.clear();
|
mGroupQ1.clear();
|
||||||
|
mGroupQ1Locked = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLPipeline::rebuildGroups()
|
void LLPipeline::rebuildGroups()
|
||||||
@@ -1896,6 +1895,7 @@ void LLPipeline::rebuildGroups()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mGroupQ2Locked = true;
|
||||||
// Iterate through some drawables on the non-priority build queue
|
// Iterate through some drawables on the non-priority build queue
|
||||||
S32 size = (S32) mGroupQ2.size();
|
S32 size = (S32) mGroupQ2.size();
|
||||||
S32 min_count = llclamp((S32) ((F32) (size * size)/4096*0.25f), 1, size);
|
S32 min_count = llclamp((S32) ((F32) (size * size)/4096*0.25f), 1, size);
|
||||||
@@ -1928,6 +1928,8 @@ void LLPipeline::rebuildGroups()
|
|||||||
|
|
||||||
mGroupQ2.erase(mGroupQ2.begin(), ++last_iter);
|
mGroupQ2.erase(mGroupQ2.begin(), ++last_iter);
|
||||||
|
|
||||||
|
mGroupQ2Locked = false;
|
||||||
|
|
||||||
updateMovedList(mMovedBridge);
|
updateMovedList(mMovedBridge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2217,6 +2219,8 @@ void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority)
|
|||||||
{
|
{
|
||||||
if (!group->isState(LLSpatialGroup::IN_BUILD_Q1))
|
if (!group->isState(LLSpatialGroup::IN_BUILD_Q1))
|
||||||
{
|
{
|
||||||
|
llassert_always(!mGroupQ1Locked);
|
||||||
|
|
||||||
mGroupQ1.push_back(group);
|
mGroupQ1.push_back(group);
|
||||||
group->setState(LLSpatialGroup::IN_BUILD_Q1);
|
group->setState(LLSpatialGroup::IN_BUILD_Q1);
|
||||||
|
|
||||||
@@ -2233,6 +2237,7 @@ void LLPipeline::markRebuild(LLSpatialGroup* group, BOOL priority)
|
|||||||
}
|
}
|
||||||
else if (!group->isState(LLSpatialGroup::IN_BUILD_Q2 | LLSpatialGroup::IN_BUILD_Q1))
|
else if (!group->isState(LLSpatialGroup::IN_BUILD_Q2 | LLSpatialGroup::IN_BUILD_Q1))
|
||||||
{
|
{
|
||||||
|
llassert_always(!mGroupQ2Locked);
|
||||||
//llerrs << "Non-priority updates not yet supported!" << llendl;
|
//llerrs << "Non-priority updates not yet supported!" << llendl;
|
||||||
if (std::find(mGroupQ2.begin(), mGroupQ2.end(), group) != mGroupQ2.end())
|
if (std::find(mGroupQ2.begin(), mGroupQ2.end(), group) != mGroupQ2.end())
|
||||||
{
|
{
|
||||||
@@ -3768,10 +3773,16 @@ void LLPipeline::renderDebug()
|
|||||||
U32 size = mGroupQ2.size();
|
U32 size = mGroupQ2.size();
|
||||||
LLColor4 col;
|
LLColor4 col;
|
||||||
|
|
||||||
|
LLVertexBuffer::unbind();
|
||||||
LLGLEnable blend(GL_BLEND);
|
LLGLEnable blend(GL_BLEND);
|
||||||
|
gGL.setSceneBlendType(LLRender::BT_ALPHA);
|
||||||
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
|
||||||
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
|
gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
|
||||||
|
|
||||||
|
gGL.pushMatrix();
|
||||||
|
glLoadMatrixd(gGLModelView);
|
||||||
|
gGLLastMatrix = NULL;
|
||||||
|
|
||||||
for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter)
|
for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter)
|
||||||
{
|
{
|
||||||
LLSpatialGroup* group = *iter;
|
LLSpatialGroup* group = *iter;
|
||||||
@@ -3793,7 +3804,7 @@ void LLPipeline::renderDebug()
|
|||||||
glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
|
glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
F32 alpha = (F32) (size-count)/size;
|
F32 alpha = llclamp((F32) (size-count)/size, 0.f, 1.f);
|
||||||
|
|
||||||
|
|
||||||
LLVector2 c(1.f-alpha, alpha);
|
LLVector2 c(1.f-alpha, alpha);
|
||||||
@@ -3801,7 +3812,7 @@ void LLPipeline::renderDebug()
|
|||||||
|
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
col.set(c.mV[0], c.mV[1], 0, alpha*0.5f+0.1f);
|
col.set(c.mV[0], c.mV[1], 0, alpha*0.5f+0.5f);
|
||||||
group->drawObjectBox(col);
|
group->drawObjectBox(col);
|
||||||
|
|
||||||
if (bridge)
|
if (bridge)
|
||||||
@@ -3809,6 +3820,8 @@ void LLPipeline::renderDebug()
|
|||||||
gGL.popMatrix();
|
gGL.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gGL.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
gGL.flush();
|
gGL.flush();
|
||||||
|
|||||||
@@ -463,7 +463,6 @@ public:
|
|||||||
static BOOL sRenderAttachedLights;
|
static BOOL sRenderAttachedLights;
|
||||||
static BOOL sRenderAttachedParticles;
|
static BOOL sRenderAttachedParticles;
|
||||||
static BOOL sRenderDeferred;
|
static BOOL sRenderDeferred;
|
||||||
static BOOL sAllowRebuildPriorityGroup;
|
|
||||||
static S32 sVisibleLightCount;
|
static S32 sVisibleLightCount;
|
||||||
static F32 sMinRenderSize;
|
static F32 sMinRenderSize;
|
||||||
|
|
||||||
@@ -585,6 +584,9 @@ protected:
|
|||||||
LLDrawable::drawable_list_t mBuildQ2; // non-priority
|
LLDrawable::drawable_list_t mBuildQ2; // non-priority
|
||||||
LLSpatialGroup::sg_vector_t mGroupQ1; //priority
|
LLSpatialGroup::sg_vector_t mGroupQ1; //priority
|
||||||
LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority
|
LLSpatialGroup::sg_vector_t mGroupQ2; // non-priority
|
||||||
|
bool mGroupQ2Locked;
|
||||||
|
bool mGroupQ1Locked;
|
||||||
|
|
||||||
LLViewerObject::vobj_list_t mCreateQ;
|
LLViewerObject::vobj_list_t mCreateQ;
|
||||||
|
|
||||||
LLDrawable::drawable_set_t mRetexturedList;
|
LLDrawable::drawable_set_t mRetexturedList;
|
||||||
|
|||||||
Reference in New Issue
Block a user