More thorough VBO teardown in resetVertexBuffers/stopGL. Also, found cases where gGL.init failed to be called when it should have been.

This commit is contained in:
Shyotl
2015-06-01 17:58:19 -05:00
parent 142322528c
commit 0688cda8d2
8 changed files with 41 additions and 10 deletions

View File

@@ -1096,15 +1096,7 @@ void LLRender::init()
glBindVertexArray(ret);
#endif
}
llassert_always(mBuffer.isNull()) ;
stop_glerror();
mBuffer = new LLVertexBuffer(immediate_mask, 0);
mBuffer->allocateBuffer(4096, 0, TRUE);
mBuffer->getVertexStrider(mVerticesp);
mBuffer->getTexCoord0Strider(mTexcoordsp);
mBuffer->getColorStrider(mColorsp);
stop_glerror();
restoreVertexBuffers();
}
void LLRender::shutdown()
@@ -1148,6 +1140,23 @@ void LLRender::refreshState(void)
mDirty = false;
}
void LLRender::resetVertexBuffers()
{
mBuffer = NULL;
}
void LLRender::restoreVertexBuffers()
{
llassert_always(mBuffer.isNull());
stop_glerror();
mBuffer = new LLVertexBuffer(immediate_mask, 0);
mBuffer->allocateBuffer(4096, 0, TRUE);
mBuffer->getVertexStrider(mVerticesp);
mBuffer->getTexCoord0Strider(mTexcoordsp);
mBuffer->getColorStrider(mColorsp);
stop_glerror();
}
void LLRender::syncLightState()
{
LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;