gallium: nr_attrs was off by one, updated comments, minor code movement
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 3 Jul 2008 01:05:18 +0000 (19:05 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 3 Jul 2008 01:05:18 +0000 (19:05 -0600)
src/gallium/drivers/softpipe/sp_setup.c

index 543d86a5cb949b64448394c0753b0d460c3b1fe4..e99df9d0181e1dd22a5e259c64b2889170b1024b 100644 (file)
@@ -1266,12 +1266,14 @@ void setup_prepare( struct setup_context *setup )
       sp->framebuffer.zsbuf->status = PIPE_SURFACE_STATUS_DEFINED;
    }
 
+   /* Note: nr_attrs is only used for debugging (vertex printing) */
    {
       const struct sp_fragment_shader *fs = setup->softpipe->fs;
-      setup->quad.nr_attrs = fs->info.num_inputs;
-      sp->quad.first->begin(sp->quad.first);
+      setup->quad.nr_attrs = fs->info.num_inputs + 1; /* +1 for vert pos */
    }
 
+   sp->quad.first->begin(sp->quad.first);
+
    if (sp->reduced_api_prim == PIPE_PRIM_TRIANGLES &&
        sp->rasterizer->fill_cw == PIPE_POLYGON_MODE_FILL &&
        sp->rasterizer->fill_ccw == PIPE_POLYGON_MODE_FILL) {