mesa: optimize out _NEW_ALL in glPopAttrib(GL_ENABLE_BIT)
authorMarek Olšák <marek.olsak@amd.com>
Sat, 19 Dec 2020 07:41:32 +0000 (02:41 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 30 Jan 2021 21:25:29 +0000 (16:25 -0500)
I reviewed all affected states and this if the minimum attrib mask.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8181>

src/mesa/main/attrib.c

index 4c945c2..14c3fd9 100644 (file)
@@ -826,7 +826,20 @@ _mesa_PopAttrib(void)
 
    if (mask & GL_ENABLE_BIT) {
       pop_enable_group(ctx, &attr->Enable);
-      ctx->NewState |= _NEW_ALL;
+      ctx->NewState |= _NEW_COLOR |
+                       _NEW_DEPTH |
+                       _NEW_FOG |
+                       _NEW_LIGHT |
+                       _NEW_LINE |
+                       _NEW_POINT |
+                       _NEW_POLYGON |
+                       _NEW_SCISSOR |
+                       _NEW_TRANSFORM |
+                       _NEW_TEXTURE_STATE |
+                       _NEW_BUFFERS |
+                       _NEW_MULTISAMPLE |
+                       _NEW_PROGRAM |
+                       _NEW_FRAG_CLAMP;
       ctx->NewDriverState |= ctx->DriverFlags.NewAlphaTest |
                              ctx->DriverFlags.NewBlend |
                              ctx->DriverFlags.NewClipPlaneEnable |