mesa: don't call _mesa_set_draw_vao in glPushClientAttrib
authorMarek Olšák <marek.olsak@amd.com>
Tue, 25 May 2021 21:13:17 +0000 (17:13 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 28 May 2021 22:15:38 +0000 (22:15 +0000)
Pushing states doesn't affect draws.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10994>

src/mesa/main/attrib.c

index 8231af0..9bf4514 100644 (file)
@@ -1391,9 +1391,6 @@ copy_array_attrib(struct gl_context *ctx,
 
    /* skip ArrayBufferObj */
    /* skip IndexBufferObj */
-
-   /* Invalidate array state. It will be updated during the next draw. */
-   _mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
 }
 
 /**
@@ -1454,6 +1451,9 @@ restore_array_attrib(struct gl_context *ctx,
       copy_array_attrib(ctx, dest, src, true);
    }
 
+   /* Invalidate array state. It will be updated during the next draw. */
+   _mesa_set_draw_vao(ctx, ctx->Array._EmptyVAO, 0);
+
    if (is_vao_name_zero || !src->VAO->IndexBufferObj ||
        _mesa_IsBuffer(src->VAO->IndexBufferObj->Name)) {
       _mesa_BindBuffer(GL_ELEMENT_ARRAY_BUFFER_ARB,