SL-17473 Viewer not clearing all Vertex Buffers #2

meow-7.2.2
Andrey Kleshchev 2022-07-16 02:21:13 +03:00
parent e9ac774ceb
commit e9288e8112
5 changed files with 44 additions and 19 deletions

View File

@ -39,7 +39,6 @@
class LLViewerCamera;
class LLVOWLSky;
class LLVOWLClouds;
class LLSky

View File

@ -49,7 +49,6 @@ public:
/*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline);
/*virtual*/ BOOL updateGeometry(LLDrawable *drawable);
void cleanupGL();
};
#endif // LL_LLVOGROUND_H

View File

@ -93,7 +93,7 @@ LLWorld::LLWorld() :
mLastPacketsLost(0),
mSpaceTimeUSec(0)
{
for (S32 i = 0; i < 8; i++)
for (S32 i = 0; i < EDGE_WATER_OBJECTS_COUNT; i++)
{
mEdgeWaterObjects[i] = NULL;
}
@ -126,7 +126,7 @@ void LLWorld::resetClass()
LLViewerPartSim::getInstance()->destroyClass();
mDefaultWaterTexturep = NULL ;
for (S32 i = 0; i < 8; i++)
for (S32 i = 0; i < EDGE_WATER_OBJECTS_COUNT; i++)
{
mEdgeWaterObjects[i] = NULL;
}
@ -753,6 +753,8 @@ void LLWorld::clearAllVisibleObjects()
//clear all cached visible objects.
(*iter)->clearCachedVisibleObjects();
}
clearHoleWaterObjects();
clearEdgeWaterObjects();
}
void LLWorld::updateParticles()
@ -923,7 +925,7 @@ void LLWorld::precullWaterObjects(LLCamera& camera, LLCullResult* cull, bool inc
}
S32 dir;
for (dir = 0; dir < 8; dir++)
for (dir = 0; dir < EDGE_WATER_OBJECTS_COUNT; dir++)
{
LLVOWater* waterp = mEdgeWaterObjects[dir];
if (waterp && waterp->mDrawable)
@ -934,6 +936,26 @@ void LLWorld::precullWaterObjects(LLCamera& camera, LLCullResult* cull, bool inc
}
}
void LLWorld::clearHoleWaterObjects()
{
for (std::list<LLPointer<LLVOWater> >::iterator iter = mHoleWaterObjects.begin();
iter != mHoleWaterObjects.end(); ++iter)
{
LLVOWater* waterp = (*iter).get();
gObjectList.killObject(waterp);
}
mHoleWaterObjects.clear();
}
void LLWorld::clearEdgeWaterObjects()
{
for (S32 i = 0; i < EDGE_WATER_OBJECTS_COUNT; i++)
{
gObjectList.killObject(mEdgeWaterObjects[i]);
mEdgeWaterObjects[i] = NULL;
}
}
void LLWorld::updateWaterObjects()
{
if (!gAgent.getRegion())
@ -977,13 +999,7 @@ void LLWorld::updateWaterObjects()
}
}
for (std::list<LLPointer<LLVOWater> >::iterator iter = mHoleWaterObjects.begin();
iter != mHoleWaterObjects.end(); ++ iter)
{
LLVOWater* waterp = (*iter).get();
gObjectList.killObject(waterp);
}
mHoleWaterObjects.clear();
clearHoleWaterObjects();
// Use the water height of the region we're on for areas where there is no region
F32 water_height = gAgent.getRegion()->getWaterHeight();
@ -1024,7 +1040,7 @@ void LLWorld::updateWaterObjects()
(S32)(512 - (region_y - min_y)) };
S32 dir;
for (dir = 0; dir < 8; dir++)
for (dir = 0; dir < EDGE_WATER_OBJECTS_COUNT; dir++)
{
S32 dim[2] = { 0 };
switch (gDirAxes[dir][0])

View File

@ -122,12 +122,9 @@ public:
void updateRegions(F32 max_update_time);
void updateVisibilities();
void updateParticles();
void updateClouds(const F32 dt);
LLCloudGroup * findCloudGroup(const LLCloudPuff &puff);
void renderPropertyLines();
void resetStats();
void updateNetStats(); // Update network statistics for all the regions...
void printPacketsLost();
@ -140,7 +137,7 @@ public:
void setLandFarClip(const F32 far_clip);
LLViewerTexture *getDefaultWaterTexture();
void updateWaterObjects();
void updateWaterObjects();
void precullWaterObjects(LLCamera& camera, LLCullResult* cull, bool include_void_water);
@ -175,6 +172,9 @@ public:
bool isRegionListed(const LLViewerRegion* region) const;
private:
void clearHoleWaterObjects();
void clearEdgeWaterObjects();
region_list_t mActiveRegionList;
region_list_t mRegionList;
region_list_t mVisibleRegionList;
@ -206,7 +206,8 @@ private:
//
std::list<LLPointer<LLVOWater> > mHoleWaterObjects;
LLPointer<LLVOWater> mEdgeWaterObjects[8];
static const S32 EDGE_WATER_OBJECTS_COUNT = 8;
LLPointer<LLVOWater> mEdgeWaterObjects[EDGE_WATER_OBJECTS_COUNT];
LLPointer<LLViewerTexture> mDefaultWaterTexturep;
};

View File

@ -685,7 +685,9 @@ void LLPipeline::cleanup()
mFaceSelectImagep = NULL;
mMovedBridge.clear();
mMovedList.clear();
mMovedBridge.clear();
mShiftList.clear();
mInitialized = false;
@ -2822,6 +2824,14 @@ void LLPipeline::clearRebuildDrawables()
drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD);
}
mMovedList.clear();
for (LLDrawable::drawable_vector_t::iterator iter = mShiftList.begin();
iter != mShiftList.end(); ++iter)
{
LLDrawable *drawablep = *iter;
drawablep->clearState(LLDrawable::EARLY_MOVE | LLDrawable::MOVE_UNDAMPED | LLDrawable::ON_MOVE_LIST | LLDrawable::ANIMATED_CHILD | LLDrawable::ON_SHIFT_LIST);
}
mShiftList.clear();
}
void LLPipeline::rebuildPriorityGroups()