diff options
author | Dave Parks <davep@lindenlab.com> | 2023-01-23 11:48:43 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-01-23 11:48:43 -0600 |
commit | 274da636a00fd0469f7857dad7995cb11552e4ab (patch) | |
tree | d595a76d4925ee59760f9ebb532edaf8224d211c /indra/llrender | |
parent | 3fac6115c0de172e48fbfd13753bc83b755ecf21 (diff) |
SL-18869 Followup -- AMD optimization pass.
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 028db79566..40ab4a2e0f 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -262,27 +262,29 @@ static GLuint gen_buffer() LL_PROFILE_ZONE_SCOPED_CATEGORY_VERTEX; GLuint ret = 0; - if (!gGLManager.mIsAMD) - { - constexpr U32 pool_size = 4096; + constexpr U32 pool_size = 4096; - thread_local static GLuint sNamePool[pool_size]; - thread_local static U32 sIndex = 0; + thread_local static GLuint sNamePool[pool_size]; + thread_local static U32 sIndex = 0; - if (sIndex == 0) + if (sIndex == 0) + { + LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("gen buffer"); + sIndex = pool_size; + if (!gGLManager.mIsAMD) { - LL_PROFILE_ZONE_NAMED_CATEGORY_VERTEX("gen buffer"); - sIndex = pool_size; glGenBuffers(pool_size, sNamePool); } - - ret = sNamePool[--sIndex]; - } - else - { - glGenBuffers(1, &ret); + else + { // work around for AMD driver bug + for (U32 i = 0; i < pool_size; ++i) + { + glGenBuffers(1, sNamePool + i); + } + } } + ret = sNamePool[--sIndex]; return ret; } |