From: havoc Date: Sat, 13 Nov 2010 12:39:52 +0000 (+0000) Subject: skip zero triangle batches, for good measure X-Git-Tag: xonotic-v0.1.0preview~56^2~23 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=1e09d3ae19b6e34c100ece9aac4cf7621d2756ce;p=xonotic%2Fdarkplaces.git skip zero triangle batches, for good measure git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10594 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index e5dea7c7..e44489b6 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -12192,6 +12192,12 @@ void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const void RSurf_DrawBatch(void) { + // sometimes a zero triangle surface (usually a degenerate patch) makes it + // through the pipeline, killing it earlier in the pipeline would have + // per-surface overhead rather than per-batch overhead, so it's best to + // reject it here, before it hits glDraw. + if (rsurface.batchnumtriangles == 0) + return; #if 0 // batch debugging code if (r_test.integer && rsurface.entity == r_refdef.scene.worldentity && rsurface.batchvertex3f == r_refdef.scene.worldentity->model->surfmesh.data_vertex3f)