From: Brian Paul Date: Thu, 16 Jun 2011 16:31:53 +0000 (-0600) Subject: svga: fix incorrect user buffer size computation for instance divisor case X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=762518d26a805e3d8f8af143ba71367ceb21bd2e;p=mesa.git svga: fix incorrect user buffer size computation for instance divisor case See preceeding commit for more info. --- diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c index 78f5aa10677..358ef82db31 100644 --- a/src/gallium/drivers/svga/svga_pipe_draw.c +++ b/src/gallium/drivers/svga/svga_pipe_draw.c @@ -68,15 +68,15 @@ svga_upload_user_buffers(struct svga_context *svga, unsigned first, size; boolean flushed; unsigned instance_div = ve[i].instance_divisor; + unsigned elemSize = util_format_get_blocksize(ve->src_format); svga->dirty |= SVGA_NEW_VBUFFER; if (instance_div) { first = 0; - size = vb->stride * - (instance_count + instance_div - 1) / instance_div; + count = (instance_count + instance_div - 1) / instance_div; + size = vb->stride * (count - 1) + elemSize; } else if (vb->stride) { - uint elemSize = util_format_get_blocksize(ve->src_format); first = vb->stride * start; size = vb->stride * (count - 1) + elemSize; } else {