aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_pipe_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/svga/svga_pipe_draw.c')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_draw.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c
index 58e930d9835..fceaa83d701 100644
--- a/src/gallium/drivers/svga/svga_pipe_draw.c
+++ b/src/gallium/drivers/svga/svga_pipe_draw.c
@@ -248,10 +248,34 @@ svga_draw_arrays( struct pipe_context *pipe,
start, count);
}
+static void
+svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
+{
+ struct svga_context *svga = svga_context(pipe);
+
+ if (info->indexed && svga->curr.ib.buffer) {
+ unsigned offset;
+
+ assert(svga->curr.ib.offset % svga->curr.ib.index_size == 0);
+ offset = svga->curr.ib.offset / svga->curr.ib.index_size;
+
+ svga_draw_range_elements(pipe, svga->curr.ib.buffer,
+ svga->curr.ib.index_size, info->index_bias,
+ info->min_index, info->max_index,
+ info->mode, info->start + offset, info->count);
+ }
+ else {
+ svga_draw_range_elements(pipe, NULL, 0, 0,
+ info->min_index, info->max_index,
+ info->mode, info->start, info->count);
+ }
+}
+
void svga_init_draw_functions( struct svga_context *svga )
{
svga->pipe.draw_arrays = svga_draw_arrays;
svga->pipe.draw_elements = svga_draw_elements;
svga->pipe.draw_range_elements = svga_draw_range_elements;
+ svga->pipe.draw_vbo = svga_draw_vbo;
}