tnl: Respect `start` when converting indices to GLuint
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 15 Jan 2021 08:40:18 +0000 (00:40 -0800)
committerMarge Bot <eric+marge@anholt.net>
Wed, 20 Jan 2021 00:29:04 +0000 (00:29 +0000)
commit376c8f750b9766d9704ced167dfaf00f521a92f4
tree4a9c21067ecfd8e04c30579eeb2f99259edd1a8b
parentbd6120f562d57e150aa2071f9108f538858311a6
tnl: Respect `start` when converting indices to GLuint

Prior to commit e99e7aa4c1ddd7b8c2c4388f4f8e4fa1955ca771 (mesa: switch
Draw(Range)Elements(BaseVertex) calls to DrawGallium), the indices
parameter of glDrawElements (an offset into the VBO) was handled by
setting ib->ptr.  With that commit, it instead began binding the
index buffer with offset 0, and adding the offset to draw->start,
which eventually becomes prim->start.

t_draw.c's bind_indices() was trying to convert the relevant section of
the index buffer to GLuints, but was failing to account for start, so
it nabbed the wrong portion of the index buffer.

Fixes: e99e7aa4c1d ("mesa: switch Draw(Range)Elements(BaseVertex) calls to DrawGallium")
Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8522>
src/mesa/tnl/t_draw.c