[Mesa-dev] [PATCH] mesa: remove unused _mesa_init_teximage_fields() target parameter

Ian Romanick idr at freedesktop.org
Tue Jan 3 19:14:20 PST 2012


On 01/03/2012 04:48 PM, Brian Paul wrote:

Reviewed-by: Ian Roamnick <ian.d.romanick at intel.com>

> ---
>   src/mesa/drivers/dri/intel/intel_tex_image.c   |    2 +-
>   src/mesa/drivers/dri/nouveau/nouveau_texture.c |    2 +-
>   src/mesa/drivers/dri/r200/r200_texstate.c      |    2 +-
>   src/mesa/drivers/dri/radeon/radeon_texstate.c  |    2 +-
>   src/mesa/drivers/dri/swrast/swrast.c           |    2 +-
>   src/mesa/main/mipmap.c                         |    2 +-
>   src/mesa/main/teximage.c                       |   13 ++++++-------
>   src/mesa/main/teximage.h                       |    2 +-
>   src/mesa/main/texobj.c                         |    2 +-
>   src/mesa/main/texstorage.c                     |    6 +++---
>   src/mesa/state_tracker/st_cb_eglimage.c        |    2 +-
>   src/mesa/state_tracker/st_cb_texture.c         |    4 ++--
>   src/mesa/state_tracker/st_gen_mipmap.c         |    2 +-
>   src/mesa/state_tracker/st_manager.c            |    2 +-
>   14 files changed, 22 insertions(+), 23 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
> index 32f2e85..1f57435 100644
> --- a/src/mesa/drivers/dri/intel/intel_tex_image.c
> +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
> @@ -291,7 +291,7 @@ intel_set_texture_image_region(struct gl_context *ctx,
>      struct gl_texture_object *texobj = image->TexObject;
>      struct intel_texture_object *intel_texobj = intel_texture_object(texobj);
>
> -   _mesa_init_teximage_fields(&intel->ctx, target, image,
> +   _mesa_init_teximage_fields(&intel->ctx, image,
>   			      region->width, region->height, 1,
>   			      0, internalFormat, format);
>
> diff --git a/src/mesa/drivers/dri/nouveau/nouveau_texture.c b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
> index ae1ea37..b90ab9a 100644
> --- a/src/mesa/drivers/dri/nouveau/nouveau_texture.c
> +++ b/src/mesa/drivers/dri/nouveau/nouveau_texture.c
> @@ -666,7 +666,7 @@ nouveau_set_texbuffer(__DRIcontext *dri_ctx,
>           s->format = get_texbuffer_format(rb, format);
>
>   	/* Update the image fields. */
> -	_mesa_init_teximage_fields(ctx, target, ti, s->width, s->height,
> +	_mesa_init_teximage_fields(ctx, ti, s->width, s->height,
>   				   1, 0, s->cpp, s->format);
>   	nti->base.RowStride = s->pitch / s->cpp;
>
> diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c
> index f2c5b94..4624b08 100644
> --- a/src/mesa/drivers/dri/r200/r200_texstate.c
> +++ b/src/mesa/drivers/dri/r200/r200_texstate.c
> @@ -806,7 +806,7 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_format
>   		break;
>   	}
>
> -	_mesa_init_teximage_fields(radeon->glCtx, target, texImage,
> +	_mesa_init_teximage_fields(radeon->glCtx, texImage,
>   				   rb->base.Width, rb->base.Height, 1, 0,
>   				   rb->cpp, texFormat);
>   	rImage->base.RowStride = rb->pitch / rb->cpp;
> diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c
> index ff9351a..67acb73 100644
> --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c
> +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c
> @@ -680,7 +680,7 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint texture_form
>   		break;
>   	}
>
> -	_mesa_init_teximage_fields(radeon->glCtx, target, texImage,
> +	_mesa_init_teximage_fields(radeon->glCtx, texImage,
>   				   rb->base.Width, rb->base.Height, 1, 0,
>   				   rb->cpp, texFormat);
>   	rImage->base.RowStride = rb->pitch / rb->cpp;
> diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
> index ff74cc5..4f6d016 100644
> --- a/src/mesa/drivers/dri/swrast/swrast.c
> +++ b/src/mesa/drivers/dri/swrast/swrast.c
> @@ -91,7 +91,7 @@ static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
>       else
>   	texFormat = MESA_FORMAT_ARGB8888;
>
> -    _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage,
> +    _mesa_init_teximage_fields(&dri_ctx->Base, texImage,
>   			       w, h, 1, 0, internalFormat, texFormat);
>
>       sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)swImage->Data,
> diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
> index 9a6c6de..867506c 100644
> --- a/src/mesa/main/mipmap.c
> +++ b/src/mesa/main/mipmap.c
> @@ -1860,7 +1860,7 @@ _mesa_prepare_mipmap_level(struct gl_context *ctx,
>            /* need to (re)allocate image */
>            ctx->Driver.FreeTextureImageBuffer(ctx, dstImage);
>
> -         _mesa_init_teximage_fields(ctx, target, dstImage,
> +         _mesa_init_teximage_fields(ctx, dstImage,
>                                       width, height, depth,
>                                       border, intFormat, format);
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index d6275bb..6dd70b9 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1059,7 +1059,6 @@ clear_teximage_fields(struct gl_texture_image *img)
>    * Initialize basic fields of the gl_texture_image struct.
>    *
>    * \param ctx GL context.
> - * \param target texture target (GL_TEXTURE_1D, GL_TEXTURE_RECTANGLE, etc).
>    * \param img texture image structure to be initialized.
>    * \param width image width.
>    * \param height image height.
> @@ -1072,7 +1071,7 @@ clear_teximage_fields(struct gl_texture_image *img)
>    * Note: width, height and depth include the border.
>    */
>   void
> -_mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
> +_mesa_init_teximage_fields(struct gl_context *ctx,
>                              struct gl_texture_image *img,
>                              GLsizei width, GLsizei height, GLsizei depth,
>                              GLint border, GLenum internalFormat,
> @@ -2422,7 +2421,7 @@ teximage(struct gl_context *ctx, GLuint dims,
>                                                              format, type);
>
>            if (legal_texture_size(ctx, texFormat, width, height, depth)) {
> -            _mesa_init_teximage_fields(ctx, target, texImage, width, height,
> +            _mesa_init_teximage_fields(ctx, texImage, width, height,
>                                          depth, border, internalFormat,
>                                          texFormat);
>            }
> @@ -2473,7 +2472,7 @@ teximage(struct gl_context *ctx, GLuint dims,
>                                                       type);
>
>               if (legal_texture_size(ctx, texFormat, width, height, depth)) {
> -               _mesa_init_teximage_fields(ctx, target, texImage,
> +               _mesa_init_teximage_fields(ctx, texImage,
>                                             width, height, depth,
>                                             border, internalFormat, texFormat);
>
> @@ -2812,7 +2811,7 @@ copyteximage(struct gl_context *ctx, GLuint dims,
>               /* Free old texture image */
>               ctx->Driver.FreeTextureImageBuffer(ctx, texImage);
>
> -            _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1,
> +            _mesa_init_teximage_fields(ctx, texImage, width, height, 1,
>                                          border, internalFormat, texFormat);
>
>               /* Allocate texture memory (no pixel data yet) */
> @@ -3404,7 +3403,7 @@ compressedteximage(struct gl_context *ctx, GLuint dims,
>            }
>            else {
>               /* no error: store the teximage parameters */
> -            _mesa_init_teximage_fields(ctx, target, texImage, width, height,
> +            _mesa_init_teximage_fields(ctx, texImage, width, height,
>                                          depth, border, internalFormat,
>                                          MESA_FORMAT_NONE);
>            }
> @@ -3439,7 +3438,7 @@ compressedteximage(struct gl_context *ctx, GLuint dims,
>                                                       GL_NONE);
>
>               if (legal_texture_size(ctx, texFormat, width, height, depth)) {
> -               _mesa_init_teximage_fields(ctx, target, texImage,
> +               _mesa_init_teximage_fields(ctx, texImage,
>                                             width, height, depth,
>                                             border, internalFormat, texFormat);
>
> diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
> index 0354c9a..12af0e6 100644
> --- a/src/mesa/main/teximage.h
> +++ b/src/mesa/main/teximage.h
> @@ -67,7 +67,7 @@ _mesa_delete_texture_image( struct gl_context *ctx,
>
>
>   extern void
> -_mesa_init_teximage_fields(struct gl_context *ctx, GLenum target,
> +_mesa_init_teximage_fields(struct gl_context *ctx,
>                              struct gl_texture_image *img,
>                              GLsizei width, GLsizei height, GLsizei depth,
>                              GLint border, GLenum internalFormat,
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index 425cb5d..7ee2005 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -793,7 +793,7 @@ _mesa_get_fallback_texture(struct gl_context *ctx)
>                                                     GL_UNSIGNED_BYTE);
>
>         /* init the image fields */
> -      _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage,
> +      _mesa_init_teximage_fields(ctx, texImage,
>                                    8, 8, 1, 0, GL_RGBA, texFormat);
>
>         ASSERT(texImage->TexFormat != MESA_FORMAT_NONE);
> diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
> index 241a940..5e1f31a 100644
> --- a/src/mesa/main/texstorage.c
> +++ b/src/mesa/main/texstorage.c
> @@ -155,7 +155,7 @@ setup_texstorage(struct gl_context *ctx,
>               return;
>   	 }
>
> -         _mesa_init_teximage_fields(ctx, target, texImage,
> +         _mesa_init_teximage_fields(ctx, texImage,
>                                       levelWidth, levelHeight, levelDepth,
>                                       0, internalFormat, texFormat);
>         }
> @@ -180,7 +180,7 @@ setup_texstorage(struct gl_context *ctx,
>               for (face = 0; face<  numFaces; face++) {
>                  struct gl_texture_image *texImage = texObj->Image[face][level];
>                  if (texImage) {
> -                  _mesa_init_teximage_fields(ctx, target, texImage,
> +                  _mesa_init_teximage_fields(ctx, texImage,
>                                                0, 0, 0, 0,
>                                                GL_NONE, MESA_FORMAT_NONE);
>                  }
> @@ -223,7 +223,7 @@ clear_image_fields(struct gl_context *ctx,
>               return;
>   	 }
>
> -         _mesa_init_teximage_fields(ctx, target, texImage,
> +         _mesa_init_teximage_fields(ctx, texImage,
>                                       0, 0, 0, 0, GL_NONE, MESA_FORMAT_NONE);
>         }
>      }
> diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c
> index 37c20eb..5209fc7 100644
> --- a/src/mesa/state_tracker/st_cb_eglimage.c
> +++ b/src/mesa/state_tracker/st_cb_eglimage.c
> @@ -125,7 +125,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
>
>      texFormat = st_pipe_format_to_mesa_format(ps->format);
>
> -   _mesa_init_teximage_fields(ctx, target, texImage,
> +   _mesa_init_teximage_fields(ctx, texImage,
>                                 ps->width, ps->height, 1, 0, internalFormat,
>                                 texFormat);
>
> diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
> index e60c309..e9148df 100644
> --- a/src/mesa/state_tracker/st_cb_texture.c
> +++ b/src/mesa/state_tracker/st_cb_texture.c
> @@ -533,7 +533,7 @@ st_TexImage(struct gl_context * ctx,
>         texFormat = _mesa_choose_texture_format(ctx, texObj, target, level,
>                                                 internalFormat, format, type);
>
> -      _mesa_init_teximage_fields(ctx, target, texImage,
> +      _mesa_init_teximage_fields(ctx, texImage,
>                                    width, height, depth, border,
>                                    internalFormat, texFormat);
>
> @@ -1625,7 +1625,7 @@ st_get_default_texture(struct st_context *st)
>
>         texImg = _mesa_get_tex_image(st->ctx, texObj, target, 0);
>
> -      _mesa_init_teximage_fields(st->ctx, target, texImg,
> +      _mesa_init_teximage_fields(st->ctx, texImg,
>                                    16, 16, 1, 0,  /* w, h, d, border */
>                                    GL_RGBA, MESA_FORMAT_RGBA8888);
>
> diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
> index 36fea3d..d817a9c 100644
> --- a/src/mesa/state_tracker/st_gen_mipmap.c
> +++ b/src/mesa/state_tracker/st_gen_mipmap.c
> @@ -244,7 +244,7 @@ st_generate_mipmap(struct gl_context *ctx, GLenum target,
>         ctx->Driver.FreeTextureImageBuffer(ctx, dstImage);
>
>         /* initialize new image */
> -      _mesa_init_teximage_fields(ctx, target, dstImage, dstWidth, dstHeight,
> +      _mesa_init_teximage_fields(ctx, dstImage, dstWidth, dstHeight,
>                                    dstDepth, border, srcImage->InternalFormat,
>                                    srcImage->TexFormat);
>
> diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
> index 1cee312..c0af3ce 100644
> --- a/src/mesa/state_tracker/st_manager.c
> +++ b/src/mesa/state_tracker/st_manager.c
> @@ -535,7 +535,7 @@ st_context_teximage(struct st_context_iface *stctxi,
>         texFormat = st_ChooseTextureFormat(ctx, internalFormat,
>                                            GL_BGRA, GL_UNSIGNED_BYTE);
>
> -      _mesa_init_teximage_fields(ctx, target, texImage,
> +      _mesa_init_teximage_fields(ctx, texImage,
>                                    tex->width0, tex->height0, 1, 0,
>                                    internalFormat, texFormat);
>



More information about the mesa-dev mailing list