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: e6ecd22140 ("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>
This commit is contained in:
Alyssa Rosenzweig 2022-10-15 14:42:49 -04:00 committed by Marge Bot
parent 09ae2c4fee
commit 0191b06756

View file

@ -388,6 +388,7 @@ pop_matrix( struct gl_context *ctx, struct gl_matrix_stack *stack )
}
stack->Top = &(stack->Stack[stack->Depth]);
stack->ChangedSincePush = true;
return GL_TRUE;
}