draw: keep record of number of active vertex buffers
authorKeith Whitwell <keith@tungstengraphics.com>
Thu, 17 Apr 2008 12:14:22 +0000 (13:14 +0100)
committerKeith Whitwell <keith@tungstengraphics.com>
Thu, 17 Apr 2008 13:23:13 +0000 (14:23 +0100)
src/gallium/auxiliary/draw/draw_context.c
src/gallium/auxiliary/draw/draw_private.h

index 0c314f6e1da111f3347ed60294c995ca6e2d7788..cdcbfdc32367836b296741f7068c0448756d021f 100644 (file)
@@ -249,6 +249,7 @@ draw_set_vertex_buffers(struct draw_context *draw,
    draw_do_flush( draw, DRAW_FLUSH_VERTEX_CACHE/*STATE_CHANGE*/ );
 
    memcpy(draw->vertex_buffer, buffers, count * sizeof(buffers[0]));
+   draw->nr_vertex_buffers = count;
 }
 
 
index 8ac061cc9f899968e10dd46a1df2cc2e81e4c4c4..359a8b8a3db0fb633831bad99887eda0cba8af8b 100644 (file)
@@ -245,7 +245,10 @@ struct draw_context
    /* pipe state that we need: */
    const struct pipe_rasterizer_state *rasterizer;
    struct pipe_viewport_state viewport;
+
    struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS];
+   unsigned nr_vertex_buffers;
+
    struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS];
    struct draw_vertex_shader *vertex_shader;