From 068da0b5655fc3c735cd8019ab3b6bb0defec4c0 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Tue, 6 May 2008 18:09:03 +0000 Subject: merge release-QAR-511 Viewer 1.20 RC 5 merge Branch_1-20-Viewer -r 85828 : 86279 -> release --- indra/llrender/llvertexbuffer.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'indra/llrender/llvertexbuffer.cpp') 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; -- cgit v1.2.3