diff options
| author | Jonathan "Geenz" Goodman <geenz@lindenlab.com> | 2026-09-22 17:35:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-22 17:35:03 -0400 |
| commit | f3fba78d9185a2385cc6c5226b7a87fddff826dd (patch) | |
| tree | 4d04ad5876c69ec0b3203dec69c711161fa7f934 /indra/llrender/llvertexbuffer.cpp | |
| parent | cc5d3dd3cd653971fff16cf2bc1d380edd5ea7f2 (diff) | |
| parent | 125dfba5f94191fc99d1c511d190d6a9f2d9d2f1 (diff) | |
Merge pull request #6357 from secondlife/pepper/chat-merge-26.5
Merge `release/26.5` into `project/chat-modernization`
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
| -rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 9 |
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()) { |
