aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/llvertexbuffer.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:48 -0500
committerJacek Antonelli2008-08-15 23:45:48 -0500
commit32b59b5609706d574e2e3b9ff6162d35f6d7781c (patch)
tree340ae6f090700b109f2ced1c41b8fb274a215bd3 /linden/indra/llrender/llvertexbuffer.cpp
parentSecond Life viewer sources 1.20.4 (diff)
downloadmeta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.zip
meta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.tar.gz
meta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.tar.bz2
meta-impy-32b59b5609706d574e2e3b9ff6162d35f6d7781c.tar.xz
Second Life viewer sources 1.20.5
Diffstat (limited to 'linden/indra/llrender/llvertexbuffer.cpp')
-rw-r--r--linden/indra/llrender/llvertexbuffer.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/linden/indra/llrender/llvertexbuffer.cpp b/linden/indra/llrender/llvertexbuffer.cpp
index d165c01..ce80343 100644
--- a/linden/indra/llrender/llvertexbuffer.cpp
+++ b/linden/indra/llrender/llvertexbuffer.cpp
@@ -491,6 +491,7 @@ void LLVertexBuffer::destroyGLBuffer()
491 } 491 }
492 492
493 mGLBuffer = 0; 493 mGLBuffer = 0;
494 unbind();
494} 495}
495 496
496void LLVertexBuffer::destroyGLIndices() 497void LLVertexBuffer::destroyGLIndices()
@@ -517,6 +518,7 @@ void LLVertexBuffer::destroyGLIndices()
517 } 518 }
518 519
519 mGLIndices = 0; 520 mGLIndices = 0;
521 unbind();
520} 522}
521 523
522void LLVertexBuffer::updateNumVerts(S32 nverts) 524void LLVertexBuffer::updateNumVerts(S32 nverts)
@@ -737,8 +739,11 @@ U8* LLVertexBuffer::mapBuffer(S32 access)
737 { 739 {
738 setBuffer(0); 740 setBuffer(0);
739 mLocked = TRUE; 741 mLocked = TRUE;
742 stop_glerror();
740 mMappedData = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); 743 mMappedData = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
744 stop_glerror();
741 mMappedIndexData = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); 745 mMappedIndexData = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB);
746 stop_glerror();
742 /*if (sMapped) 747 /*if (sMapped)
743 { 748 {
744 llerrs << "Mapped two VBOs at the same time!" << llendl; 749 llerrs << "Mapped two VBOs at the same time!" << llendl;
@@ -767,8 +772,11 @@ void LLVertexBuffer::unmapBuffer()
767 { 772 {
768 if (useVBOs() && mLocked) 773 if (useVBOs() && mLocked)
769 { 774 {
775 stop_glerror();
770 glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); 776 glUnmapBufferARB(GL_ARRAY_BUFFER_ARB);
777 stop_glerror();
771 glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); 778 glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB);
779 stop_glerror();
772 780
773 /*if (!sMapped) 781 /*if (!sMapped)
774 { 782 {
@@ -907,7 +915,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
907 { 915 {
908 llerrs << "VBO bound while another VBO mapped!" << llendl; 916 llerrs << "VBO bound while another VBO mapped!" << llendl;
909 }*/ 917 }*/
918 stop_glerror();
910 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer); 919 glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
920 stop_glerror();
911 sBindCount++; 921 sBindCount++;
912 sVBOActive = TRUE; 922 sVBOActive = TRUE;
913 setup = TRUE; // ... or the bound buffer changed 923 setup = TRUE; // ... or the bound buffer changed
@@ -918,7 +928,9 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
918 { 928 {
919 llerrs << "VBO bound while another VBO mapped!" << llendl; 929 llerrs << "VBO bound while another VBO mapped!" << llendl;
920 }*/ 930 }*/
931 stop_glerror();
921 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices); 932 glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, mGLIndices);
933 stop_glerror();
922 sBindCount++; 934 sBindCount++;
923 sIBOActive = TRUE; 935 sIBOActive = TRUE;
924 } 936 }
@@ -927,11 +939,15 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
927 { 939 {
928 if (mGLBuffer) 940 if (mGLBuffer)
929 { 941 {
942 stop_glerror();
930 glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), NULL, mUsage); 943 glBufferDataARB(GL_ARRAY_BUFFER_ARB, getSize(), NULL, mUsage);
944 stop_glerror();
931 } 945 }
932 if (mGLIndices) 946 if (mGLIndices)
933 { 947 {
948 stop_glerror();
934 glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), NULL, mUsage); 949 glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, getIndicesSize(), NULL, mUsage);
950 stop_glerror();
935 } 951 }
936 952
937 mEmpty = TRUE; 953 mEmpty = TRUE;