davep avatar davep committed aef25ca

SH-2598 Fix for crash when rendering mesh silhouette (workaround driver bug by rendering from client memory instead of using face VBO).

Comments (0)

Files changed (1)

indra/newview/llselectmgr.cpp

 //helper function for pushing relevant vertices from drawable to GL
 void pushWireframe(LLDrawable* drawable)
 {
-	if (drawable->isState(LLDrawable::RIGGED))
-	{ //render straight from rigged volume if this is a rigged attachment
-		LLVOVolume* vobj = drawable->getVOVolume();
-		if (vobj)
-		{
-			vobj->updateRiggedVolume();
-			LLRiggedVolume* rigged_volume = vobj->getRiggedVolume();
-			if (rigged_volume)
+	LLVOVolume* vobj = drawable->getVOVolume();
+	if (vobj)
+	{
+		LLVertexBuffer::unbind();
+		gGL.pushMatrix();
+		gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
+
+		LLVolume* volume = NULL;
+
+		if (drawable->isState(LLDrawable::RIGGED))
+		{
+				vobj->updateRiggedVolume();
+				volume = vobj->getRiggedVolume();
+		}
+		else
+		{
+			volume = vobj->getVolume();
+		}
+
+		if (volume)
+		{
+			for (S32 i = 0; i < volume->getNumVolumeFaces(); ++i)
 			{
-				LLVertexBuffer::unbind();
-				gGL.pushMatrix();
-				gGL.multMatrix((F32*) vobj->getRelativeXform().mMatrix);
-				for (S32 i = 0; i < rigged_volume->getNumVolumeFaces(); ++i)
-				{
-					const LLVolumeFace& face = rigged_volume->getVolumeFace(i);
-					LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, face.mTexCoords, face.mNumIndices, face.mIndices);
-				}
-				gGL.popMatrix();
+				const LLVolumeFace& face = volume->getVolumeFace(i);
+				LLVertexBuffer::drawElements(LLRender::TRIANGLES, face.mPositions, face.mTexCoords, face.mNumIndices, face.mIndices);
 			}
 		}
-	}
-	else
-	{
-		for (S32 i = 0; i < drawable->getNumFaces(); ++i)
-		{
-			LLFace* face = drawable->getFace(i);
-			if (face->verify())
-			{
-				pushVerts(face, LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0);
-			}
-		}
-	}
+
+		gGL.popMatrix();
+	}
+	
 }
 
 void LLSelectNode::renderOneWireframe(const LLColor4& color)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.