From 762518d26a805e3d8f8af143ba71367ceb21bd2e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Jun 2011 10:31:53 -0600 Subject: [PATCH] svga: fix incorrect user buffer size computation for instance divisor case See preceeding commit for more info. --- src/gallium/drivers/svga/svga_pipe_draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 { -- 2.30.2