aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/llvertexbuffer.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:50 -0500
committerJacek Antonelli2008-08-15 23:45:50 -0500
commit2a4dea528f670b9bb1f77ef27a8a1dd16603d114 (patch)
tree95c68e362703c9099d571ecbdc6142b1cda1e005 /linden/indra/llrender/llvertexbuffer.cpp
parentSecond Life viewer sources 1.20.6 (diff)
downloadmeta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.zip
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.gz
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.bz2
meta-impy-2a4dea528f670b9bb1f77ef27a8a1dd16603d114.tar.xz
Second Life viewer sources 1.20.7
Diffstat (limited to '')
-rw-r--r--linden/indra/llrender/llvertexbuffer.cpp51
1 files changed, 49 insertions, 2 deletions
diff --git a/linden/indra/llrender/llvertexbuffer.cpp b/linden/indra/llrender/llvertexbuffer.cpp
index 4c663e2..073fcbf 100644
--- a/linden/indra/llrender/llvertexbuffer.cpp
+++ b/linden/indra/llrender/llvertexbuffer.cpp
@@ -38,7 +38,7 @@
38#include "llglheaders.h" 38#include "llglheaders.h"
39#include "llmemory.h" 39#include "llmemory.h"
40#include "llmemtype.h" 40#include "llmemtype.h"
41#include "llglimmediate.h" 41#include "llrender.h"
42 42
43//============================================================================ 43//============================================================================
44 44
@@ -232,7 +232,7 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
232 llerrs << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << llendl; 232 llerrs << "Bad vertex buffer draw range: [" << first << ", " << first+count << "]" << llendl;
233 } 233 }
234 234
235 if (mGLBuffer != sGLRenderBuffer) 235 if (mGLBuffer != sGLRenderBuffer || useVBOs() != sVBOActive)
236 { 236 {
237 llerrs << "Wrong vertex buffer bound." << llendl; 237 llerrs << "Wrong vertex buffer bound." << llendl;
238 } 238 }
@@ -768,11 +768,26 @@ U8* LLVertexBuffer::mapBuffer(S32 access)
768 sMapped = TRUE;*/ 768 sMapped = TRUE;*/
769 if (!mMappedData) 769 if (!mMappedData)
770 { 770 {
771 GLint buff;
772 glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
773 if (buff != mGLBuffer)
774 {
775 llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
776 }
777
778
771 llerrs << "glMapBuffer returned NULL (no vertex data)" << llendl; 779 llerrs << "glMapBuffer returned NULL (no vertex data)" << llendl;
772 } 780 }
773 781
774 if (!mMappedIndexData) 782 if (!mMappedIndexData)
775 { 783 {
784 GLint buff;
785 glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
786 if (buff != mGLIndices)
787 {
788 llerrs << "Invalid GL index buffer bound: " << buff << llendl;
789 }
790
776 llerrs << "glMapBuffer returned NULL (no index data)" << llendl; 791 llerrs << "glMapBuffer returned NULL (no index data)" << llendl;
777 } 792 }
778 793
@@ -952,8 +967,40 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
952 sIBOActive = TRUE; 967 sIBOActive = TRUE;
953 } 968 }
954 969
970 if (gDebugGL)
971 {
972 GLint buff;
973 glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
974 if (buff != mGLBuffer)
975 {
976 llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
977 }
978
979 glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
980 if (buff != mGLIndices)
981 {
982 llerrs << "Invalid GL index buffer bound: " << buff << llendl;
983 }
984 }
985
955 if (mResized) 986 if (mResized)
956 { 987 {
988 if (gDebugGL)
989 {
990 GLint buff;
991 glGetIntegerv(GL_ARRAY_BUFFER_BINDING_ARB, &buff);
992 if (buff != mGLBuffer)
993 {
994 llerrs << "Invalid GL vertex buffer bound: " << buff << llendl;
995 }
996
997 glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
998 if (buff != mGLIndices)
999 {
1000 llerrs << "Invalid GL index buffer bound: " << buff << llendl;
1001 }
1002 }
1003
957 if (mGLBuffer) 1004 if (mGLBuffer)
958 { 1005 {
959 stop_glerror(); 1006 stop_glerror();