RenderVBOEnable was completely broken by ll, so I fixed it.

This commit is contained in:
Shyotl
2012-01-30 19:50:41 -06:00
parent f6711e6b4f
commit eaecc9a4d0

View File

@@ -750,41 +750,26 @@ void LLVertexBuffer::cleanupClass()
S32 LLVertexBuffer::determineUsage(S32 usage)
{
S32 ret_usage = usage;
if (!sEnableVBOs)
{
ret_usage = 0;
}
if (usage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
{
ret_usage = 0;
}
if (usage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
{
ret_usage = GL_STREAM_DRAW_ARB;
}
if (usage == 0 && LLRender::sGLCoreProfile)
if (LLRender::sGLCoreProfile)
{ //MUST use VBOs for all rendering
ret_usage = GL_STREAM_DRAW_ARB;
if(!usage)
usage = GL_STREAM_DRAW_ARB;
}
else if (!sEnableVBOs || !usage)
{
return 0;
}
if (usage && usage != GL_STREAM_DRAW_ARB)
{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
if (sDisableVBOMapping)
{ //always use stream draw if VBO mapping is disabled
ret_usage = GL_STREAM_DRAW_ARB;
}
else
{
ret_usage = GL_DYNAMIC_DRAW_ARB;
}
//Only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default.
//Always use stream_draw VBO if mapping is disabled, or stream is enabled and preferred/expected
if( sDisableVBOMapping || (sUseStreamDraw && (sPreferStreamDraw || usage == GL_STREAM_DRAW_ARB)))
{
return GL_STREAM_DRAW_ARB;
}
else
{
return GL_DYNAMIC_DRAW_ARB;
}
return ret_usage;
}
LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :