SL-20611 Followup -- fix for water rendering twice. Add comments around LLEventPoll hack.
parent
a09b083b1b
commit
c573d27e5b
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue