From: Keith Whitwell Date: Fri, 11 Oct 2002 08:24:13 +0000 (+0000) Subject: lineloop fix X-Git-Tag: 062012170305~26277 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b110ca34f0d3926bed1bd4afe77baba93eba7f1e;p=profile%2Fivi%2Fmesa.git lineloop fix --- diff --git a/src/mesa/drivers/common/t_dd_dmatmp.h b/src/mesa/drivers/common/t_dd_dmatmp.h index b8cf91d..e1779ce 100644 --- a/src/mesa/drivers/common/t_dd_dmatmp.h +++ b/src/mesa/drivers/common/t_dd_dmatmp.h @@ -1,4 +1,4 @@ -/* $Id: t_dd_dmatmp.h,v 1.13 2002/06/15 02:38:18 brianp Exp $ */ +/* $Id: t_dd_dmatmp.h,v 1.14 2002/10/11 08:24:13 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -240,17 +240,25 @@ static void TAG(render_line_loop_verts)( GLcontext *ctx, currentsz--; dmasz--; - if (currentsz < 8) - currentsz = dmasz; - - for ( ; j + 1 < count; j += nr - 1 ) { - nr = MIN2( currentsz, count - j ); - EMIT_VERTS( ctx, j, nr ); + if (currentsz < 8) { + NEW_BUFFER(); currentsz = dmasz; } - if (start < count - 1 && (flags & PRIM_END)) + if (j + 1 < count) { + for ( ; j + 1 < count; j += nr - 1 ) { + nr = MIN2( currentsz, count - j ); + EMIT_VERTS( ctx, j, nr ); + currentsz = dmasz; + } + + if (start < count - 1 && (flags & PRIM_END)) + EMIT_VERTS( ctx, start, 1 ); + } + else if (start + 1 < count && (flags & PRIM_END)) { + EMIT_VERTS( ctx, start+1, 1 ); EMIT_VERTS( ctx, start, 1 ); + } FINISH;