mesa: Store the atlas Id in the gl_bitmap_atlas structure

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>
This commit is contained in:
Ian Romanick 2020-10-12 16:45:45 -07:00 committed by Marge Bot
parent 0e17bb509e
commit f71488d1d1
2 changed files with 4 additions and 1 deletions

View 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 &&

View 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? */