From b46d3d7ebb0f2bf6af32e0f74152e109a4230a89 Mon Sep 17 00:00:00 2001 From: Adam Stylinski Date: Sat, 31 Dec 2022 16:14:38 -0500 Subject: [PATCH] nv30: Fix an offset for vbos being applied to a buffer twice 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 Reviewed-by: Karol Herbst Part-of: (cherry picked from commit 50972297f4c0355a137d7b32c51704e0a05028c3) --- .pick_status.json | 2 +- src/gallium/drivers/nouveau/nv30/nv30_push.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 6fb3740c6b8..845451c2623 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3307,7 +3307,7 @@ "description": "nv30: Fix an offset for vbos being applied to a buffer twice", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/nouveau/nv30/nv30_push.c b/src/gallium/drivers/nouveau/nv30/nv30_push.c index 7b762bcb054..6286850ea21 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_push.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_push.c @@ -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;