svga: fix incorrect memcpy src in svga_buffer_upload_piecewise()
authorBrian Paul <brianp@vmware.com>
Thu, 3 Oct 2013 17:51:14 +0000 (11:51 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 4 Oct 2013 16:25:37 +0000 (10:25 -0600)
As we march over the source buffer we're uploading in pieces, we
need to memcpy from the current offset, not the start of the buffer.
Fixes graphical corruption when drawing very large vertex buffers.

Cc: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matthew McClure <mcclurem@vmware.com>
src/gallium/drivers/svga/svga_resource_buffer_upload.c

index 55e66134f600c6f54b9563f8470653c9a4cf1986..e6bbc007788fe636fd2885ea1baaef753b4bc487 100644 (file)
@@ -502,7 +502,7 @@ svga_buffer_upload_piecewise(struct svga_screen *ss,
                                PIPE_TRANSFER_DISCARD_RANGE);
          assert(map);
          if (map) {
-            memcpy(map, sbuf->swbuf, size);
+            memcpy(map, (const char *) sbuf->swbuf + offset, size);
             sws->buffer_unmap(sws, hwbuf);
          }