diff options
author | Jakob Bornecrantz <wallbraker@gmail.com> | 2011-01-24 02:03:59 +0100 |
---|---|---|
committer | Jakob Bornecrantz <wallbraker@gmail.com> | 2011-01-24 03:26:59 +0100 |
commit | 832029e1c1c027e8f697cc8fdc75902e3c24f38a (patch) | |
tree | 273a7d6b0cf7cbb2a2a41c4dbe80b6639fc07628 /src/gallium/drivers/i915/i915_state.c | |
parent | 9a9630dcf0666af5a29d529db2ccb832b592e191 (diff) | |
download | external_mesa3d-832029e1c1c027e8f697cc8fdc75902e3c24f38a.zip external_mesa3d-832029e1c1c027e8f697cc8fdc75902e3c24f38a.tar.gz external_mesa3d-832029e1c1c027e8f697cc8fdc75902e3c24f38a.tar.bz2 |
i915g: Remove draw_flushes and state that we don't need to track
Diffstat (limited to 'src/gallium/drivers/i915/i915_state.c')
-rw-r--r-- | src/gallium/drivers/i915/i915_state.c | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index e386a3f..b31cc30 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -776,17 +776,25 @@ static void i915_set_vertex_buffers(struct pipe_context *pipe, const struct pipe_vertex_buffer *buffers) { struct i915_context *i915 = i915_context(pipe); - /* Because we change state before the draw_set_vertex_buffers call - * we need a flush here, just to be sure. - */ - draw_flush(i915->draw); + struct draw_context *draw = i915->draw; + int i; - util_copy_vertex_buffers(i915->vertex_buffer, - &i915->num_vertex_buffers, - buffers, count); +#if 0 + /* XXX doesn't look like this is needed */ + /* unmap old */ + for (i = 0; i < i915->num_vertex_buffers; i++) { + draw_set_mapped_vertex_buffer(draw, i, NULL); + } +#endif /* pass-through to draw module */ - draw_set_vertex_buffers(i915->draw, count, buffers); + draw_set_vertex_buffers(draw, count, buffers); + + /* map new */ + for (i = 0; i < count; i++) { + void *buf = i915_buffer(buffers[i].buffer)->data; + draw_set_mapped_vertex_buffer(draw, i, buf); + } } static void * @@ -811,11 +819,6 @@ i915_bind_vertex_elements_state(struct pipe_context *pipe, struct i915_context *i915 = i915_context(pipe); struct i915_velems_state *i915_velems = (struct i915_velems_state *) velems; - /* Because we change state before the draw_set_vertex_buffers call - * we need a flush here, just to be sure. - */ - draw_flush(i915->draw); - /* pass-through to draw module */ if (i915_velems) { draw_set_vertex_elements(i915->draw, |