From: Brian Paul Date: Thu, 3 Oct 2013 17:51:14 +0000 (-0600) Subject: svga: fix incorrect memcpy src in svga_buffer_upload_piecewise() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a50c5f8d24e860baa15dd75b44b9a20af60cebf8;p=mesa.git svga: fix incorrect memcpy src in svga_buffer_upload_piecewise() 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" Reviewed-by: Matthew McClure --- diff --git a/src/gallium/drivers/svga/svga_resource_buffer_upload.c b/src/gallium/drivers/svga/svga_resource_buffer_upload.c index 55e66134f60..e6bbc007788 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer_upload.c +++ b/src/gallium/drivers/svga/svga_resource_buffer_upload.c @@ -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); }