mesa: Fix multiple matrix pops in a row
authorAlyssa Rosenzweig <alyssa@collabora.com>
Sat, 15 Oct 2022 18:42:49 +0000 (14:42 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 18 Oct 2022 20:45:47 +0000 (20:45 +0000)
commit0191b067568b87fc21841b8e2a38ca3bbf49bd16
treedf3dca0d130d1cbb3970b2e55c3eba7ca6ee2073
parent09ae2c4fee791e3008fbb2f1f218505e571fb29c
mesa: Fix multiple matrix pops in a row

When we pop a matrix, we update stack->Top, which means that stack->Top has
changed since last push. We cannot skip subsequent pops or we'll get an
incorrect matrix.

Fixes Neverball rendering. When collecting a coin in game, the
point-sprite stars popping out of the coin are in the wrong places
due to an incorrect transformation matrix.

Close: #7502
Fixes: e6ecd22140f ("mesa: make glPopMatrix a no-op if the matrix hasn't changed")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19090>
src/mesa/main/matrix.c