summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/i915simple/i915_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/i915simple/i915_context.c')
-rw-r--r--src/gallium/drivers/i915simple/i915_context.c38
1 files changed, 29 insertions, 9 deletions
diff --git a/src/gallium/drivers/i915simple/i915_context.c b/src/gallium/drivers/i915simple/i915_context.c
index 4bef21619c2..4c01b8d5b17 100644
--- a/src/gallium/drivers/i915simple/i915_context.c
+++ b/src/gallium/drivers/i915simple/i915_context.c
@@ -50,10 +50,12 @@ static void i915_destroy( struct pipe_context *pipe )
static boolean
-i915_draw_elements( struct pipe_context *pipe,
- struct pipe_buffer *indexBuffer,
- unsigned indexSize,
- unsigned prim, unsigned start, unsigned count)
+i915_draw_range_elements(struct pipe_context *pipe,
+ struct pipe_buffer *indexBuffer,
+ unsigned indexSize,
+ unsigned min_index,
+ unsigned max_index,
+ unsigned prim, unsigned start, unsigned count)
{
struct i915_context *i915 = i915_context( pipe );
struct draw_context *draw = i915->draw;
@@ -77,7 +79,10 @@ i915_draw_elements( struct pipe_context *pipe,
void *mapped_indexes
= pipe->winsys->buffer_map(pipe->winsys, indexBuffer,
PIPE_BUFFER_USAGE_CPU_READ);
- draw_set_mapped_element_buffer(draw, indexSize, mapped_indexes);
+ draw_set_mapped_element_buffer_range(draw, indexSize,
+ min_index,
+ max_index,
+ mapped_indexes);
}
else {
/* no index/element buffer */
@@ -86,7 +91,9 @@ i915_draw_elements( struct pipe_context *pipe,
draw_set_mapped_constant_buffer(draw,
- i915->current.constants[PIPE_SHADER_VERTEX]);
+ i915->current.constants[PIPE_SHADER_VERTEX],
+ ( i915->current.num_user_constants[PIPE_SHADER_VERTEX] *
+ 4 * sizeof(float) ));
/* draw! */
draw_arrays(i915->draw, prim, start, count);
@@ -100,12 +107,23 @@ i915_draw_elements( struct pipe_context *pipe,
}
if (indexBuffer) {
pipe->winsys->buffer_unmap(pipe->winsys, indexBuffer);
- draw_set_mapped_element_buffer(draw, 0, NULL);
+ draw_set_mapped_element_buffer_range(draw, 0, start, start + count - 1, NULL);
}
return TRUE;
}
+static boolean
+i915_draw_elements( struct pipe_context *pipe,
+ struct pipe_buffer *indexBuffer,
+ unsigned indexSize,
+ unsigned prim, unsigned start, unsigned count)
+{
+ return i915_draw_range_elements( pipe, indexBuffer,
+ indexSize,
+ 0, 0xffffffff,
+ prim, start, count );
+}
static boolean i915_draw_arrays( struct pipe_context *pipe,
unsigned prim, unsigned start, unsigned count)
@@ -136,13 +154,14 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
i915->pipe.draw_arrays = i915_draw_arrays;
i915->pipe.draw_elements = i915_draw_elements;
+ i915->pipe.draw_range_elements = i915_draw_range_elements;
/*
* Create drawing context and plug our rendering stage into it.
*/
i915->draw = draw_create();
assert(i915->draw);
- if (!GETENV("I915_NO_VBUF")) {
+ if (!debug_get_bool_option("I915_NO_VBUF", FALSE)) {
draw_set_rasterize_stage(i915->draw, i915_draw_vbuf_stage(i915));
}
else {
@@ -162,7 +181,8 @@ struct pipe_context *i915_create_context( struct pipe_screen *screen,
/* Batch stream debugging is a bit hacked up at the moment:
*/
- i915->batch_start = NULL;
+ i915->batch = i915_winsys->batch_get(i915_winsys);
+ i915->batch->winsys = i915_winsys;
return &i915->pipe;
}