diff options
author | prep <prep@lindenlab.com> | 2012-05-09 15:56:06 -0400 |
---|---|---|
committer | prep <prep@lindenlab.com> | 2012-05-09 15:56:06 -0400 |
commit | 92ce47a1b21b3cc06d3d962394f44617a780ffbd (patch) | |
tree | da41492c597ba5432af17b278cdd698b894085c1 | |
parent | 88674e02ddaf8d300a0a65c216eaf304cbeb7c3a (diff) |
Added support to disable a draw pool. When the movable option checkbox is selected we will now also cull the terrain draw pool.
-rw-r--r-- | indra/newview/lldrawpool.cpp | 1 | ||||
-rw-r--r-- | indra/newview/lldrawpool.h | 4 | ||||
-rw-r--r-- | indra/newview/llfloaterpathfindingconsole.cpp | 4 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 22 | ||||
-rw-r--r-- | indra/newview/pipeline.h | 1 |
5 files changed, 30 insertions, 2 deletions
diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 35f8a85796..81f4e3d48f 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -116,6 +116,7 @@ LLDrawPool::LLDrawPool(const U32 type) sNumDrawPools++; mId = sNumDrawPools; mVertexShaderLevel = 0; + mSkipRender = false; } LLDrawPool::~LLDrawPool() diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index 64774d06df..977acf7aec 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -77,6 +77,9 @@ public: S32 getId() const { return mId; } U32 getType() const { return mType; } + BOOL getSkipRenderFlag() const { return mSkipRender;} + void setSkipRenderFlag( BOOL flag ) { mSkipRender = flag; } + virtual LLViewerTexture *getDebugTexture(); virtual void beginRenderPass( S32 pass ); virtual void endRenderPass( S32 pass ); @@ -113,6 +116,7 @@ protected: S32 mVertexShaderLevel; S32 mId; U32 mType; // Type of draw pool + BOOL mSkipRender; }; class LLRenderPass : public LLDrawPool diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 4c55e4debd..f6eb40abdc 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -1003,6 +1003,10 @@ void LLFloaterPathfindingConsole::cleanupRenderableRestoreItems() gPipeline.restorePermanentObjects( mRenderableRestoreList ); mRenderableRestoreList.clear(); } + else + { + gPipeline.skipRenderingOfTerrain( false ); + } } void LLFloaterPathfindingConsole::setAgentState(LLPathfindingManager::EAgentState pAgentState) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5bad5dd821..bbe46195cb 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3864,7 +3864,7 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) break; } - p->render(i); + if ( !p->getSkipRenderFlag() ) { p->render(i); } } poolp->endRenderPass(i); LLVertexBuffer::unbind(); @@ -4038,7 +4038,7 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) break; } - p->renderDeferred(i); + if ( !p->getSkipRenderFlag() ) { p->renderDeferred(i); } } poolp->endDeferredPass(i); LLVertexBuffer::unbind(); @@ -10139,6 +10139,8 @@ void LLPipeline::hidePermanentObjects( std::vector<U32>& restoreList ) } } } + + skipRenderingOfTerrain( true ); } void LLPipeline::restorePermanentObjects( const std::vector<U32>& restoreList ) @@ -10183,5 +10185,21 @@ void LLPipeline::restorePermanentObjects( const std::vector<U32>& restoreList ) } ++itCurrent; } + + skipRenderingOfTerrain( false ); } +void LLPipeline::skipRenderingOfTerrain( BOOL flag ) +{ + pool_set_t::iterator iter = mPools.begin(); + while ( iter != mPools.end() ) + { + LLDrawPool* pPool = *iter; + U32 poolType = pPool->getType(); + if ( hasRenderType( pPool->getType() ) && poolType == LLDrawPool::POOL_TERRAIN ) + { + pPool->setSkipRenderFlag( flag ); + } + ++iter; + } +} diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index a4ab1fa56b..8a845af418 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -368,6 +368,7 @@ public: void hidePermanentObjects( std::vector<U32>& restoreList ); void restorePermanentObjects( const std::vector<U32>& restoreList ); + void skipRenderingOfTerrain( BOOL flag ); private: void unloadShaders(); |