summaryrefslogtreecommitdiff
path: root/indra/newview/llsurface.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-07-16 19:22:02 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-07-16 19:22:02 +0300
commit72581ab99d2e891821f5266330ecd8a58a277eb7 (patch)
tree528629c8943a400bc1a6186b49cdabdb4b8ed507 /indra/newview/llsurface.cpp
parentf5e788b1b4ff5fb45f20ee5fa5daad7cca42069f (diff)
parent1577ca1724787fdc0f0317ade3dab8ea3c5df7e7 (diff)
Merge branch 'release/26.3' into marchcat/slua-26.3
# Conflicts: # .github/workflows/build.yaml # autobuild.xml # indra/llcommon/llsys.cpp # indra/llrender/llimagegl.cpp # indra/llrender/llimagegl.h # indra/newview/CMakeLists.txt # indra/newview/featuretable.txt # indra/newview/featuretable_linux.txt # indra/newview/featuretable_mac.txt # indra/newview/llvoavatar.cpp # indra/newview/llvoiceclient.cpp # indra/newview/llvoicevivox.cpp # indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llsurface.cpp')
-rw-r--r--indra/newview/llsurface.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp
index 64359b6cbe..fe77d585c8 100644
--- a/indra/newview/llsurface.cpp
+++ b/indra/newview/llsurface.cpp
@@ -57,6 +57,8 @@ namespace
LLColor4U MAX_WATER_COLOR(0, 48, 96, 240);
S32 LLSurface::sTextureSize = 256;
+F32 LLSurface::sNearestVisiblePatchDistance = FLT_MAX;
+U32 LLSurface::sNearestVisiblePatchFrame = 0;
// ---------------- LLSurface:: Public Members ---------------
@@ -122,7 +124,7 @@ LLSurface::~LLSurface()
else if (poolp->mReferences.empty())
{
gPipeline.removePool(poolp);
- // Don't enable this until we blitz the draw pool for it as well. -- djs
+ // Don't enable this until we blitz the draw pool for it as well. - djs
mSTexturep = nullptr;
}
else
@@ -583,6 +585,13 @@ void LLSurface::updatePatchVisibilities(LLAgent &agent)
LLSurfacePatch *patchp;
+ // Reset the cross-region accumulator at the start of each frame.
+ if (sNearestVisiblePatchFrame != gFrameCount)
+ {
+ sNearestVisiblePatchDistance = FLT_MAX;
+ sNearestVisiblePatchFrame = gFrameCount;
+ }
+
mVisiblePatchCount = 0;
for (S32 i=0; i<mNumberOfPatches; i++)
{
@@ -593,6 +602,7 @@ void LLSurface::updatePatchVisibilities(LLAgent &agent)
{
mVisiblePatchCount++;
patchp->updateCameraDistanceRegion(pos_region);
+ sNearestVisiblePatchDistance = llmin(sNearestVisiblePatchDistance, patchp->getDistance());
}
}
}
@@ -961,7 +971,7 @@ std::ostream& operator<<(std::ostream &s, const LLSurface &S)
void LLSurface::createPatchData()
{
// Assumes mGridsPerEdge, mGridsPerPatchEdge, and mPatchesPerEdge have been properly set
- // TODO -- check for create() called when surface is not empty
+ // TODO - check for create() called when surface is not empty
S32 i, j;
LLSurfacePatch *patchp;