From a50c5f8d24e860baa15dd75b44b9a20af60cebf8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Oct 2013 11:51:14 -0600 Subject: [PATCH] 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 --- src/gallium/drivers/svga/svga_resource_buffer_upload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.30.2