mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 09:00:08 +01:00
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.
This commit is contained in:
parent
bd00fb2c06
commit
fa4bd30212
1 changed files with 3 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue