summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-06-15 16:41:13 -0600
committerThomas Hellstrom <[email protected]>2011-07-01 13:30:39 +0200
commitfa4bd302122c28ee00d77dcc36723fcd31656841 (patch)
treec3d5a57060e53e1ff93035bad4e440e27915cf7c /src/gallium/drivers/svga
parentbd00fb2c060d3d90be670a2f0bbd6f9c9fd2b4ae (diff)
svga: fix incorrect user buffer size computation
Viewperf uses some unusual vertex arrays where the stride is less than the element size. In this case, the stride was 4 while the element size was 12. The difference of 8 bytes causes us to miss uploading the tail bit of the array data. Typically the stride is >= the element size so there was no problem with other apps.
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_pipe_draw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c
index 8e1c764ef5f..78f5aa10677 100644
--- a/src/gallium/drivers/svga/svga_pipe_draw.c
+++ b/src/gallium/drivers/svga/svga_pipe_draw.c
@@ -25,6 +25,7 @@
#include "svga_cmd.h"
+#include "util/u_format.h"
#include "util/u_inlines.h"
#include "util/u_prim.h"
#include "util/u_time.h"
@@ -75,8 +76,9 @@ svga_upload_user_buffers(struct svga_context *svga,
size = vb->stride *
(instance_count + instance_div - 1) / instance_div;
} else if (vb->stride) {
+ uint elemSize = util_format_get_blocksize(ve->src_format);
first = vb->stride * start;
- size = vb->stride * count;
+ size = vb->stride * (count - 1) + elemSize;
} else {
/* Only a single vertex!
* Upload with the largest vertex size the hw supports,