diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-05-06 18:09:03 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-05-06 18:09:03 +0000 |
commit | 068da0b5655fc3c735cd8019ab3b6bb0defec4c0 (patch) | |
tree | 143580a4ff29c4c4df91c41e1429add4abaa3f87 /indra/llrender/llvertexbuffer.cpp | |
parent | eb14fece837683ebc58540d7f10eb74f5a5fbd4e (diff) |
merge release-QAR-511 Viewer 1.20 RC 5
merge Branch_1-20-Viewer -r 85828 : 86279 -> release
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b646a02cae..99fd2b33d4 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -491,6 +491,7 @@ void LLVertexBuffer::destroyGLBuffer() } mGLBuffer = 0; + unbind(); } void LLVertexBuffer::destroyGLIndices() @@ -517,6 +518,7 @@ void LLVertexBuffer::destroyGLIndices() } mGLIndices = 0; + unbind(); } void LLVertexBuffer::updateNumVerts(S32 nverts) @@ -737,8 +739,11 @@ U8* LLVertexBuffer::mapBuffer(S32 access) { setBuffer(0); mLocked = TRUE; + stop_glerror(); mMappedData = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + stop_glerror(); mMappedIndexData = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + stop_glerror(); /*if (sMapped) { llerrs << "Mapped two VBOs at the same time!" << llendl; @@ -767,8 +772,11 @@ void LLVertexBuffer::unmapBuffer() { if (useVBOs() && mLocked) { + stop_glerror(); glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); + stop_glerror(); glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); + stop_glerror(); /*if (!sMapped) { @@ -907,7 +915,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { llerrs << "VBO bound while another VBO mapped!" << llendl; }*/ + stop_glerror(); glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer); + stop_glerror(); sBindCount++; sVBOActive = TRUE; setup = TRUE; // ... or the bound buffer changed @@ -918,7 +928,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { llerrs << "VBO bound while another VBO mapped!" << llendl; }*/ + stop_glerror(); glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices); + stop_glerror(); sBindCount++; sIBOActive = TRUE; } @@ -927,11 +939,15 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { if (mGLBuffer) { + stop_glerror(); glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), NULL, mUsage); + stop_glerror(); } if (mGLIndices) { + stop_glerror(); glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), NULL, mUsage); + stop_glerror(); } mEmpty = TRUE; |