mesa: Store the atlas Id in the gl_bitmap_atlas structure
authorIan Romanick <ian.d.romanick@intel.com>
Mon, 12 Oct 2020 23:45:45 +0000 (16:45 -0700)
committerMarge Bot <eric+marge@anholt.net>
Sat, 24 Oct 2020 01:15:20 +0000 (01:15 +0000)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7171>

src/mesa/main/dlist.c
src/mesa/main/dlist.h

index 84d1be8..3591163 100644 (file)
@@ -884,6 +884,7 @@ alloc_bitmap_atlas(struct gl_context *ctx, GLuint listBase, bool isGenName)
    atlas = calloc(1, sizeof(*atlas));
    if (atlas) {
       _mesa_HashInsert(ctx->Shared->BitmapAtlas, listBase, atlas, isGenName);
+      atlas->Id = listBase;
    }
 
    return atlas;
@@ -1406,10 +1407,11 @@ _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
  * deleted belongs to a bitmap texture atlas.
  */
 static void
-check_atlas_for_deleted_list(GLuint atlas_id, void *data, void *userData)
+check_atlas_for_deleted_list(UNUSED GLuint key, void *data, void *userData)
 {
    struct gl_bitmap_atlas *atlas = (struct gl_bitmap_atlas *) data;
    GLuint list_id = *((GLuint *) userData);  /* the list being deleted */
+   const GLuint atlas_id = atlas->Id;
 
    /* See if the list_id falls in the range contained in this texture atlas */
    if (atlas->complete &&
index 1ac17d5..234f797 100644 (file)
@@ -56,6 +56,7 @@ struct gl_bitmap_glyph
  */
 struct gl_bitmap_atlas
 {
+   GLint Id;
    bool complete;     /**< Is the atlas ready to use? */
    bool incomplete;   /**< Did we fail to construct this atlas? */