In render_disconnected_background don't bind a shader or flush unless a disconnect image is actually being drawn.

This commit is contained in:
Shyotl
2013-10-09 16:05:15 -05:00
parent e96caa78a1
commit e324ffd9ad

View File

@@ -1572,12 +1572,6 @@ void render_ui_2d()
void render_disconnected_background()
{
if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.bind();
}
gGL.color4f(1,1,1,1);
if (!gDisconnectedImagep && gDisconnected)
{
llinfos << "Loading last bitmap..." << llendl;
@@ -1619,7 +1613,6 @@ void render_disconnected_background()
raw->expandToPowerOfTwo();
gDisconnectedImagep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE );
gStartTexture = gDisconnectedImagep;
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
// Make sure the progress view always fills the entire window.
@@ -1628,6 +1621,10 @@ void render_disconnected_background()
if (gDisconnectedImagep)
{
if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.bind();
}
LLGLSUIDefault gls_ui;
gViewerWindow->setup2DRender();
gGL.pushMatrix();
@@ -1644,14 +1641,12 @@ void render_disconnected_background()
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
}
gGL.popMatrix();
gGL.flush();
if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.unbind();
}
}
gGL.flush();
if (LLGLSLShader::sNoFixedFunction)
{
gUIProgram.unbind();
}
}
void display_cleanup()