From 7d82649a62d09f8889b3460a7a39c47fb610ec2a Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Fri, 1 Oct 2021 21:02:13 +0100 Subject: [PATCH] Be sure to restore the fast path flag in glEnd --- GL/immediate.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GL/immediate.c b/GL/immediate.c index 75e1e75..f4f1ba7 100644 --- a/GL/immediate.c +++ b/GL/immediate.c @@ -249,6 +249,10 @@ void APIENTRY glEnd() { *attrs = IM_ENABLED_VERTEX_ATTRIBUTES; + /* Store the fast path enabled setting so we can restore it + * after drawing */ + const GLboolean fp_was_enabled = FAST_PATH_ENABLED; + #ifndef NDEBUG // Immediate mode should always activate the fast path GLuint fastPathEnabled = _glRecalcFastPath(); @@ -265,6 +269,8 @@ void APIENTRY glEnd() { *attrs = prevAttrs; aligned_vector_clear(&VERTICES); + + FAST_PATH_ENABLED = fp_was_enabled; } void APIENTRY glRectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) {