diff options
author | Oz Linden <oz@lindenlab.com> | 2016-09-06 16:53:32 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2016-09-06 16:53:32 -0400 |
commit | dc5a805efdd8497ba9043ea6402c217297d19c27 (patch) | |
tree | 5b9a1a290ab32e7bc5b4a1c99ee7f9010ac7b5e1 /indra | |
parent | 5edd4cecfc53b8287e1b3c6a22142bc72b8e0356 (diff) |
undo changes to llvertexbuffer.cpp from c727ae93646e
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index ee7971f788..0fae600a90 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -153,31 +153,27 @@ LLVBOPool::LLVBOPool(U32 vboUsage, U32 vboType) volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) { - if (vbo_block_size(size) != size) - { - LL_WARNS() << "Invalid vbo block size " << size << "; not allocating" << LL_ENDL; - return NULL; - } + llassert(vbo_block_size(size) == size); volatile U8* ret = NULL; - U32 block_index = vbo_block_index(size); + U32 i = vbo_block_index(size); - if (mFreeList.size() <= block_index) + if (mFreeList.size() <= i) { - mFreeList.resize(block_index+1); + mFreeList.resize(i+1); } - if (mFreeList[block_index].empty() || for_seed) + if (mFreeList[i].empty() || for_seed) { //make a new buffer name = genBuffer(); glBindBufferARB(mType, name); - if (!for_seed && block_index < LL_VBO_POOL_SEED_COUNT) + if (!for_seed && i < LL_VBO_POOL_SEED_COUNT) { //record this miss - mMissCount[block_index]++; + mMissCount[i]++; } if (mType == GL_ARRAY_BUFFER_ARB) @@ -206,11 +202,7 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) if (for_seed) { //put into pool for future use - if (mFreeList.size() <= block_index) - { - LL_WARNS() << "VBO free list is not big enough for size " << size << LL_ENDL; - return NULL; - } + llassert(mFreeList.size() > i); Record rec; rec.mGLName = name; @@ -224,13 +216,13 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) { sIndexBytesPooled += size; } - mFreeList[block_index].push_back(rec); + mFreeList[i].push_back(rec); } } else { - name = mFreeList[block_index].front().mGLName; - ret = mFreeList[block_index].front().mClientData; + name = mFreeList[i].front().mGLName; + ret = mFreeList[i].front().mClientData; if (mType == GL_ARRAY_BUFFER_ARB) { @@ -241,7 +233,7 @@ volatile U8* LLVBOPool::allocate(U32& name, U32 size, bool for_seed) sIndexBytesPooled -= size; } - mFreeList[block_index].pop_front(); + mFreeList[i].pop_front(); } return ret; @@ -273,7 +265,7 @@ void LLVBOPool::seedPool() mFreeList.resize(LL_VBO_POOL_SEED_COUNT); } - for (U32 i = 0; i < mFreeList.size(); i++) + for (U32 i = 0; i < LL_VBO_POOL_SEED_COUNT; i++) { if (mMissCount[i] > mFreeList[i].size()) { |