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:
@@ -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;
|
||||
|
||||
@@ -346,6 +346,9 @@ public:
|
||||
// Needed when the render context has changed and invalidated the current state
|
||||
void refreshState(void);
|
||||
|
||||
void resetVertexBuffers();
|
||||
void restoreVertexBuffers();
|
||||
|
||||
LLMatrix4a genRot(const GLfloat& a, const LLVector4a& axis) const;
|
||||
LLMatrix4a genRot(const GLfloat& a, const GLfloat& x, const GLfloat& y, const GLfloat& z) const { return genRot(a,LLVector4a(x,y,z)); }
|
||||
LLMatrix4a genOrtho(const GLfloat& left, const GLfloat& right, const GLfloat& bottom, const GLfloat& top, const GLfloat& znear, const GLfloat& zfar) const;
|
||||
|
||||
Reference in New Issue
Block a user