From 0191b067568b87fc21841b8e2a38ca3bbf49bd16 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Sat, 15 Oct 2022 14:42:49 -0400 Subject: [PATCH] mesa: Fix multiple matrix pops in a row MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Part-of: --- src/mesa/main/matrix.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 0793cb1..a96d4ed 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -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; } -- 2.7.4