draw: fix a regression in computing max elt
authorZack Rusin <zackr@vmware.com>
Thu, 13 Jun 2013 17:34:57 +0000 (13:34 -0400)
committerZack Rusin <zackr@vmware.com>
Mon, 17 Jun 2013 15:06:39 +0000 (11:06 -0400)
gl can use elts without setting indices, in which case
our eltMax was set to 0 and always invoking the overflow
condition. So by default set eltMax to maximum, it will
be curbed by draw_set_indexes (if it ever comes) and if
not then it will let gl's glVertexPointer/glDrawArrays
work correctly. Fixes piglit's
triangle-rasterization-overdraw test.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/draw/draw_context.c

index 1fc6dbabc2546a6807bbf749dac391aa87c2ef37..201c62d945cac8632509f900a2537aa53ffdab12 100644 (file)
@@ -138,6 +138,7 @@ boolean draw_init(struct draw_context *draw)
    draw->clip_z = TRUE;
 
    draw->pt.user.planes = (float (*) [DRAW_TOTAL_CLIP_PLANES][4]) &(draw->plane[0]);
+   draw->pt.user.eltMax = ~0;
 
    if (!draw_pipeline_init( draw ))
       return FALSE;