From 22eecf1018d8adbf214b9f1072b3cd6d3ab3d5ae Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Fri, 23 Jun 2023 11:46:09 -0500 Subject: SL-19897 Fix for 100% transparent objects not showing up in highlight transparent until LoD switch. --- indra/newview/llspatialpartition.cpp | 37 ++---------------------------------- indra/newview/llspatialpartition.h | 5 +++-- indra/newview/llviewermenu.cpp | 7 +++---- indra/newview/pipeline.cpp | 34 ++++++++++++++++++++++++++++++--- indra/newview/pipeline.h | 5 ++++- 5 files changed, 43 insertions(+), 45 deletions(-) (limited to 'indra') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 978cb78083..f52f1a925d 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -777,7 +777,8 @@ void LLSpatialGroup::handleChildAddition(const OctreeNode* parent, OctreeNode* c assert_states_valid(this); } -void LLSpatialGroup::destroyGL(bool keep_occlusion) + +void LLSpatialGroup::destroyGLState(bool keep_occlusion) { setState(LLSpatialGroup::GEOM_DIRTY | LLSpatialGroup::IMAGE_DIRTY); @@ -1290,45 +1291,11 @@ void drawBoxOutline(const LLVector4a& pos, const LLVector4a& size) drawBoxOutline(reinterpret_cast(pos), reinterpret_cast(size)); } -class LLOctreeDirty : public OctreeTraveler -{ -public: - virtual void visit(const OctreeNode* state) - { - LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); - group->destroyGL(); - - for (LLSpatialGroup::element_iter i = group->getDataBegin(); i != group->getDataEnd(); ++i) - { - LLDrawable* drawable = (LLDrawable*)(*i)->getDrawable(); - if(!drawable) - { - continue; - } - if (drawable->getVObj().notNull() && !group->getSpatialPartition()->mRenderByGroup) - { - gPipeline.markRebuild(drawable, LLDrawable::REBUILD_ALL); - } - } - - for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i) - { - LLSpatialBridge* bridge = *i; - traverse(bridge->mOctree); - } - } -}; void LLSpatialPartition::restoreGL() { } -void LLSpatialPartition::resetVertexBuffers() -{ - LLOctreeDirty dirty; - dirty.traverse(mOctree); -} - BOOL LLSpatialPartition::getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax) { LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL; diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 053ce9e60b..88584f535a 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -295,7 +295,9 @@ public: BOOL removeObject(LLDrawable *drawablep, BOOL from_octree = FALSE); BOOL updateInGroup(LLDrawable *drawablep, BOOL immediate = FALSE); // Update position if it's in the group void shift(const LLVector4a &offset); - void destroyGL(bool keep_occlusion = false); + + // TODO: this no longer appears to be called, figure out if it's important and if not remove it + void destroyGLState(bool keep_occlusion = false); void updateDistance(LLCamera& camera); F32 getUpdateUrgency() const; @@ -419,7 +421,6 @@ public: void renderDebug(); void renderIntersectingBBoxes(LLCamera* camera); void restoreGL(); - void resetVertexBuffers(); BOOL getVisibleExtents(LLCamera& camera, LLVector3& visMin, LLVector3& visMax); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index b9042b3496..6e5c268c00 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7826,10 +7826,6 @@ class LLToggleShaderControl : public view_listener_t BOOL checked = gSavedSettings.getBOOL( control_name ); gSavedSettings.setBOOL( control_name, !checked ); LLPipeline::refreshCachedSettings(); - //gPipeline.updateRenderDeferred(); - //gPipeline.releaseGLBuffers(); - //gPipeline.createGLBuffers(); - //gPipeline.resetVertexBuffers(); LLViewerShaderMgr::instance()->setShaders(); return !checked; } @@ -8560,6 +8556,9 @@ class LLViewHighlightTransparent : public view_listener_t bool handleEvent(const LLSD& userdata) { LLDrawPoolAlpha::sShowDebugAlpha = !LLDrawPoolAlpha::sShowDebugAlpha; + + // invisible objects skip building their render batches unless sShowDebugAlpha is true, so rebuild batches whenever toggling this flag + gPipeline.rebuildDrawInfo(); return true; } }; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 38f27d4dfa..e64ef6d555 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -10593,8 +10593,36 @@ void LLPipeline::handleShadowDetailChanged() } } -void LLPipeline::overrideEnvironmentMap() +class LLOctreeDirty : public OctreeTraveler { - //mReflectionMapManager.mProbes.clear(); - //mReflectionMapManager.addProbe(LLViewerCamera::instance().getOrigin()); +public: + virtual void visit(const OctreeNode* state) + { + LLSpatialGroup* group = (LLSpatialGroup*)state->getListener(0); + + group->setState(LLSpatialGroup::GEOM_DIRTY); + gPipeline.markRebuild(group); + + for (LLSpatialGroup::bridge_list_t::iterator i = group->mBridgeList.begin(); i != group->mBridgeList.end(); ++i) + { + LLSpatialBridge* bridge = *i; + traverse(bridge->mOctree); + } + } +}; + + +void LLPipeline::rebuildDrawInfo() +{ + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); + iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + { + LLViewerRegion* region = *iter; + + LLOctreeDirty dirty; + + LLSpatialPartition* part = region->getSpatialPartition(LLViewerRegion::PARTITION_VOLUME); + dirty.traverse(part->mOctree); + } } + diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 19c8b06a46..961a55330a 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -131,6 +131,10 @@ public: bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples); bool allocateShadowBuffer(U32 resX, U32 resY); + // rebuild all LLVOVolume render batches + void rebuildDrawInfo(); + + // Clear LLFace mVertexBuffer pointers void resetVertexBuffers(LLDrawable* drawable); // perform a profile of the given avatar @@ -449,7 +453,6 @@ public: void handleShadowDetailChanged(); LLReflectionMapManager mReflectionMapManager; - void overrideEnvironmentMap(); private: void unloadShaders(); -- cgit v1.2.3