idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[0]);
idct->pipe->bind_vs_state(idct->pipe, idct->matrix_vs);
idct->pipe->bind_fs_state(idct->pipe, idct->matrix_fs);
- util_draw_arrays(idct->pipe, PIPE_PRIM_QUADS, 0, num_verts);
+ util_draw_arrays_instanced(idct->pipe, PIPE_PRIM_QUADS, 0, 4, 0, num_verts);
/* second stage */
idct->pipe->set_framebuffer_state(idct->pipe, &buffer->fb_state[1]);
idct->pipe->bind_fragment_sampler_states(idct->pipe, 2, idct->samplers.stage[1]);
idct->pipe->bind_vs_state(idct->pipe, idct->transpose_vs);
idct->pipe->bind_fs_state(idct->pipe, idct->transpose_fs);
- util_draw_arrays(idct->pipe, PIPE_PRIM_QUADS, 0, num_verts);
+ util_draw_arrays_instanced(idct->pipe, PIPE_PRIM_QUADS, 0, 4, 0, num_verts);
}
}
renderer->pipe->bind_vs_state(renderer->pipe, renderer->vs);
renderer->pipe->bind_fs_state(renderer->pipe, renderer->fs);
- util_draw_arrays(renderer->pipe, PIPE_PRIM_QUADS, 0, buffer->num_macroblocks * 4);
+ util_draw_arrays_instanced(renderer->pipe, PIPE_PRIM_QUADS, 0, 4, 0, buffer->num_macroblocks);
renderer->pipe->flush(renderer->pipe, PIPE_FLUSH_RENDER_CACHE, buffer->fence);
for ( i = 0; i < num_elements; ++i ) {
elements[i].src_offset = offset;
- elements[i].instance_divisor = 0;
+ elements[i].instance_divisor = 1;
elements[i].vertex_buffer_index = vertex_buffer_index;
offset += util_format_get_blocksize(elements[i].src_format);
}
vl_vb_add_block(struct vl_vertex_buffer *buffer, void *elements)
{
void *pos;
- unsigned i;
assert(buffer);
pos = buffer->vectors + buffer->num_verts * buffer->stride;
- for(i = 0; i < 4; ++i) {
- memcpy(pos, elements, buffer->stride);
- pos += buffer->stride;
- buffer->num_verts++;
- }
+ memcpy(pos, elements, buffer->stride);
+ buffer->num_verts++;
}
void vl_vb_unmap(struct vl_vertex_buffer *buffer, struct pipe_context *pipe);