summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-08-25 15:11:03 +0800
committerChia-I Wu <olv@lunarg.com>2010-08-25 16:06:45 +0800
commit22f6026324f63c142925244ff575fefc29a90389 (patch)
tree27be867272e6799cfa6d5ff153ce84e5b693a914 /src/gallium/drivers/svga
parent94e8d4171d9647db84cd53334a2b14fab062640d (diff)
gallium: Use draw_set_index_buffer and others.
Update all drivers to use draw_set_index_buffer, draw_set_mapped_index_buffer, and draw_vbo. Remove draw_set_mapped_element_buffer and draw_set_mapped_element_buffer_range.
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_swtnl_draw.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c
index 4f83822b5c..e9eba3b422 100644
--- a/src/gallium/drivers/svga/svga_swtnl_draw.c
+++ b/src/gallium/drivers/svga/svga_swtnl_draw.c
@@ -71,22 +71,17 @@ svga_swtnl_draw_vbo(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 */
map = NULL;
if (info->indexed && svga->curr.ib.buffer) {
map = pipe_buffer_map(&svga->pipe, svga->curr.ib.buffer,
PIPE_TRANSFER_READ,
&ib_transfer);
- if (map)
- map = (const void *) ((const char *) map + svga->curr.ib.offset);
}
-
- draw_set_mapped_element_buffer_range(draw, (map) ?
- svga->curr.ib.index_size : 0,
- info->index_bias,
- info->min_index,
- info->max_index,
- map);
+ draw_set_mapped_index_buffer(draw, map);
if (svga->curr.cb[PIPE_SHADER_VERTEX]) {
map = pipe_buffer_map(&svga->pipe,
@@ -100,7 +95,7 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
svga->curr.cb[PIPE_SHADER_VERTEX]->width0);
}
- draw_arrays(draw, info->mode, info->start, info->count);
+ draw_vbo(draw, info);
draw_flush(svga->swtnl.draw);
@@ -118,7 +113,7 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
if (ib_transfer) {
pipe_buffer_unmap(&svga->pipe, svga->curr.ib.buffer, ib_transfer);
- draw_set_mapped_element_buffer(draw, 0, 0, NULL);
+ draw_set_mapped_index_buffer(draw, NULL);
}
if (svga->curr.cb[PIPE_SHADER_VERTEX]) {