summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-07-15 10:33:16 -0700
committerGraham Linden <graham@lindenlab.com>2019-07-15 10:33:16 -0700
commitddf703611dd6ae7081b12e5be70bc69d44e6a3a2 (patch)
tree91bcae802f33517da6701c563f05e1b4338784ea
parentafdda55b8f6ad58c3e57185d3c352a923f4893aa (diff)
SL-10761
Add code to force a usage hint when VBOs are disabled and make useBVOs reflect that as well.
-rw-r--r--indra/llrender/llgl.cpp3
-rw-r--r--indra/llrender/llvertexbuffer.cpp15
2 files changed, 16 insertions, 2 deletions
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);
}
//----------------------------------------------------------------------------