summaryrefslogtreecommitdiff
path: root/indra/llrender/llvertexbuffer.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@lindenlab.com>2026-08-25 12:56:22 -0400
committerGitHub <noreply@github.com>2026-08-25 12:56:22 -0400
commit2e9c387fee881022aec13d5c85f901539683c18f (patch)
treed2cc89444771d96871b3126c9462f072dc059e32 /indra/llrender/llvertexbuffer.cpp
parent92289533c1b95bc0fb2cdcc1217ae539485ea244 (diff)
parenta402fd4da91bbce03340e174505c06feede65866 (diff)
Merge branch 'develop' into project/lua_editor
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r--indra/llrender/llvertexbuffer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 9b839350ae..2d64292fe7 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -296,18 +296,21 @@ static void delete_buffers(S32 count, GLuint* buffers)
LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX;
// wait a few frames before actually deleting the buffers to avoid
// synchronization issues with the GPU
- static std::vector<GLuint> sFreeList[4];
+ constexpr U32 BUCKET_COUNT = 4;
+ static std::vector<GLuint> sFreeList[BUCKET_COUNT];
if (gGLManager.mInited)
{
- U32 idx = LLImageGL::sFrameCount % 4;
+ // Move current frame to free list
+ U32 idx = LLImageGL::sFrameCount % BUCKET_COUNT;
for (S32 i = 0; i < count; ++i)
{
sFreeList[idx].push_back(buffers[i]);
}
- idx = (LLImageGL::sFrameCount + 3) % 4;
+ // Clear frame -3 (equals +1), this idx will be written over on the next call
+ idx = (LLImageGL::sFrameCount + 1) % BUCKET_COUNT;
if (!sFreeList[idx].empty())
{