gallium/u_threaded: fix uploading user indices with start != 0
authorMarek Olšák <marek.olsak@amd.com>
Fri, 14 Feb 2020 20:28:28 +0000 (15:28 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 Feb 2020 00:53:45 +0000 (00:53 +0000)
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3990>

src/gallium/auxiliary/util/u_threaded_context.c

index daed6c6950b21d270b9cca882cb947243339bbd7..c1f74e70e32c11bdadddc079d1f9cf10bf8f4d98 100644 (file)
@@ -2097,7 +2097,8 @@ tc_draw_vbo(struct pipe_context *_pipe, const struct pipe_draw_info *info)
        * e.g. transfer_unmap and flush partially-uninitialized draw_vbo
        * to the driver if it was done afterwards.
        */
-      u_upload_data(tc->base.stream_uploader, 0, size, 4, info->index.user,
+      u_upload_data(tc->base.stream_uploader, 0, size, 4,
+                    (uint8_t*)info->index.user + info->start * index_size,
                     &offset, &buffer);
       if (unlikely(!buffer))
          return;