diff options
Diffstat (limited to 'src/gallium/drivers/svga/svga_swtnl_draw.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_swtnl_draw.c | 39 |
1 files changed, 17 insertions, 22 deletions
diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c index eb71c23195b..814e8edd70f 100644 --- a/src/gallium/drivers/svga/svga_swtnl_draw.c +++ b/src/gallium/drivers/svga/svga_swtnl_draw.c @@ -36,13 +36,8 @@ enum pipe_error -svga_swtnl_draw_range_elements(struct svga_context *svga, - struct pipe_resource *indexBuffer, - unsigned indexSize, - int indexBias, - unsigned min_index, - unsigned max_index, - unsigned prim, unsigned start, unsigned count) +svga_swtnl_draw_vbo(struct svga_context *svga, + const struct pipe_draw_info *info) { struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS]; struct pipe_transfer *ib_transfer = NULL; @@ -76,19 +71,18 @@ svga_swtnl_draw_range_elements(struct svga_context *svga, draw_set_mapped_vertex_buffer(draw, i, map); } + /* TODO move this to update_swtnl_draw */ + draw_set_index_buffer(draw, &svga->curr.ib); + /* Map index buffer, if present */ - if (indexBuffer) { - map = pipe_buffer_map(&svga->pipe, indexBuffer, + map = NULL; + if (info->indexed && svga->curr.ib.buffer) { + map = pipe_buffer_map(&svga->pipe, svga->curr.ib.buffer, PIPE_TRANSFER_READ, - &ib_transfer); - - draw_set_mapped_element_buffer_range(draw, - indexSize, indexBias, - min_index, - max_index, - map); + &ib_transfer); } - + draw_set_mapped_index_buffer(draw, map); + if (svga->curr.cb[PIPE_SHADER_VERTEX]) { map = pipe_buffer_map(&svga->pipe, svga->curr.cb[PIPE_SHADER_VERTEX], @@ -101,7 +95,7 @@ svga_swtnl_draw_range_elements(struct svga_context *svga, svga->curr.cb[PIPE_SHADER_VERTEX]->width0); } - draw_arrays(svga->swtnl.draw, prim, start, count); + draw_vbo(draw, info); draw_flush(svga->swtnl.draw); @@ -117,9 +111,9 @@ svga_swtnl_draw_range_elements(struct svga_context *svga, draw_set_mapped_vertex_buffer(draw, i, NULL); } - if (indexBuffer) { - pipe_buffer_unmap(&svga->pipe, indexBuffer, ib_transfer); - draw_set_mapped_element_buffer(draw, 0, 0, NULL); + if (ib_transfer) { + pipe_buffer_unmap(&svga->pipe, svga->curr.ib.buffer, ib_transfer); + draw_set_mapped_index_buffer(draw, NULL); } if (svga->curr.cb[PIPE_SHADER_VERTEX]) { @@ -157,7 +151,8 @@ boolean svga_init_swtnl( struct svga_context *svga ) draw_install_aapoint_stage(svga->swtnl.draw, &svga->pipe); draw_install_pstipple_stage(svga->swtnl.draw, &svga->pipe); - draw_set_driver_clipping(svga->swtnl.draw, debug_get_bool_option("SVGA_SWTNL_FSE", FALSE)); + if (debug_get_bool_option("SVGA_SWTNL_FSE", FALSE)) + draw_set_driver_clipping(svga->swtnl.draw, TRUE, TRUE); return TRUE; |