Commits

davep committed c51eeec

SH-2690 Fix for spammy triangle death on GeForce 7800 Go when selecting flexi attachments.

  • Participants
  • Parent commits d363fe6

Comments (0)

Files changed (2)

File indra/llrender/llrender.cpp

 void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z)
 { 
 	//the range of mVerticesp, mColorsp and mTexcoordsp is [0, 4095]
+	if (mCount > 2048)
+	{
+		switch (mMode)
+		{
+			case LLRender::POINTS: flush(); break;
+			case LLRender::TRIANGLES: if (mCount%3==0) flush(); break;
+			case LLRender::QUADS: if(mCount%4 == 0) flush(); break; 
+			case LLRender::LINES: if (mCount%2 == 0) flush(); break;
+		}
+	}
+			
 	if (mCount > 4094)
 	{
 	//	llwarns << "GL immediate mode overflow.  Some geometry not drawn." << llendl;

File indra/newview/llselectmgr.cpp

 		return;
 	}
 
+
+	LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+	if (shader)
+	{
+		gSolidColorProgram.bind();
+	}
+
 	gGL.matrixMode(LLRender::MM_MODELVIEW);
 	gGL.pushMatrix();
 	gGL.pushUIMatrix();
 	}
 	gGL.popMatrix();
 	gGL.popUIMatrix();
+
+	if (shader)
+	{
+		shader->bind();
+	}
 }
 
 //