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 b2aa0eb675..cc0329c6f8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -948,7 +948,8 @@ void LLVertexBuffer::initClass(LLWindow* window) LL_INFOS() << "VBO Pooling Disabled" << LL_ENDL; sVBOPool = new LLAppleVBOPool(); - if (gGLManager.mIsApple) + //if (gGLManager.mIsApple) + if(0) { LL_INFOS() << "VBO Pooling Disabled" << LL_ENDL; sVBOPool = new LLAppleVBOPool(); @@ -1291,7 +1292,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; @@ -1328,7 +1330,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; @@ -1365,6 +1368,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(); @@ -1372,6 +1389,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 { @@ -1429,7 +1447,8 @@ void LLVertexBuffer::_unmapBuffer() } }; - if (gGLManager.mIsApple) + //if (gGLManager.mIsApple) + if (0) { STOP_GLERROR; if (mMappedData) |