summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2006-11-22 22:07:35 +0000
committerRoland Scheidegger <[email protected]>2006-11-22 22:07:35 +0000
commit46e454863ea9dbe8618a67fb5b4b4a8c51607995 (patch)
treefdbc5d94f9c1917e3a5355a2d26f07ba816dfc5b /src/mesa
parent40c7cb7e1768cd694bdfc6864cf3a55254ffce56 (diff)
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.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/tnl/t_vtx_exec.c5
1 files changed, 5 insertions, 0 deletions
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;