summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-05-17 18:09:36 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-05-17 18:09:36 -0500
commitc827d32ebedeaa46ed75a91ae779f6547fc0d090 (patch)
tree0196248e4d7a2e42b36ab1189408ac3ea99c43e9 /indra/newview/pipeline.cpp
parenta2e418f250c49de9aba943a62f92189fcef6220a (diff)
SL-19655 Decruft legacy GLSL shaders and now unused build queues.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp217
1 files changed, 5 insertions, 212 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 9960ce7bd0..2687ccfae2 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -338,7 +338,6 @@ LLPipeline::LLPipeline() :
mOldRenderDebugMask(0),
mMeshDirtyQueryObject(0),
mGroupQ1Locked(false),
- mGroupQ2Locked(false),
mResetVertexBuffers(false),
mLastRebuildPool(NULL),
mLightMask(0),
@@ -557,7 +556,6 @@ void LLPipeline::cleanup()
assertInitialized();
mGroupQ1.clear() ;
- mGroupQ2.clear() ;
for(pool_set_t::iterator iter = mPools.begin();
iter != mPools.end(); )
@@ -2513,33 +2511,6 @@ void LLPipeline::clearRebuildGroups()
// Copy the saved HUD groups back in
mGroupQ1.assign(hudGroups.begin(), hudGroups.end());
mGroupQ1Locked = false;
-
- // Clear the HUD groups
- hudGroups.clear();
-
- mGroupQ2Locked = true;
- for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin();
- iter != mGroupQ2.end(); ++iter)
- {
- LLSpatialGroup* group = *iter;
-
- // If the group contains HUD objects, save the group
- if (group->isHUDGroup())
- {
- hudGroups.push_back(group);
- }
- // Else, no HUD objects so clear the build state
- else
- {
- group->clearState(LLSpatialGroup::IN_BUILD_Q2);
- }
- }
- // Clear the group
- mGroupQ2.clear();
-
- // Copy the saved HUD groups back in
- mGroupQ2.assign(hudGroups.begin(), hudGroups.end());
- mGroupQ2Locked = false;
}
void LLPipeline::clearRebuildDrawables()
@@ -2551,24 +2522,11 @@ void LLPipeline::clearRebuildDrawables()
LLDrawable* drawablep = *iter;
if (drawablep && !drawablep->isDead())
{
- drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
- drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
+ drawablep->clearState(LLDrawable::IN_REBUILD_Q);
}
}
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)
@@ -2622,52 +2580,6 @@ void LLPipeline::rebuildPriorityGroups()
}
-void LLPipeline::rebuildGroups()
-{
- if (mGroupQ2.empty() || gCubeSnapshot)
- {
- return;
- }
-
- LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE;
- mGroupQ2Locked = true;
- // Iterate through some drawables on the non-priority build queue
- S32 size = (S32) mGroupQ2.size();
- S32 min_count = llclamp((S32) ((F32) (size * size)/4096*0.25f), 1, size);
-
- S32 count = 0;
-
- std::sort(mGroupQ2.begin(), mGroupQ2.end(), LLSpatialGroup::CompareUpdateUrgency());
-
- LLSpatialGroup::sg_vector_t::iterator iter;
- LLSpatialGroup::sg_vector_t::iterator last_iter = mGroupQ2.begin();
-
- for (iter = mGroupQ2.begin();
- iter != mGroupQ2.end() && count <= min_count; ++iter)
- {
- LLSpatialGroup* group = *iter;
- last_iter = iter;
-
- if (!group->isDead())
- {
- group->rebuildGeom();
-
- if (group->getSpatialPartition()->mRenderByGroup)
- {
- count++;
- }
- }
-
- group->clearState(LLSpatialGroup::IN_BUILD_Q2);
- }
-
- mGroupQ2.erase(mGroupQ2.begin(), ++last_iter);
-
- mGroupQ2Locked = false;
-
- updateMovedList(mMovedBridge);
-}
-
void LLPipeline::updateGeom(F32 max_dtime)
{
LLTimer update_timer;
@@ -2693,16 +2605,6 @@ void LLPipeline::updateGeom(F32 max_dtime)
LLDrawable* drawablep = *curiter;
if (drawablep && !drawablep->isDead())
{
- if (drawablep->isState(LLDrawable::IN_REBUILD_Q2))
- {
- drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
- LLDrawable::drawable_list_t::iterator find = std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep);
- if (find != mBuildQ2.end())
- {
- mBuildQ2.erase(find);
- }
- }
-
if (drawablep->isUnload())
{
drawablep->unload();
@@ -2711,7 +2613,7 @@ void LLPipeline::updateGeom(F32 max_dtime)
if (updateDrawableGeom(drawablep, TRUE))
{
- drawablep->clearState(LLDrawable::IN_REBUILD_Q1);
+ drawablep->clearState(LLDrawable::IN_REBUILD_Q);
mBuildQ1.erase(curiter);
}
}
@@ -2720,54 +2622,6 @@ void LLPipeline::updateGeom(F32 max_dtime)
mBuildQ1.erase(curiter);
}
}
-
- // Iterate through some drawables on the non-priority build queue
- S32 min_count = 16;
- S32 size = (S32) mBuildQ2.size();
- if (size > 1024)
- {
- min_count = llclamp((S32) (size * (F32) size/4096), 16, size);
- }
-
- S32 count = 0;
-
- max_dtime = llmax(update_timer.getElapsedTimeF32()+0.001f, F32SecondsImplicit(max_dtime));
- LLSpatialGroup* last_group = NULL;
- LLSpatialBridge* last_bridge = NULL;
-
- for (LLDrawable::drawable_list_t::iterator iter = mBuildQ2.begin();
- iter != mBuildQ2.end(); )
- {
- LLDrawable::drawable_list_t::iterator curiter = iter++;
- LLDrawable* drawablep = *curiter;
-
- LLSpatialBridge* bridge = drawablep->isRoot() ? drawablep->getSpatialBridge() :
- drawablep->getParent()->getSpatialBridge();
-
- if (drawablep->getSpatialGroup() != last_group &&
- (!last_bridge || bridge != last_bridge) &&
- (update_timer.getElapsedTimeF32() >= max_dtime) && count > min_count)
- {
- break;
- }
-
- //make sure updates don't stop in the middle of a spatial group
- //to avoid thrashing (objects are enqueued by group)
- last_group = drawablep->getSpatialGroup();
- last_bridge = bridge;
-
- bool update_complete = true;
- if (!drawablep->isDead())
- {
- update_complete = updateDrawableGeom(drawablep, FALSE);
- count++;
- }
- if (update_complete)
- {
- drawablep->clearState(LLDrawable::IN_REBUILD_Q2);
- mBuildQ2.erase(curiter);
- }
- }
updateMovedList(mMovedBridge);
}
@@ -2992,10 +2846,10 @@ void LLPipeline::markRebuild(LLDrawable *drawablep, LLDrawable::EDrawableFlags f
{
if (drawablep && !drawablep->isDead() && assertInitialized())
{
- if (!drawablep->isState(LLDrawable::IN_REBUILD_Q1))
+ if (!drawablep->isState(LLDrawable::IN_REBUILD_Q))
{
mBuildQ1.push_back(drawablep);
- drawablep->setState(LLDrawable::IN_REBUILD_Q1); // mark drawable as being in priority queue
+ drawablep->setState(LLDrawable::IN_REBUILD_Q); // mark drawable as being in priority queue
}
if (flag & (LLDrawable::REBUILD_VOLUME | LLDrawable::REBUILD_POSITION))
@@ -4837,63 +4691,6 @@ void LLPipeline::renderDebug()
}
}
- if (mRenderDebugMask & LLPipeline::RENDER_DEBUG_BUILD_QUEUE)
- {
- U32 count = 0;
- U32 size = mGroupQ2.size();
- LLColor4 col;
-
- LLVertexBuffer::unbind();
- LLGLEnable blend(GL_BLEND);
- gGL.setSceneBlendType(LLRender::BT_ALPHA);
- LLGLDepthTest depth(GL_TRUE, GL_FALSE);
- gGL.getTexUnit(0)->bind(LLViewerFetchedTexture::sWhiteImagep);
-
- gGL.pushMatrix();
- gGL.loadMatrix(gGLModelView);
- gGLLastMatrix = NULL;
-
- for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter)
- {
- LLSpatialGroup* group = *iter;
- if (group->isDead())
- {
- continue;
- }
-
- LLSpatialBridge* bridge = group->getSpatialPartition()->asBridge();
-
- if (bridge && (!bridge->mDrawable || bridge->mDrawable->isDead()))
- {
- continue;
- }
-
- if (bridge)
- {
- gGL.pushMatrix();
- gGL.multMatrix((F32*)bridge->mDrawable->getRenderMatrix().mMatrix);
- }
-
- F32 alpha = llclamp((F32) (size-count)/size, 0.f, 1.f);
-
-
- LLVector2 c(1.f-alpha, alpha);
- c.normVec();
-
-
- ++count;
- col.set(c.mV[0], c.mV[1], 0, alpha*0.5f+0.5f);
- group->drawObjectBox(col);
-
- if (bridge)
- {
- gGL.popMatrix();
- }
- }
-
- gGL.popMatrix();
- }
-
gGL.flush();
gUIProgram.unbind();
}
@@ -5992,11 +5789,7 @@ void LLPipeline::findReferences(LLDrawable *drawablep)
{
LL_INFOS() << "In mBuildQ1" << LL_ENDL;
}
- if (std::find(mBuildQ2.begin(), mBuildQ2.end(), drawablep) != mBuildQ2.end())
- {
- LL_INFOS() << "In mBuildQ2" << LL_ENDL;
- }
-
+
S32 count;
count = gObjectList.findReferences(drawablep);