From 46e454863ea9dbe8618a67fb5b4b4a8c51607995 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 22 Nov 2006 22:07:35 +0000 Subject: decrease the current vertex count by 1 if an uneven number of vertices is copied by _tnl_copy_vertices. Otherwise, since in this case it will copy an extra vertex to avoid problems with vertex order in the new buffer, one triangle will be drawn twice. This fixes bug #9062. --- src/mesa/tnl/t_vtx_exec.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c index 57d842f05fe..900c4ab6cc1 100644 --- a/src/mesa/tnl/t_vtx_exec.c +++ b/src/mesa/tnl/t_vtx_exec.c @@ -239,6 +239,11 @@ static GLuint _tnl_copy_vertices( GLcontext *ctx ) return 2; } case GL_TRIANGLE_STRIP: + /* no parity issue, but need to make sure the tri is not drawn twice */ + if (nr & 1) { + tnl->vtx.prim[tnl->vtx.prim_count-1].count--; + } + /* fallthrough */ case GL_QUAD_STRIP: switch (nr) { case 0: ovf = 0; break; -- cgit v1.2.3