mesa: remove unused _mesa_total_texture_memory

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38587>
This commit is contained in:
Marek Olšák 2025-11-21 18:28:45 -05:00 committed by Marge Bot
parent 88b6e46ee3
commit 30b5d5f9b3
2 changed files with 0 additions and 61 deletions

View file

@ -1136,64 +1136,6 @@ _mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex, bool is
}
/**
* Compute the size of the given texture object, in bytes.
*/
static GLuint
texture_size(const struct gl_texture_object *texObj)
{
const GLuint numFaces = _mesa_num_tex_faces(texObj->Target);
GLuint face, level, size = 0;
for (face = 0; face < numFaces; face++) {
for (level = 0; level < MAX_TEXTURE_LEVELS; level++) {
const struct gl_texture_image *img = texObj->Image[face][level];
if (img) {
GLuint sz = _mesa_format_image_size(img->TexFormat, img->Width,
img->Height, img->Depth);
size += sz;
}
}
}
return size;
}
/**
* Callback called from _mesa_HashWalk()
*/
static void
count_tex_size(void *data, void *userData)
{
const struct gl_texture_object *texObj =
(const struct gl_texture_object *) data;
GLuint *total = (GLuint *) userData;
*total = *total + texture_size(texObj);
}
/**
* Compute total size (in bytes) of all textures for the given context.
* For debugging purposes.
*/
GLuint
_mesa_total_texture_memory(struct gl_context *ctx)
{
GLuint tgt, total = 0;
_mesa_HashWalk(&ctx->Shared->TexObjects, count_tex_size, &total);
/* plus, the default texture objects */
for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) {
total += texture_size(ctx->Shared->DefaultTex[tgt]);
}
return total;
}
/**
* Return the base format for the given texture object by looking
* at the base texture image.

View file

@ -190,9 +190,6 @@ _mesa_dirty_texobj(struct gl_context *ctx, struct gl_texture_object *texObj);
extern struct gl_texture_object *
_mesa_get_fallback_texture(struct gl_context *ctx, gl_texture_index tex, bool is_depth);
extern GLuint
_mesa_total_texture_memory(struct gl_context *ctx);
extern GLenum
_mesa_texture_base_format(const struct gl_texture_object *texObj);