diff options
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rwxr-xr-x | indra/llrender/llrender.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index c104a93773..2bd62726d0 100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1854,25 +1854,32 @@ void LLRender::flush() sUIVerts += mCount; } - if (gDebugGL) + //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) + U32 count = mCount; + + if (mMode == LLRender::QUADS && !sGLCoreProfile) { - if (mMode == LLRender::QUADS && !sGLCoreProfile) + if (mCount%4 != 0) { - if (mCount%4 != 0) - { - LL_ERRS() << "Incomplete quad rendered." << LL_ENDL; - } + count -= (mCount % 4); + LL_WARNS() << "Incomplete quad requested." << LL_ENDL; } - - if (mMode == LLRender::TRIANGLES) + } + + if (mMode == LLRender::TRIANGLES) + { + if (mCount%3 != 0) { if (mCount%3 != 0) { LL_ERRS() << "Incomplete triangle rendered." << LL_ENDL; } } - - if (mMode == LLRender::LINES) + } + + if (mMode == LLRender::LINES) + { + if (mCount%2 != 0) { if (mCount%2 != 0) { @@ -1880,9 +1887,7 @@ void LLRender::flush() } } } - - //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) - U32 count = mCount; + mCount = 0; if (mBuffer->useVBOs() && !mBuffer->isLocked()) |