From 4fba07f74ea2cfc67889936593bf8b86d1597241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 21 Nov 2025 19:07:39 -0500 Subject: [PATCH] mesa: remove unused mesa_store_cleartexsubimage, _mesa_store_compressed_teximage Reviewed-by: Pierre-Eric Pelloux-Prayer Reviewed-by: Qiang Yu Part-of: --- src/mesa/main/texstore.c | 79 ---------------------------------------- src/mesa/main/texstore.h | 14 ------- 2 files changed, 93 deletions(-) diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index d2f2d93579d..d4a6f447363 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1152,85 +1152,6 @@ clear_image_to_value(GLubyte *dstMap, GLint dstRowStride, } } -/* - * Fallback for Driver.ClearTexSubImage(). - */ -void -_mesa_store_cleartexsubimage(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - const GLvoid *clearValue) -{ - GLubyte *dstMap; - GLint dstRowStride; - GLsizeiptr clearValueSize; - GLsizei z; - - clearValueSize = _mesa_get_format_bytes(texImage->TexFormat); - - for (z = 0; z < depth; z++) { - st_MapTextureImage(ctx, texImage, - z + zoffset, xoffset, yoffset, - width, height, - GL_MAP_WRITE_BIT, - &dstMap, &dstRowStride); - if (dstMap == NULL) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glClearTex*Image"); - return; - } - - if (clearValue) { - clear_image_to_value(dstMap, dstRowStride, - width, height, - clearValue, - clearValueSize); - } else { - clear_image_to_zero(dstMap, dstRowStride, - width, height, - clearValueSize); - } - - st_UnmapTextureImage(ctx, texImage, z + zoffset); - } -} - -/** - * Fallback for Driver.CompressedTexImage() - */ -void -_mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims, - struct gl_texture_image *texImage, - GLsizei imageSize, const GLvoid *data) -{ - /* only 2D and 3D compressed images are supported at this time */ - if (dims == 1) { - _mesa_problem(ctx, "Unexpected glCompressedTexImage1D call"); - return; - } - - /* This is pretty simple, because unlike the general texstore path we don't - * have to worry about the usual image unpacking or image transfer - * operations. - */ - assert(texImage); - assert(texImage->Width > 0); - assert(texImage->Height > 0); - assert(texImage->Depth > 0); - - /* allocate storage for texture data */ - if (!st_AllocTextureImageBuffer(ctx, texImage)) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage%uD", dims); - return; - } - - st_CompressedTexSubImage(ctx, dims, texImage, - 0, 0, 0, - texImage->Width, texImage->Height, texImage->Depth, - texImage->TexFormat, - imageSize, data); -} - /** * Compute compressed_pixelstore parameters for copying compressed diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 889eb2a5442..7b5941adb90 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -118,20 +118,6 @@ _mesa_store_texsubimage(struct gl_context *ctx, GLuint dims, GLenum format, GLenum type, const GLvoid *pixels, const struct gl_pixelstore_attrib *packing); - -extern void -_mesa_store_cleartexsubimage(struct gl_context *ctx, - struct gl_texture_image *texImage, - GLint xoffset, GLint yoffset, GLint zoffset, - GLsizei width, GLsizei height, GLsizei depth, - const GLvoid *clearValue); - -extern void -_mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims, - struct gl_texture_image *texImage, - GLsizei imageSize, const GLvoid *data); - - extern void _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims, struct gl_texture_image *texImage,