From bfefde2248f3bcf112c8bc1de50b03fd63a60bf4 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 25 Jul 2021 02:10:29 +0200 Subject: [PATCH] nv30: fix emulated vertex index buffers We ended up applying the offset twice. Quite embarrassing. This fixes a bunch of vertex shader related issues like the gnome desktop is less broken and probably a lot of other applications. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5061 Cc: mesa-stable Signed-off-by: Karol Herbst Reviewed-by: Ilia Mirkin Part-of: (cherry picked from commit 1387d1d41103b3120d40f93f66a7cfe00304bfd7) --- .pick_status.json | 2 +- src/gallium/drivers/nouveau/nv30/nv30_vbo.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 002231b759a..d9c60f93fac 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -13,7 +13,7 @@ "description": "nv30: fix emulated vertex index buffers", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c index 78f442a7c0e..3e24e90c735 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_vbo.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_vbo.c @@ -514,9 +514,9 @@ nv30_draw_elements(struct nv30_context *nv30, bool shorten, if (!info->has_user_indices) data = nouveau_resource_map_offset(&nv30->base, nv04_resource(info->index.resource), - start * index_size, NOUVEAU_BO_RD); + 0, NOUVEAU_BO_RD); else - data = (char*)info->index.user + start * index_size; + data = info->index.user; if (!data) return;