[Mesa-dev] [PATCH 1/3] mesa: Silence unused parameter warning in compressedteximage_only_format

Jordan Justen jordan.l.justen at intel.com
Wed Feb 28 01:53:08 UTC 2018


Series Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

On 2018-02-27 17:06:59, Ian Romanick wrote:
> From: Ian Romanick <ian.d.romanick at intel.com>
> 
> Passing ctx to compressedteximage_only_format was the only use of the
> ctx parameter in _mesa_format_no_online_compression, so that parameter
> had to go too.
> 
> ../../SOURCE/master/src/mesa/main/teximage.c: In function ‘compressedteximage_only_format’:
> ../../SOURCE/master/src/mesa/main/teximage.c:1355:57: warning: unused parameter ‘ctx’ [-Wunused-parameter]
>  compressedteximage_only_format(const struct gl_context *ctx, GLenum format)
>                                                          ^~~
> 
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  src/mesa/main/formatquery.c |  2 +-
>  src/mesa/main/teximage.c    | 16 ++++++++--------
>  src/mesa/main/teximage.h    |  2 +-
>  3 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
> index 834f111..3b000fa 100644
> --- a/src/mesa/main/formatquery.c
> +++ b/src/mesa/main/formatquery.c
> @@ -502,7 +502,7 @@ _is_resource_supported(struct gl_context *ctx, GLenum target,
>        /* additional checks for compressed textures */
>        if (_mesa_is_compressed_format(ctx, internalformat) &&
>            (!_mesa_target_can_be_compressed(ctx, target, internalformat, NULL) ||
> -           _mesa_format_no_online_compression(ctx, internalformat)))
> +           _mesa_format_no_online_compression(internalformat)))
>           return false;
>  
>        break;
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 928e50d..fbca7a7 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1352,7 +1352,7 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target,
>   * Return true if the format is only valid for glCompressedTexImage.
>   */
>  static bool
> -compressedteximage_only_format(const struct gl_context *ctx, GLenum format)
> +compressedteximage_only_format(GLenum format)
>  {
>     switch (format) {
>     case GL_PALETTE4_RGB8_OES:
> @@ -1375,11 +1375,11 @@ compressedteximage_only_format(const struct gl_context *ctx, GLenum format)
>   * Return true if the format doesn't support online compression.
>   */
>  bool
> -_mesa_format_no_online_compression(const struct gl_context *ctx, GLenum format)
> +_mesa_format_no_online_compression(GLenum format)
>  {
>     return _mesa_is_astc_format(format) ||
>            _mesa_is_etc2_format(format) ||
> -          compressedteximage_only_format(ctx, format);
> +          compressedteximage_only_format(format);
>  }
>  
>  /* Writes to an GL error pointer if non-null and returns whether or not the
> @@ -1979,7 +1979,7 @@ texture_error_check( struct gl_context *ctx,
>                       "glTexImage%dD(target can't be compressed)", dimensions);
>           return GL_TRUE;
>        }
> -      if (_mesa_format_no_online_compression(ctx, internalFormat)) {
> +      if (_mesa_format_no_online_compression(internalFormat)) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                       "glTexImage%dD(no compression for format)", dimensions);
>           return GL_TRUE;
> @@ -2252,7 +2252,7 @@ texsubimage_error_check(struct gl_context *ctx, GLuint dimensions,
>     }
>  
>     if (_mesa_is_format_compressed(texImage->TexFormat)) {
> -      if (_mesa_format_no_online_compression(ctx, texImage->InternalFormat)) {
> +      if (_mesa_format_no_online_compression(texImage->InternalFormat)) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                 "%s(no compression for format)", callerName);
>           return GL_TRUE;
> @@ -2529,7 +2529,7 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
>                       "glCopyTexImage%dD(target can't be compressed)", dimensions);
>           return GL_TRUE;
>        }
> -      if (_mesa_format_no_online_compression(ctx, internalFormat)) {
> +      if (_mesa_format_no_online_compression(internalFormat)) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                 "glCopyTexImage%dD(no compression for format)", dimensions);
>           return GL_TRUE;
> @@ -2611,7 +2611,7 @@ copytexsubimage_error_check(struct gl_context *ctx, GLuint dimensions,
>     }
>  
>     if (_mesa_is_format_compressed(texImage->TexFormat)) {
> -      if (_mesa_format_no_online_compression(ctx, texImage->InternalFormat)) {
> +      if (_mesa_format_no_online_compression(texImage->InternalFormat)) {
>           _mesa_error(ctx, GL_INVALID_OPERATION,
>                 "%s(no compression for format)", caller);
>           return GL_TRUE;
> @@ -4833,7 +4833,7 @@ compressed_subtexture_error_check(struct gl_context *ctx, GLint dims,
>        return GL_TRUE;
>     }
>  
> -   if (compressedteximage_only_format(ctx, format)) {
> +   if (compressedteximage_only_format(format)) {
>        _mesa_error(ctx, GL_INVALID_OPERATION, "%s(format=%s cannot be updated)",
>                    callerName, _mesa_enum_to_string(format));
>        return GL_TRUE;
> diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
> index 2e950bf..fbc69df 100644
> --- a/src/mesa/main/teximage.h
> +++ b/src/mesa/main/teximage.h
> @@ -213,7 +213,7 @@ _mesa_legal_texture_base_format_for_target(struct gl_context *ctx,
>                                             GLenum internalFormat);
>  
>  bool
> -_mesa_format_no_online_compression(const struct gl_context *ctx, GLenum format);
> +_mesa_format_no_online_compression(GLenum format);
>  
>  GLboolean
>  _mesa_is_renderable_texture_format(const struct gl_context *ctx,
> -- 
> 2.9.5
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list