summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/i965/brw_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/i965/brw_draw.c')
-rw-r--r--src/gallium/drivers/i965/brw_draw.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/gallium/drivers/i965/brw_draw.c b/src/gallium/drivers/i965/brw_draw.c
index 9bad61ef72..4625c2048f 100644
--- a/src/gallium/drivers/i965/brw_draw.c
+++ b/src/gallium/drivers/i965/brw_draw.c
@@ -142,7 +142,7 @@ static int brw_emit_prim(struct brw_context *brw,
*/
static int
try_draw_range_elements(struct brw_context *brw,
- struct pipe_buffer *index_buffer,
+ struct pipe_resource *index_buffer,
unsigned hw_prim,
unsigned start, unsigned count)
{
@@ -178,8 +178,8 @@ try_draw_range_elements(struct brw_context *brw,
static void
brw_draw_range_elements(struct pipe_context *pipe,
- struct pipe_buffer *index_buffer,
- unsigned index_size,
+ struct pipe_resource *index_buffer,
+ unsigned index_size, int index_bias,
unsigned min_index,
unsigned max_index,
unsigned mode, unsigned start, unsigned count)
@@ -194,6 +194,8 @@ brw_draw_range_elements(struct pipe_context *pipe,
debug_printf("PRIM: %s start %d count %d index_buffer %p\n",
u_prim_name(mode), start, count, (void *)index_buffer);
+ assert(index_bias == 0);
+
/* Potentially trigger upload of new index buffer.
*
* XXX: do we need to go through state validation to achieve this?
@@ -201,7 +203,7 @@ brw_draw_range_elements(struct pipe_context *pipe,
*/
if (brw->curr.index_buffer != index_buffer ||
brw->curr.index_size != index_size) {
- pipe_buffer_reference( &brw->curr.index_buffer, index_buffer );
+ pipe_resource_reference( &brw->curr.index_buffer, index_buffer );
brw->curr.index_size = index_size;
brw->state.dirty.mesa |= PIPE_NEW_INDEX_BUFFER;
}
@@ -232,13 +234,13 @@ brw_draw_range_elements(struct pipe_context *pipe,
static void
brw_draw_elements(struct pipe_context *pipe,
- struct pipe_buffer *index_buffer,
- unsigned index_size,
+ struct pipe_resource *index_buffer,
+ unsigned index_size, int index_bias,
unsigned mode,
unsigned start, unsigned count)
{
brw_draw_range_elements( pipe, index_buffer,
- index_size,
+ index_size, index_bias,
0, 0xffffffff,
mode,
start, count );
@@ -248,7 +250,7 @@ static void
brw_draw_arrays(struct pipe_context *pipe, unsigned mode,
unsigned start, unsigned count)
{
- brw_draw_elements(pipe, NULL, 0, mode, start, count);
+ brw_draw_elements(pipe, NULL, 0, 0, mode, start, count);
}
@@ -263,17 +265,17 @@ boolean brw_draw_init( struct brw_context *brw )
/* Create helpers for uploading data in user buffers:
*/
- brw->vb.upload_vertex = u_upload_create( brw->base.screen,
+ brw->vb.upload_vertex = u_upload_create( &brw->base,
128 * 1024,
64,
- PIPE_BUFFER_USAGE_VERTEX );
+ PIPE_BIND_VERTEX_BUFFER );
if (brw->vb.upload_vertex == NULL)
return FALSE;
- brw->vb.upload_index = u_upload_create( brw->base.screen,
+ brw->vb.upload_index = u_upload_create( &brw->base,
32 * 1024,
64,
- PIPE_BUFFER_USAGE_INDEX );
+ PIPE_BIND_INDEX_BUFFER );
if (brw->vb.upload_index == NULL)
return FALSE;