diff options
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1f0c424188..96569a33e9 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -945,7 +945,8 @@ void LLVertexBuffer::initClass(LLWindow* window) { llassert(sVBOPool == nullptr); - if (gGLManager.mIsApple) + //if (gGLManager.mIsApple) + if(0) { LL_INFOS() << "VBO Pooling Disabled" << LL_ENDL; sVBOPool = new LLAppleVBOPool(); @@ -1288,7 +1289,8 @@ U8* LLVertexBuffer::mapVertexBuffer(LLVertexBuffer::AttributeType type, U32 inde count = mNumVerts - index; } - if (!gGLManager.mIsApple) + //if (!gGLManager.mIsApple) + if (1) { U32 start = mOffsets[type] + sTypeSize[type] * index; U32 end = start + sTypeSize[type] * count-1; @@ -1325,7 +1327,8 @@ U8* LLVertexBuffer::mapIndexBuffer(U32 index, S32 count) count = mNumIndices-index; } - if (!gGLManager.mIsApple) + //if (!gGLManager.mIsApple) + if(1) { U32 start = sizeof(U16) * index; U32 end = start + sizeof(U16) * count-1; @@ -1362,6 +1365,20 @@ void LLVertexBuffer::flush_vbo(GLenum target, U32 start, U32 end, void* data, U8 { if (gGLManager.mIsApple) { + U32 MapBits = GL_MAP_WRITE_BIT; + U32 buffer_size = end-start+1; + + U8 * mptr = NULL; + mptr = (U8*) glMapBufferRange( target, start, end-start+1, MapBits); + + if (mptr) + { + std::memcpy(mptr, (U8*) data, buffer_size); + if(!glUnmapBuffer(target)) LL_WARNS() << "glUnmapBuffer() failed" << LL_ENDL; + } + else LL_WARNS() << "glMapBufferRange() returned NULL" << LL_ENDL; + + /* // on OS X, flush_vbo doesn't actually write to the GL buffer, so be sure to call // _mapBuffer to tag the buffer for flushing to GL _mapBuffer(); @@ -1369,6 +1386,7 @@ void LLVertexBuffer::flush_vbo(GLenum target, U32 start, U32 end, void* data, U8 STOP_GLERROR; // copy into mapped buffer memcpy(dst+start, data, end-start+1); + */ } else { @@ -1426,7 +1444,8 @@ void LLVertexBuffer::_unmapBuffer() } }; - if (gGLManager.mIsApple) + //if (gGLManager.mIsApple) + if (0) { STOP_GLERROR; if (mMappedData) |