Mesa (master): mesa: don't save gl_shared_state in glPushAttrib

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 30 21:52:58 UTC 2021


Module: Mesa
Branch: master
Commit: 5da8352225ddd0b95d3198123174216e09a848b1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5da8352225ddd0b95d3198123174216e09a848b1

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Dec 19 19:12:48 2020 -0500

mesa: don't save gl_shared_state in glPushAttrib

glPushAttrib only saves values and names. It doesn't save objects.

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

---

 src/mesa/main/attrib.c | 17 -----------------
 src/mesa/main/mtypes.h |  7 -------
 2 files changed, 24 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 82f7ed6ed10..0229bb30689 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -275,10 +275,6 @@ _mesa_PushAttrib(GLbitfield mask)
             copy_texture_attribs(dst, src, tex);
          }
       }
-
-      head->Texture.SharedRef = NULL;
-      _mesa_reference_shared_state(ctx, &head->Texture.SharedRef, ctx->Shared);
-
       _mesa_unlock_context_textures(ctx);
    }
 
@@ -645,9 +641,6 @@ pop_texture_group(struct gl_context *ctx, struct gl_texture_attrib_node *texstat
    }
 
    _mesa_ActiveTexture(GL_TEXTURE0_ARB + texstate->CurrentUnit);
-
-   _mesa_reference_shared_state(ctx, &texstate->SharedRef, NULL);
-
    _mesa_unlock_context_textures(ctx);
 }
 
@@ -1555,16 +1548,6 @@ _mesa_PushClientAttribDefaultEXT( GLbitfield mask )
 void
 _mesa_free_attrib_data(struct gl_context *ctx)
 {
-   while (ctx->AttribStackDepth > 0) {
-      struct gl_attrib_node *attr;
-
-      ctx->AttribStackDepth--;
-      attr = ctx->AttribStack[ctx->AttribStackDepth];
-
-      if (attr->Mask & GL_TEXTURE_BIT)
-         _mesa_reference_shared_state(ctx, &attr->Texture.SharedRef, NULL);
-   }
-
    for (unsigned i = 0; i < ARRAY_SIZE(ctx->AttribStack); i++)
       free(ctx->AttribStack[i]);
 }
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index fc596dba496..2f04de3e79e 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -5057,13 +5057,6 @@ struct gl_texture_attrib_node
     * SavedObj[][].Target is unused, so the value is invalid.
     */
    struct gl_texture_object SavedObj[MAX_TEXTURE_UNITS][NUM_TEXTURE_TARGETS];
-
-   /* We need to keep a reference to the shared state.  That's where the
-    * default texture objects are kept.  We don't want that state to be
-    * freed while the attribute stack contains pointers to any default
-    * texture objects.
-    */
-   struct gl_shared_state *SharedRef;
 };
 
 



More information about the mesa-commit mailing list