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 <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12054>
(cherry picked from commit 1387d1d411)
This commit is contained in:
Karol Herbst 2021-07-25 02:10:29 +02:00 committed by Dylan Baker
parent f9bae7e537
commit bfefde2248
2 changed files with 3 additions and 3 deletions

View file

@ -13,7 +13,7 @@
"description": "nv30: fix emulated vertex index buffers", "description": "nv30: fix emulated vertex index buffers",
"nominated": true, "nominated": true,
"nomination_type": 0, "nomination_type": 0,
"resolution": 0, "resolution": 1,
"main_sha": null, "main_sha": null,
"because_sha": null "because_sha": null
}, },

View file

@ -514,9 +514,9 @@ nv30_draw_elements(struct nv30_context *nv30, bool shorten,
if (!info->has_user_indices) if (!info->has_user_indices)
data = nouveau_resource_map_offset(&nv30->base, data = nouveau_resource_map_offset(&nv30->base,
nv04_resource(info->index.resource), nv04_resource(info->index.resource),
start * index_size, NOUVEAU_BO_RD); 0, NOUVEAU_BO_RD);
else else
data = (char*)info->index.user + start * index_size; data = info->index.user;
if (!data) if (!data)
return; return;