From 92ce47a1b21b3cc06d3d962394f44617a780ffbd Mon Sep 17 00:00:00 2001 From: prep Date: Wed, 9 May 2012 15:56:06 -0400 Subject: Added support to disable a draw pool. When the movable option checkbox is selected we will now also cull the terrain draw pool. --- indra/newview/lldrawpool.cpp | 1 + indra/newview/lldrawpool.h | 4 ++++ indra/newview/llfloaterpathfindingconsole.cpp | 4 ++++ indra/newview/pipeline.cpp | 22 ++++++++++++++++++++-- indra/newview/pipeline.h | 1 + 5 files changed, 30 insertions(+), 2 deletions(-) (limited to 'indra') 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& restoreList ) } } } + + skipRenderingOfTerrain( true ); } void LLPipeline::restorePermanentObjects( const std::vector& restoreList ) @@ -10183,5 +10185,21 @@ void LLPipeline::restorePermanentObjects( const std::vector& 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& restoreList ); void restorePermanentObjects( const std::vector& restoreList ); + void skipRenderingOfTerrain( BOOL flag ); private: void unloadShaders(); -- cgit v1.2.3