Module: Mesa
Branch: main
Commit: 0191b067568b87fc21841b8e2a38ca3bbf49bd16
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0191b067568b87fc21841b8e2a38ca3bbf49bd16

Author: Alyssa Rosenzweig <[email protected]>
Date:   Sat Oct 15 14:42:49 2022 -0400

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 <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19090>

---

 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 0793cb1cdbb..a96d4ed53b5 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;
 }
 

Reply via email to