Collection of theoretical improvements for ATI cards, as well as a couple memory leaks. Thanks to Shyotl for bringing them up and offering solutions.

Signed-off-by: Beeks <HgDelirium@gmail.com>
This commit is contained in:
Beeks
2010-09-16 16:00:47 -04:00
parent d529819e12
commit 59d7c33954
12 changed files with 77 additions and 16 deletions

View File

@@ -62,6 +62,7 @@ BOOL LLVertexBuffer::sVBOActive = FALSE;
BOOL LLVertexBuffer::sIBOActive = FALSE;
U32 LLVertexBuffer::sAllocatedBytes = 0;
BOOL LLVertexBuffer::sMapped = FALSE;
BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
std::vector<U32> LLVertexBuffer::sDeleteList;
@@ -348,6 +349,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
mUsage = 0 ;
}
if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
{
mUsage = 0;
}
S32 stride = calcStride(typemask, mOffsets);
mTypeMask = typemask;
@@ -771,7 +777,7 @@ BOOL LLVertexBuffer::useVBOs() const
return FALSE;
}
#endif
return sEnableVBOs;
return TRUE;
}
//----------------------------------------------------------------------------
@@ -1078,7 +1084,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
{
if (mGLBuffer)
{
if (sEnableVBOs && sVBOActive)
if (sVBOActive)
{
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
sBindCount++;
@@ -1090,7 +1096,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
setup = TRUE; // ... or a client memory pointer changed
}
}
if (sEnableVBOs && mGLIndices && sIBOActive)
if (mGLIndices && sIBOActive)
{
/*if (sMapped)
{