/*
* 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) {
/*
* 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);
struct i915_context *i915 = i915_context(pipe);
memcpy(i915->vertex_buffer, buffers, count * sizeof(buffers[0]));
+ i915->num_vertex_buffers = count;
+
/* pass-through to draw module */
draw_set_vertex_buffers(i915->draw, count, buffers);
}
const struct pipe_vertex_element *elements)
{
struct i915_context *i915 = i915_context(pipe);
+ i915->num_vertex_elements = count;
/* pass-through to draw module */
draw_set_vertex_elements(i915->draw, count, elements);
}