diff options
author | Callum Prentice <callum@gmail.com> | 2017-03-13 11:13:43 -0700 |
---|---|---|
committer | Callum Prentice <callum@gmail.com> | 2017-03-13 11:13:43 -0700 |
commit | 7c5e92cec57f492c465ec075cd8297fb86aed3c5 (patch) | |
tree | 32d2610579afb58bbf4bd5f4885c1c64a4ff9e98 /indra/llrender | |
parent | 17c8eadb3d89bc78019f0b50eb8b109f25616781 (diff) |
SL-644 Add guard to mCount in LLRender.cpp
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llrender.cpp | 49 |
1 files changed, 5 insertions, 44 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 77c5921c9c..76f28bb43f 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1829,48 +1829,6 @@ void LLRender::flush() { if (mCount > 0) { -#if 0 - if (!glIsEnabled(GL_VERTEX_ARRAY)) - { - LL_ERRS() << "foo 1" << LL_ENDL; - } - - if (!glIsEnabled(GL_COLOR_ARRAY)) - { - LL_ERRS() << "foo 2" << LL_ENDL; - } - - if (!glIsEnabled(GL_TEXTURE_COORD_ARRAY)) - { - LL_ERRS() << "foo 3" << LL_ENDL; - } - - if (glIsEnabled(GL_NORMAL_ARRAY)) - { - LL_ERRS() << "foo 7" << LL_ENDL; - } - - GLvoid* pointer; - - glGetPointerv(GL_VERTEX_ARRAY_POINTER, &pointer); - if (pointer != &(mBuffer[0].v)) - { - LL_ERRS() << "foo 4" << LL_ENDL; - } - - glGetPointerv(GL_COLOR_ARRAY_POINTER, &pointer); - if (pointer != &(mBuffer[0].c)) - { - LL_ERRS() << "foo 5" << LL_ENDL; - } - - glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &pointer); - if (pointer != &(mBuffer[0].uv)) - { - LL_ERRS() << "foo 6" << LL_ENDL; - } -#endif - if (!mUIOffset.empty()) { sUICalls++; @@ -2104,8 +2062,11 @@ void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, S32 v } } - mVerticesp[mCount] = mVerticesp[mCount-1]; - mTexcoordsp[mCount] = mTexcoordsp[mCount-1]; + if (mCount > 0) + { + mVerticesp[mCount] = mVerticesp[mCount - 1]; + mTexcoordsp[mCount] = mTexcoordsp[mCount - 1]; + } } void LLRender::vertexBatchPreTransformed(LLVector3* verts, LLVector2* uvs, LLColor4U* colors, S32 vert_count) |