* Map vertex buffers
*/
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
- map = pipe_buffer_map(&svga->pipe,
- svga->curr.vb[i].buffer,
- PIPE_TRANSFER_READ,
- &vb_transfer[i]);
-
- draw_set_mapped_vertex_buffer(draw, i, map);
+ if (svga->curr.vb[i].buffer) {
+ map = pipe_buffer_map(&svga->pipe,
+ svga->curr.vb[i].buffer,
+ PIPE_TRANSFER_READ,
+ &vb_transfer[i]);
+
+ draw_set_mapped_vertex_buffer(draw, i, map);
+ }
}
/* TODO move this to update_swtnl_draw */
* unmap vertex/index buffers
*/
for (i = 0; i < svga->curr.num_vertex_buffers; i++) {
- pipe_buffer_unmap(&svga->pipe, vb_transfer[i]);
- draw_set_mapped_vertex_buffer(draw, i, NULL);
+ if (svga->curr.vb[i].buffer) {
+ pipe_buffer_unmap(&svga->pipe, vb_transfer[i]);
+ draw_set_mapped_vertex_buffer(draw, i, NULL);
+ }
}
if (ib_transfer) {