summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-12-01 14:49:22 -0600
committerRunitaiLinden <davep@lindenlab.com>2023-12-01 14:49:22 -0600
commitc573d27e5baf23adbc14153c4d65a581f55febb4 (patch)
tree41fcbccdffd13c77073768241baa55200a695614
parenta09b083b1b18d293d97dd84dd4849924b2766a4f (diff)
SL-20611 Followup -- fix for water rendering twice. Add comments around LLEventPoll hack.
-rw-r--r--indra/newview/lleventpoll.cpp2
-rw-r--r--indra/newview/llspatialpartition.cpp11
-rw-r--r--indra/newview/llworld.cpp52
-rw-r--r--indra/newview/llworld.h2
-rw-r--r--indra/newview/pipeline.cpp7
5 files changed, 13 insertions, 61 deletions
diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp
index 670a780fdd..6ffc8f7bdd 100644
--- a/indra/newview/lleventpoll.cpp
+++ b/indra/newview/lleventpoll.cpp
@@ -152,6 +152,8 @@ namespace Details
LL::WorkQueue::ptr_t main_queue = nullptr;
+ // HACK -- grab the mainloop workqueue to move execution of the handler
+ // to a place that's safe in the main thread
#if 1
main_queue = LL::WorkQueue::getInstance("mainloop");
#endif
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index a63d46f502..9f30d60fed 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -64,6 +64,9 @@ bool LLSpatialGroup::sNoDelete = false;
static F32 sLastMaxTexPriority = 1.f;
static F32 sCurMaxTexPriority = 1.f;
+// enable expensive sanity checks around redundant drawable and group insertion to LLCullResult
+#define LL_DEBUG_CULL_RESULT 0
+
//static counter for frame to switch LOD on
void sg_assert(BOOL expr)
@@ -4015,6 +4018,10 @@ void LLCullResult::pushOcclusionGroup(LLSpatialGroup* group)
void LLCullResult::pushDrawableGroup(LLSpatialGroup* group)
{
+#if LL_DEBUG_CULL_RESULT
+ // group must NOT be in the drawble groups list already
+ llassert(std::find(&mDrawableGroups[0], mDrawableGroupsEnd, group) == mDrawableGroupsEnd);
+#endif
if (mDrawableGroupsSize < mDrawableGroupsAllocated)
{
mDrawableGroups[mDrawableGroupsSize] = group;
@@ -4029,6 +4036,10 @@ void LLCullResult::pushDrawableGroup(LLSpatialGroup* group)
void LLCullResult::pushDrawable(LLDrawable* drawable)
{
+#if LL_DEBUG_CULL_RESULT
+ // drawable must NOT be in the visible list already
+ llassert(std::find(&mVisibleList[0], mVisibleListEnd, drawable) == mVisibleListEnd);
+#endif
if (mVisibleListSize < mVisibleListAllocated)
{
mVisibleList[mVisibleListSize] = drawable;
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index 709a457862..9381211e9b 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -883,58 +883,6 @@ void LLWorld::waterHeightRegionInfo(std::string const& sim_name, F32 water_heigh
}
}
-void LLWorld::precullWaterObjects(LLCamera& camera, LLCullResult* cull, bool include_void_water)
-{
- LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE;
- if (!gAgent.getRegion())
- {
- return;
- }
-
- if (mRegionList.empty())
- {
- LL_WARNS() << "No regions!" << LL_ENDL;
- return;
- }
-
- for (region_list_t::iterator iter = mRegionList.begin();
- iter != mRegionList.end(); ++iter)
- {
- LLViewerRegion* regionp = *iter;
- LLVOWater* waterp = regionp->getLand().getWaterObj();
- if (waterp && waterp->mDrawable)
- {
- waterp->mDrawable->setVisible(camera);
- cull->pushDrawable(waterp->mDrawable);
- }
- }
-
- if (include_void_water)
- {
- for (std::list<LLPointer<LLVOWater> >::iterator iter = mHoleWaterObjects.begin();
- iter != mHoleWaterObjects.end(); ++ iter)
- {
- LLVOWater* waterp = (*iter).get();
- if (waterp && waterp->mDrawable)
- {
- waterp->mDrawable->setVisible(camera);
- cull->pushDrawable(waterp->mDrawable);
- }
- }
- }
-
- S32 dir;
- for (dir = 0; dir < EDGE_WATER_OBJECTS_COUNT; dir++)
- {
- LLVOWater* waterp = mEdgeWaterObjects[dir];
- if (waterp && waterp->mDrawable)
- {
- waterp->mDrawable->setVisible(camera);
- cull->pushDrawable(waterp->mDrawable);
- }
- }
-}
-
void LLWorld::clearHoleWaterObjects()
{
for (std::list<LLPointer<LLVOWater> >::iterator iter = mHoleWaterObjects.begin();
diff --git a/indra/newview/llworld.h b/indra/newview/llworld.h
index f78cbcaa48..2878d10f5e 100644
--- a/indra/newview/llworld.h
+++ b/indra/newview/llworld.h
@@ -140,8 +140,6 @@ public:
LLViewerTexture *getDefaultWaterTexture();
void updateWaterObjects();
- void precullWaterObjects(LLCamera& camera, LLCullResult* cull, bool include_void_water);
-
void waterHeightRegionInfo(std::string const& sim_name, F32 water_height);
void shiftRegions(const LLVector3& offset);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 76414b5e4e..50cd4adb73 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2311,13 +2311,6 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result)
gSky.mVOWLSkyp->mDrawable->setVisible(camera);
sCull->pushDrawable(gSky.mVOWLSkyp->mDrawable);
}
-
- bool render_water = !sReflectionRender && (hasRenderType(LLPipeline::RENDER_TYPE_WATER) || hasRenderType(LLPipeline::RENDER_TYPE_VOIDWATER));
-
- if (render_water)
- {
- LLWorld::getInstance()->precullWaterObjects(camera, sCull, render_water);
- }
}
void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera)