gallium/util: use cso_draw_arrays in util_draw_vertex_buffer
authorMarek Olšák <maraeo@gmail.com>
Wed, 11 Apr 2012 13:51:52 +0000 (15:51 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 23 Apr 2012 23:39:21 +0000 (01:39 +0200)
Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/util/u_draw_quad.c

index 8ed3b3c09598992aded60ca0bc0fe6f5540bbdbb..590fa0c36bbf93e8a01b20dbb63177f419aabdf7 100644 (file)
@@ -57,16 +57,15 @@ util_draw_vertex_buffer(struct pipe_context *pipe,
    vbuffer.stride = num_attribs * 4 * sizeof(float);  /* vertex size */
    vbuffer.buffer_offset = offset;
 
+   /* note: vertex elements already set by caller */
+
    if (cso) {
       cso_set_vertex_buffers(cso, 1, &vbuffer);
+      cso_draw_arrays(cso, prim_type, 0, num_verts);
    } else {
       pipe->set_vertex_buffers(pipe, 1, &vbuffer);
+      util_draw_arrays(pipe, prim_type, 0, num_verts);
    }
-
-   /* note: vertex elements already set by caller */
-
-   /* draw */
-   util_draw_arrays(pipe, prim_type, 0, num_verts);
 }