util: set vbuf.max_index in draw_vertex_buffer()
authorKeith Whitwell <keithw@vmware.com>
Fri, 27 Feb 2009 15:10:11 +0000 (15:10 +0000)
committerKeith Whitwell <keithw@vmware.com>
Fri, 27 Feb 2009 15:30:34 +0000 (15:30 +0000)
(cherry picked from commit 1350f2efba5eeceebe0e711db6152c29e9889ce7)

src/gallium/auxiliary/util/u_draw_quad.c

index f282f3d289154e0ca00168c4c4805259c739a057..f0bcd758999911dc0a9cc74f760aa54e54a99ed7 100644 (file)
@@ -51,9 +51,11 @@ util_draw_vertex_buffer(struct pipe_context *pipe,
    assert(num_attribs <= PIPE_MAX_ATTRIBS);
 
    /* tell pipe about the vertex buffer */
+   memset(&vbuffer, 0, sizeof(vbuffer));
    vbuffer.buffer = vbuf;
    vbuffer.stride = num_attribs * 4 * sizeof(float);  /* vertex size */
    vbuffer.buffer_offset = offset;
+   vbuffer.max_index = num_verts - 1;
    pipe->set_vertex_buffers(pipe, 1, &vbuffer);
 
    /* tell pipe about the vertex attributes */