nv30: Fix an offset for vbos being applied to a buffer twice
authorAdam Stylinski <kungfujesus06@gmail.com>
Sat, 31 Dec 2022 21:14:38 +0000 (16:14 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 3 Jan 2023 19:40:23 +0000 (19:40 +0000)
Similar to 1387d1d4, this offset was being applied twice (once in
translate_generic, and once when the buffer is mapped).

This fixes 7972, which was initially thought to be an endianness
specific issue.

CC: mesa-stable
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20468>

src/gallium/drivers/nouveau/nv30/nv30_push.c

index 7b762bc..6286850 100644 (file)
@@ -229,10 +229,10 @@ nv30_push_vbo(struct nv30_context *nv30, const struct pipe_draw_info *info,
    if (info->index_size) {
       if (!info->has_user_indices)
          ctx.idxbuf = nouveau_resource_map_offset(&nv30->base,
-            nv04_resource(info->index.resource), draw->start * info->index_size,
+            nv04_resource(info->index.resource), 0,
             NOUVEAU_BO_RD);
       else
-         ctx.idxbuf = (char*)info->index.user + draw->start * info->index_size;
+         ctx.idxbuf = (char*)info->index.user;
       if (!ctx.idxbuf) {
          nv30_state_release(nv30);
          return;