st/mesa: use cso_set_index_buffer and cso_draw_vbo
authorMarek Olšák <maraeo@gmail.com>
Wed, 11 Apr 2012 14:08:22 +0000 (16:08 +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/mesa/state_tracker/st_draw.c

index 0a35ab2be2e9a012a186c75f38930772c59048c9..edab76bf56724ac5a85a6510799885725c265dd0 100644 (file)
@@ -795,7 +795,8 @@ find_sub_primitives(const void *elements, unsigned element_size,
  * sub-primitives.
  */
 static void
-handle_fallback_primitive_restart(struct pipe_context *pipe,
+handle_fallback_primitive_restart(struct cso_context *cso,
+                                  struct pipe_context *pipe,
                                   const struct _mesa_index_buffer *ib,
                                   struct pipe_index_buffer *ibuffer,
                                   struct pipe_draw_info *orig_info)
@@ -851,7 +852,7 @@ handle_fallback_primitive_restart(struct pipe_context *pipe,
          info.start = sub_prims[i].start;
          info.count = sub_prims[i].count;
          if (u_trim_pipe_prim(info.mode, &info.count)) {
-            pipe->draw_vbo(pipe, &info);
+            cso_draw_vbo(cso, &info);
          }
       }
    }
@@ -1075,7 +1076,7 @@ st_draw_vbo(struct gl_context *ctx,
    }
 
    setup_index_buffer(ctx, ib, &ibuffer);
-   pipe->set_index_buffer(pipe, &ibuffer);
+   cso_set_index_buffer(st->cso_context, &ibuffer);
 
    util_draw_init_info(&info);
    if (ib) {
@@ -1110,20 +1111,21 @@ st_draw_vbo(struct gl_context *ctx,
       }
 
       if (info.count_from_stream_output) {
-         pipe->draw_vbo(pipe, &info);
+         cso_draw_vbo(st->cso_context, &info);
       }
       else if (info.primitive_restart) {
          if (st->sw_primitive_restart) {
             /* Handle primitive restart for drivers that doesn't support it */
-            handle_fallback_primitive_restart(pipe, ib, &ibuffer, &info);
+            handle_fallback_primitive_restart(st->cso_context, pipe, ib,
+                                              &ibuffer, &info);
          }
          else {
             /* don't trim, restarts might be inside index list */
-            pipe->draw_vbo(pipe, &info);
+            cso_draw_vbo(st->cso_context, &info);
          }
       }
       else if (u_trim_pipe_prim(info.mode, &info.count))
-         pipe->draw_vbo(pipe, &info);
+         cso_draw_vbo(st->cso_context, &info);
    }
 
    pipe_resource_reference(&ibuffer.buffer, NULL);