diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2013-06-03 13:59:11 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2013-06-03 13:59:11 -0400 |
commit | bad06f68fc3122b5b83f21f1fa8bc7e7ec53bfc8 (patch) | |
tree | cdf1bdc9f6c665eba22645ce4a1fdf7c34d55321 /indra/llrender/llvertexbuffer.cpp | |
parent | 211d1dfb770aa029d77cd231815a5848640b54a6 (diff) | |
parent | af8c2bc94868e056908b4ae2fc285925cd68b56b (diff) |
Merge. Refresh from viewer-release merged with in-progress work.
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/llrender/llvertexbuffer.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index dfbd8cd4ee..4909b43e8a 100644..100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -402,7 +402,6 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) { if (sLastMask != data_mask) { - bool error = false; if (gGLManager.mGLSLVersionMajor < 2 && gGLManager.mGLSLVersionMinor < 30) { @@ -469,7 +468,6 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) { if (gDebugSession) { - error = true; gFailLog << "Bad client state! " << array[i] << " disabled." << std::endl; } else @@ -489,7 +487,6 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) { //needs to be disabled, make sure it was (DEBUG TEMPORARY) if (gDebugSession) { - error = true; gFailLog << "Bad client state! " << array[i] << " enabled." << std::endl; } else @@ -548,8 +545,10 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } //static +static LLFastTimer::DeclareTimer FTM_VB_DRAW_ARRAYS("drawArrays"); void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, const std::vector<LLVector3>& norm) { + LLFastTimer t(FTM_VB_DRAW_ARRAYS); llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL); gGL.syncMatrices(); @@ -784,6 +783,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const placeFence(); } +static LLFastTimer::DeclareTimer FTM_GL_DRAW_ARRAYS("GL draw arrays"); void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const { llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL); @@ -818,8 +818,11 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const return; } - stop_glerror(); - glDrawArrays(sGLMode[mode], first, count); + { + LLFastTimer t2(FTM_GL_DRAW_ARRAYS); + stop_glerror(); + glDrawArrays(sGLMode[mode], first, count); + } stop_glerror(); placeFence(); } @@ -1565,8 +1568,10 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo { if (map_range) { +#ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); +#endif src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } else @@ -1740,8 +1745,10 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range { if (map_range) { +#ifndef LL_MESA_HEADLESS glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); +#endif src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } else @@ -1868,7 +1875,9 @@ void LLVertexBuffer::unmapBuffer() } else if (gGLManager.mHasFlushBufferRange) { +#ifndef LL_MESA_HEADLESS glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER_ARB, offset, length); +#endif } stop_glerror(); } @@ -1934,8 +1943,10 @@ void LLVertexBuffer::unmapBuffer() else if (gGLManager.mHasFlushBufferRange) { #ifdef GL_APPLE_flush_buffer_range +#ifndef LL_MESA_HEADLESS glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); #endif +#endif } stop_glerror(); } @@ -2209,7 +2220,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask) setup = setup || bindBuffer || bindIndices; } - bool error = false; if (gDebugGL && !mGLArray) { GLint buff; @@ -2218,7 +2228,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { if (gDebugSession) { - error = true; gFailLog << "Invalid GL vertex buffer bound: " << buff << std::endl; } else @@ -2234,7 +2243,6 @@ void LLVertexBuffer::setBuffer(U32 data_mask) { if (gDebugSession) { - error = true; gFailLog << "Invalid GL index buffer bound: " << buff << std::endl; } else |