struct i915_context *i915 = i915_context(pipe);
struct draw_context *draw = i915->draw;
const void *mapped_indices = NULL;
-
+ unsigned i;
/*
* Ack vs contants here, helps ipers a lot.
if (i915->dirty)
i915_update_derived(i915);
+ /*
+ * Map vertex buffers
+ */
+ for (i = 0; i < i915->nr_vertex_buffers; i++) {
+ const void *buf = i915->vertex_buffers[i].user_buffer;
+ if (!buf)
+ buf = i915_buffer(i915->vertex_buffers[i].buffer)->data;
+ draw_set_mapped_vertex_buffer(draw, i, buf);
+ }
+
/*
* Map index buffer, if present
*/
*/
draw_vbo(i915->draw, info);
+ /*
+ * unmap vertex/index buffers
+ */
+ for (i = 0; i < i915->nr_vertex_buffers; i++) {
+ draw_set_mapped_vertex_buffer(i915->draw, i, NULL);
+ }
if (mapped_indices)
draw_set_indexes(draw, NULL, 0);
util_copy_vertex_buffers(i915->vertex_buffers,
&i915->nr_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(draw, count, buffers);
- /* map new */
- for (i = 0; i < count; i++) {
- const void *buf = buffers[i].user_buffer;
- if (!buf)
- buf = i915_buffer(buffers[i].buffer)->data;
- draw_set_mapped_vertex_buffer(draw, i, buf);
- }
}
static void *