From 5da8352225ddd0b95d3198123174216e09a848b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sat, 19 Dec 2020 19:12:48 -0500 Subject: [PATCH] mesa: don't save gl_shared_state in glPushAttrib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit glPushAttrib only saves values and names. It doesn't save objects. Reviewed-by: Zoltán Böszörményi Acked-by: Pierre-Eric Pelloux-Prayer Part-of: --- 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; };