Mesa (master): intel: Silence "warning: =?UTF-8?Q?=20unused=20parameter=20=E2=80=98?==?UTF-8?Q?target=E2=80=99?="

Ian Romanick idr at kemper.freedesktop.org
Fri Sep 9 19:20:29 UTC 2011


Module: Mesa
Branch: master
Commit: bd817215c893cda4f23cb0ad207478ad3935e65c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bd817215c893cda4f23cb0ad207478ad3935e65c

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Fri Aug 26 10:03:26 2011 -0700

intel: Silence "warning: unused parameter ‘target’"

The GLenum target parameter was not used in intel_copy_texsubimage, so
remove it.  Also remove the GLenum internalFormat parameter.  Each
caller just copied this out of the intel_texture_image that is already
passed to intel_copy_texsubimage.

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/intel/intel_fbo.c      |    4 +---
 src/mesa/drivers/dri/intel/intel_tex.h      |    2 --
 src/mesa/drivers/dri/intel/intel_tex_copy.c |   12 ++++--------
 3 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index bd35ac5..6c55fdc 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -903,11 +903,9 @@ intel_blit_framebuffer_copy_tex_sub_image(struct gl_context *ctx,
 
          struct gl_texture_image *texImage =
             _mesa_select_tex_image(ctx, texObj, target, dstLevel);
-         GLenum internalFormat = texImage->InternalFormat;
 
-         if (intel_copy_texsubimage(intel_context(ctx), target,
+         if (intel_copy_texsubimage(intel_context(ctx),
                                     intel_texture_image(texImage),
-                                    internalFormat,
                                     dstX0, dstY0,
                                     srcX0, srcY0,
                                     srcX1 - srcX0, /* width */
diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h
index 1eaa3cc..895c634 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.h
+++ b/src/mesa/drivers/dri/intel/intel_tex.h
@@ -72,9 +72,7 @@ void intel_tex_image_s8z24_gather(struct intel_context *intel,
 int intel_compressed_num_bytes(GLuint mesaFormat);
 
 GLboolean intel_copy_texsubimage(struct intel_context *intel,
-                                 GLenum target,
                                  struct intel_texture_image *intelImage,
-                                 GLenum internalFormat,
                                  GLint dstx, GLint dsty,
                                  GLint x, GLint y,
                                  GLsizei width, GLsizei height);
diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c
index 600bd12..a2ae2db 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c
@@ -65,14 +65,13 @@ get_teximage_readbuffer(struct intel_context *intel, GLenum internalFormat)
 
 GLboolean
 intel_copy_texsubimage(struct intel_context *intel,
-                       GLenum target,
                        struct intel_texture_image *intelImage,
-                       GLenum internalFormat,
                        GLint dstx, GLint dsty,
                        GLint x, GLint y, GLsizei width, GLsizei height)
 {
    struct gl_context *ctx = &intel->ctx;
    struct intel_renderbuffer *irb;
+   const GLenum internalFormat = intelImage->base.InternalFormat;
    bool copy_supported = false;
    bool copy_supported_with_alpha_override = false;
 
@@ -172,16 +171,15 @@ intelCopyTexSubImage1D(struct gl_context * ctx, GLenum target, GLint level,
       _mesa_select_tex_object(ctx, texUnit, target);
    struct gl_texture_image *texImage =
       _mesa_select_tex_image(ctx, texObj, target, level);
-   GLenum internalFormat = texImage->InternalFormat;
 
    /* XXX need to check <border> as in above function? */
 
    /* Need to check texture is compatible with source format. 
     */
 
-   if (!intel_copy_texsubimage(intel_context(ctx), target,
+   if (!intel_copy_texsubimage(intel_context(ctx),
                                intel_texture_image(texImage),
-                               internalFormat, xoffset, 0, x, y, width, 1)) {
+                               xoffset, 0, x, y, width, 1)) {
       fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
       _mesa_meta_CopyTexSubImage1D(ctx, target, level, xoffset, x, y, width);
    }
@@ -198,14 +196,12 @@ intelCopyTexSubImage2D(struct gl_context * ctx, GLenum target, GLint level,
       _mesa_select_tex_object(ctx, texUnit, target);
    struct gl_texture_image *texImage =
       _mesa_select_tex_image(ctx, texObj, target, level);
-   GLenum internalFormat = texImage->InternalFormat;
 
    /* Need to check texture is compatible with source format. 
     */
 
-   if (!intel_copy_texsubimage(intel_context(ctx), target,
+   if (!intel_copy_texsubimage(intel_context(ctx),
                                intel_texture_image(texImage),
-                               internalFormat,
                                xoffset, yoffset, x, y, width, height)) {
       fallback_debug("%s - fallback to swrast\n", __FUNCTION__);
       _mesa_meta_CopyTexSubImage2D(ctx, target, level,




More information about the mesa-commit mailing list