summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-06-16 10:31:53 -0600
committerThomas Hellstrom <[email protected]>2011-07-01 13:30:40 +0200
commit762518d26a805e3d8f8af143ba71367ceb21bd2e (patch)
tree7047195054062af2987d369e23125a900359ec99
parentfa4bd302122c28ee00d77dcc36723fcd31656841 (diff)
svga: fix incorrect user buffer size computation for instance divisor case
See preceeding commit for more info.
-rw-r--r--src/gallium/drivers/svga/svga_pipe_draw.c6
1 files 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 {