diff options
| author | Erik Kundiman <erik@megapahit.org> | 2026-09-01 18:35:23 +0800 |
|---|---|---|
| committer | Erik Kundiman <erik@megapahit.org> | 2026-09-04 21:58:53 +0800 |
| commit | 00bb3bb6f07660bd914d29a1389342bb3060d254 (patch) | |
| tree | 431f574922494d2201718f13085f17bc6bd7fb42 /indra/llrender/llvertexbuffer.cpp | |
| parent | a8636720129952c10cf49ab80da21bf8b340b96c (diff) | |
| parent | 4ef9f8f14b35ed388c294d53767a0dca0e890924 (diff) | |
Merge remote-tracking branch 'secondlife/release/26.4' into 26.4
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 62a102c166..c61902cf83 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -297,18 +297,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()) { |
