Skip to content
Snippets Groups Projects
Commit 6e234d97 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Faster VAO name list

parent 819e96d5
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,7 @@ U64 LLVBOPool::sBytesPooled = 0; ...@@ -94,7 +94,7 @@ U64 LLVBOPool::sBytesPooled = 0;
U64 LLVBOPool::sIndexBytesPooled = 0; U64 LLVBOPool::sIndexBytesPooled = 0;
std::vector<U32> LLVBOPool::sPendingDeletions; std::vector<U32> LLVBOPool::sPendingDeletions;
std::list<U32> LLVertexBuffer::sAvailableVAOName; std::vector<U32> LLVertexBuffer::sAvailableVAOName;
U32 LLVertexBuffer::sCurVAOName = 1; U32 LLVertexBuffer::sCurVAOName = 1;
U64 LLVertexBuffer::sAllocatedIndexBytes = 0; U64 LLVertexBuffer::sAllocatedIndexBytes = 0;
...@@ -509,8 +509,8 @@ U32 LLVertexBuffer::getVAOName() ...@@ -509,8 +509,8 @@ U32 LLVertexBuffer::getVAOName()
if (!sAvailableVAOName.empty()) if (!sAvailableVAOName.empty())
{ {
ret = sAvailableVAOName.front(); ret = sAvailableVAOName.back();
sAvailableVAOName.pop_front(); sAvailableVAOName.pop_back();
} }
else else
{ {
...@@ -1058,12 +1058,12 @@ void LLVertexBuffer::cleanupClass() ...@@ -1058,12 +1058,12 @@ void LLVertexBuffer::cleanupClass()
sDynamicVBOPool.cleanup(); sDynamicVBOPool.cleanup();
clean_validate_buffers(); clean_validate_buffers();
while (!sAvailableVAOName.empty()) if (!sAvailableVAOName.empty())
{ {
#if GL_ARB_vertex_array_object #if GL_ARB_vertex_array_object
glDeleteVertexArrays(1, &sAvailableVAOName.front()); glDeleteVertexArrays(sAvailableVAOName.size(), sAvailableVAOName.data());
#endif #endif
sAvailableVAOName.pop_front(); sAvailableVAOName.clear();
} }
sLastMask = 0; sLastMask = 0;
......
...@@ -121,8 +121,8 @@ class LLVertexBuffer final : public LLRefCount, public LLTrace::MemTrackable<LLV ...@@ -121,8 +121,8 @@ class LLVertexBuffer final : public LLRefCount, public LLTrace::MemTrackable<LLV
static LLVBOPool sDynamicVBOPool; static LLVBOPool sDynamicVBOPool;
static LLVBOPool sStreamIBOPool; static LLVBOPool sStreamIBOPool;
static LLVBOPool sDynamicIBOPool; static LLVBOPool sDynamicIBOPool;
static std::list<U32> sAvailableVAOName; static std::vector<U32> sAvailableVAOName;
static U32 sCurVAOName; static U32 sCurVAOName;
static bool sUseStreamDraw; static bool sUseStreamDraw;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment