From 76c4760e5d8522780d770f9a0a62d710806206a0 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 11 Apr 2012 16:08:22 +0200 Subject: st/mesa: use cso_set_index_buffer and cso_draw_vbo Reviewed-by: Brian Paul --- src/mesa/state_tracker/st_draw.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 0a35ab2be2e..edab76bf567 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -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); -- cgit v1.2.3