draw: fix primitive indexing in the pipeline
authorZack Rusin <zackr@vmware.com>
Tue, 15 Jun 2010 12:49:00 +0000 (08:49 -0400)
committerZack Rusin <zackr@vmware.com>
Tue, 15 Jun 2010 13:12:20 +0000 (09:12 -0400)
spotted by Keith

src/gallium/auxiliary/draw/draw_pipe.c

index c1cc32fb92c07dea2d702b7f183003a5d2a1dfee..5cc2a7521a8ab60116ba15a61cc718651fceac3a 100644 (file)
@@ -371,14 +371,16 @@ void draw_pipeline_run_linear( struct draw_context *draw,
         start += prim_info->primitive_lengths[i], i++)
    {
       unsigned count = prim_info->primitive_lengths[i];
+      char *verts = ((char*)vert_info->verts) +
+                    (start * vert_info->stride);
 
-      draw->pipeline.verts = (char *)&vert_info->verts[start];
+      draw->pipeline.verts = verts;
       draw->pipeline.vertex_stride = vert_info->stride;
       draw->pipeline.vertex_count = count;
 
       pipe_run_linear(draw,
                       prim_info->prim,
-                      &vert_info->verts[start],
+                      (struct vertex_header*)verts,
                       vert_info->stride,
                       vert_info->count);
    }