[sldev] VWR-1354 / crash in drawpool

Nicholaz Beresford nicholaz at blueflash.cc
Sun Jun 24 08:38:23 PDT 2007


Please have a look, in case I missed something:
https://jira.secondlife.com/browse/VWR-1354


Nick


-- 
Second Life from the inside out:
http://nicholaz-beresford.blogspot.com/
-------------- next part --------------
--- linden-orig\indra\newview\lldrawpool.cpp	2007-06-13 10:13:20.000000000 +0200
+++ linden\indra\newview\lldrawpool.cpp	2007-06-24 17:27:39.140625000 +0200
@@ -473,8 +473,10 @@
 	
 	for (std::vector<LLDrawInfo*>::const_iterator k = draw_info.begin(); k != draw_info.end(); ++k)
 	{
-		LLDrawInfo& params = **k;
-		pushBatch(params, mask, texture);
+		LLDrawInfo *pparams = *k;
+		if (pparams) {
+			pushBatch(*pparams, mask, texture);
+		}
 	}
 }
 
@@ -489,12 +491,16 @@
 	U32* indices_pointer = NULL;
 	for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
 	{
-		LLDrawInfo& params = **i;
-		params.mVertexBuffer->setBuffer(mask);
-		indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
-		glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
-							GL_UNSIGNED_INT, indices_pointer+params.mOffset);
-		gPipeline.mTrianglesDrawn += params.mCount/3;
+		LLDrawInfo *pparams = *i;
+		if (pparams && pparams->mVertexBuffer.notNull())
+		{
+			LLDrawInfo& params = *pparams;
+			params.mVertexBuffer->setBuffer(mask);
+			indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
+			glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
+								GL_UNSIGNED_INT, indices_pointer+params.mOffset);
+			gPipeline.mTrianglesDrawn += params.mCount/3;
+		}
 	}
 }
 
@@ -508,18 +514,15 @@
 
 	for (std::vector<LLDrawInfo*>::iterator i = draw_info.begin(); i != draw_info.end(); ++i)
 	{
-		LLDrawInfo& params = **i;
-		pushBatch(params, mask, TRUE);
+		LLDrawInfo* pparams = *i;
+		if (pparams) {
+			pushBatch(*pparams, mask, TRUE);
+		}
 	}
 }
 
 void LLRenderPass::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture)
 {
-	if (params.mVertexBuffer.isNull())
-	{
-		return;
-	}
-
 	if (texture)
 	{
 		if (params.mTexture.notNull())
@@ -537,12 +540,15 @@
 			LLImageGL::unbindTexture(0);
 		}
 	}
-	
-	params.mVertexBuffer->setBuffer(mask);
-	U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
-	glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
-						GL_UNSIGNED_INT, indices_pointer+params.mOffset);
-	gPipeline.mTrianglesDrawn += params.mCount/3;
+
+	if (params.mVertexBuffer.notNull())
+	{
+		params.mVertexBuffer->setBuffer(mask);
+		U32* indices_pointer = (U32*) params.mVertexBuffer->getIndicesPointer();
+		glDrawRangeElements(GL_TRIANGLES, params.mStart, params.mEnd, params.mCount,
+							GL_UNSIGNED_INT, indices_pointer+params.mOffset);
+		gPipeline.mTrianglesDrawn += params.mCount/3;
+	}
 
 	if (params.mTextureMatrix && texture && params.mTexture.notNull())
 	{


More information about the SLDev mailing list