enum pipe_error
svga_swtnl_draw_vbo(struct svga_context *svga,
- const struct pipe_draw_info *info,
- struct pipe_resource *indexbuf,
- unsigned index_offset)
+ const struct pipe_draw_info *info)
{
struct pipe_transfer *vb_transfer[PIPE_MAX_ATTRIBS] = { 0 };
struct pipe_transfer *ib_transfer = NULL;
struct pipe_transfer *cb_transfer[SVGA_MAX_CONST_BUFS] = { 0 };
struct draw_context *draw = svga->swtnl.draw;
- MAYBE_UNUSED unsigned old_num_vertex_buffers;
+ ASSERTED unsigned old_num_vertex_buffers;
unsigned i;
const void *map;
enum pipe_error ret;
if (svga->curr.vb[i].buffer.resource) {
map = pipe_buffer_map(&svga->pipe,
svga->curr.vb[i].buffer.resource,
- PIPE_TRANSFER_READ,
+ PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_UNSYNCHRONIZED,
&vb_transfer[i]);
draw_set_mapped_vertex_buffer(draw, i, map, ~0);
/* Map index buffer, if present */
map = NULL;
- if (info->index_size && indexbuf) {
- map = pipe_buffer_map(&svga->pipe, indexbuf,
- PIPE_TRANSFER_READ,
- &ib_transfer);
- map = (ubyte *) map + index_offset;
+ if (info->index_size) {
+ if (info->has_user_indices) {
+ map = (ubyte *) info->index.user;
+ } else {
+ map = pipe_buffer_map(&svga->pipe, info->index.resource,
+ PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_UNSYNCHRONIZED, &ib_transfer);
+ }
draw_set_indexes(draw,
(const ubyte *) map,
info->index_size, ~0);
map = pipe_buffer_map(&svga->pipe,
svga->curr.constbufs[PIPE_SHADER_VERTEX][i].buffer,
- PIPE_TRANSFER_READ,
+ PIPE_TRANSFER_READ |
+ PIPE_TRANSFER_UNSYNCHRONIZED,
&cb_transfer[i]);
assert(map);
draw_set_mapped_constant_buffer(