Fixed an annoying snapshot assertion (would buffer overrun if assertions are disabled)

This commit is contained in:
Shyotl
2012-04-13 22:17:19 -05:00
parent 1d402bfe39
commit 3bd9ffe135

View File

@@ -969,12 +969,13 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
stop_glerror();
}
for (U32 i = 0; i < (U32)gGLManager.mNumTextureImageUnits; i++)
//Reversed this. disabling a texunit sets its index as current.. randomly breaking LLRender::matrixMode(U32 mode). Make sure unit0 is the 'current' unit.
for (S32 i = gGLManager.mNumTextureImageUnits-1; i >= 0; --i)
{ //dummy cleanup of any currently bound textures
if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE)
if (gGL.getTexUnit((U32)i)->getCurrType() != LLTexUnit::TT_NONE)
{
gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType());
gGL.getTexUnit(i)->disable();
gGL.getTexUnit((U32)i)->unbind(gGL.getTexUnit((U32)i)->getCurrType());
gGL.getTexUnit((U32)i)->disable();
}
}
LLAppViewer::instance()->pingMainloopTimeout("Display:RenderFlush");