From ddf703611dd6ae7081b12e5be70bc69d44e6a3a2 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Mon, 15 Jul 2019 10:33:16 -0700 Subject: SL-10761 Add code to force a usage hint when VBOs are disabled and make useBVOs reflect that as well. --- indra/llrender/llgl.cpp | 3 ++- indra/llrender/llvertexbuffer.cpp | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index c555f556fa..c01c15391d 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -2051,7 +2051,8 @@ LLGLState::LLGLState(LLGLenum state, S32 enabled) : if (mState) { mWasEnabled = sStateMap[state]; - llassert(mWasEnabled == glIsEnabled(state)); + // we can't actually assert on this as queued changes to state are not reflected by glIsEnabled + //llassert(mWasEnabled == glIsEnabled(state)); setEnabled(enabled); stop_glerror(); } 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); } //---------------------------------------------------------------------------- -- cgit v1.2.3