From 1e09d3ae19b6e34c100ece9aac4cf7621d2756ce Mon Sep 17 00:00:00 2001 From: havoc Date: Sat, 13 Nov 2010 12:39:52 +0000 Subject: [PATCH] skip zero triangle batches, for good measure git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10594 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.39.2