diff options
author | Brian <[email protected]> | 2008-04-08 21:14:58 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2008-04-08 21:20:10 -0600 |
commit | 1f888abf16ce4de00231505b8d1bc68426b04e8f (patch) | |
tree | 51636dca1c41a9e8906f5f51cbd99a61f804d89b /src/gallium/drivers/i915simple/i915_context.c | |
parent | 28cf8c8fdcbd2817b93f27cad2bba3b4fb8aecf5 (diff) |
i915: keep track of num_vertex_attribs/buffers for shorter loops
Diffstat (limited to 'src/gallium/drivers/i915simple/i915_context.c')
-rw-r--r-- | src/gallium/drivers/i915simple/i915_context.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/gallium/drivers/i915simple/i915_context.c b/src/gallium/drivers/i915simple/i915_context.c index fee33d82de4..58a5854f0d9 100644 --- a/src/gallium/drivers/i915simple/i915_context.c +++ b/src/gallium/drivers/i915simple/i915_context.c @@ -65,14 +65,12 @@ i915_draw_elements( struct pipe_context *pipe, /* * Map vertex buffers */ - for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { - if (i915->vertex_buffer[i].buffer) { - void *buf - = pipe->winsys->buffer_map(pipe->winsys, - i915->vertex_buffer[i].buffer, - PIPE_BUFFER_USAGE_CPU_READ); - draw_set_mapped_vertex_buffer(draw, i, buf); - } + for (i = 0; i < i915->num_vertex_buffers; i++) { + void *buf + = pipe->winsys->buffer_map(pipe->winsys, + i915->vertex_buffer[i].buffer, + PIPE_BUFFER_USAGE_CPU_READ); + draw_set_mapped_vertex_buffer(draw, i, buf); } /* Map index buffer, if present */ if (indexBuffer) { @@ -96,11 +94,9 @@ i915_draw_elements( struct pipe_context *pipe, /* * unmap vertex/index buffers */ - for (i = 0; i < PIPE_MAX_ATTRIBS; i++) { - if (i915->vertex_buffer[i].buffer) { - pipe->winsys->buffer_unmap(pipe->winsys, i915->vertex_buffer[i].buffer); - draw_set_mapped_vertex_buffer(draw, i, NULL); - } + for (i = 0; i < i915->num_vertex_buffers; i++) { + pipe->winsys->buffer_unmap(pipe->winsys, i915->vertex_buffer[i].buffer); + draw_set_mapped_vertex_buffer(draw, i, NULL); } if (indexBuffer) { pipe->winsys->buffer_unmap(pipe->winsys, indexBuffer); |