diff options
author | Graham Linden <graham@lindenlab.com> | 2019-07-15 10:33:16 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-07-15 10:33:16 -0700 |
commit | ddf703611dd6ae7081b12e5be70bc69d44e6a3a2 (patch) | |
tree | 91bcae802f33517da6701c563f05e1b4338784ea /indra/llrender/llvertexbuffer.cpp | |
parent | afdda55b8f6ad58c3e57185d3c352a923f4893aa (diff) |
SL-10761
Add code to force a usage hint when VBOs are disabled and make useBVOs reflect that as well.
Diffstat (limited to 'indra/llrender/llvertexbuffer.cpp')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 0c53d48c08..1b910d91b2 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -953,6 +953,17 @@ S32 LLVertexBuffer::determineUsage(S32 usage) } } + if (ret_usage == 0) + { + if (sDisableVBOMapping) + { //always use stream draw if VBO mapping is disabled + ret_usage = GL_STREAM_DRAW_ARB; + } + else + { + ret_usage = GL_DYNAMIC_DRAW_ARB; + } + } return ret_usage; } @@ -982,6 +993,8 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) mMappable(false), mFence(NULL) { + llassert(mUsage != 0); + mMappable = (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping); //zero out offsets @@ -1527,7 +1540,7 @@ bool LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) bool LLVertexBuffer::useVBOs() const { //it's generally ineffective to use VBO for things that are streaming on apple - return (mUsage != 0); + return sEnableVBOs && (mUsage != 0); } //---------------------------------------------------------------------------- |