summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915/i915_context.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-08-25 15:11:03 +0800
committerChia-I Wu <[email protected]>2010-08-25 16:06:45 +0800
commit22f6026324f63c142925244ff575fefc29a90389 (patch)
tree27be867272e6799cfa6d5ff153ce84e5b693a914 /src/gallium/drivers/i915/i915_context.c
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/i915/i915_context.c')
-rw-r--r--src/gallium/drivers/i915/i915_context.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/gallium/drivers/i915/i915_context.c b/src/gallium/drivers/i915/i915_context.c
index 2beb9e3091f..847dd6dd47e 100644
--- a/src/gallium/drivers/i915/i915_context.c
+++ b/src/gallium/drivers/i915/i915_context.c
@@ -66,18 +66,9 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
/*
* Map index buffer, if present
*/
- if (info->indexed && i915->index_buffer.buffer) {
- char *indices = (char *) i915_buffer(i915->index_buffer.buffer)->data;
- mapped_indices = (void *) (indices + i915->index_buffer.offset);
- }
-
- draw_set_mapped_element_buffer_range(draw, (mapped_indices) ?
- i915->index_buffer.index_size : 0,
- info->index_bias,
- info->min_index,
- info->max_index,
- mapped_indices);
-
+ if (info->indexed && i915->index_buffer.buffer)
+ mapped_indices = i915_buffer(i915->index_buffer.buffer)->data;
+ draw_set_mapped_index_buffer(draw, mapped_indices);
draw_set_mapped_constant_buffer(draw, PIPE_SHADER_VERTEX, 0,
i915->current.constants[PIPE_SHADER_VERTEX],
@@ -87,7 +78,7 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
/*
* Do the drawing
*/
- draw_arrays(i915->draw, info->mode, info->start, info->count);
+ draw_vbo(i915->draw, info);
/*
* unmap vertex/index buffers
@@ -96,9 +87,8 @@ i915_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
draw_set_mapped_vertex_buffer(draw, i, NULL);
}
- if (mapped_indices) {
- draw_set_mapped_element_buffer(draw, 0, 0, NULL);
- }
+ if (mapped_indices)
+ draw_set_mapped_index_buffer(draw, NULL);
}