[Piglit] [PATCH] util: Silence GCC unused-function warning.

Ian Romanick idr at freedesktop.org
Tue Jun 5 23:51:49 UTC 2018


On 06/05/2018 03:41 PM, Vinson Lee wrote:
> piglit-util-gl.c:1941:1: warning: ‘read_texture_via_fbo’ defined but not used [-Wunused-function]
>  read_texture_via_fbo(int target, int level, int x, int y, int layer, int w,
>  ^~~~~~~~~~~~~~~~~~~~
> 
> Fixes: 77a4b73436c0 ("util: provide way to read a texture in ES compatible way")
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/util/piglit-util-gl.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
> index 9b0f88a3697e..11e7d4b1da4d 100644
> --- a/tests/util/piglit-util-gl.c
> +++ b/tests/util/piglit-util-gl.c
> @@ -1894,6 +1894,7 @@ piglit_probe_image_ubyte(int x, int y, int w, int h, GLenum format,
>  	return 1;
>  }
>  
> +#ifndef PIGLIT_USE_OPENGL

Isn't there a PIGLIT_USE_OPENGLES2 flag or similar that we could use?
I'm not sure how this change (or 77a4b73436c0) interacts with building
GLES 1.x tests... if at all.

>  static GLuint
>  create_fbo_from_texture(GLenum target, GLint texture, GLint level, GLint layer)
>  {
> @@ -1995,6 +1996,7 @@ read_texture_via_fbo(int target, int level, int x, int y, int layer, int w,
>  
>  	return buffer;
>  }
> +#endif
>  
>  
>  /**
> 


More information about the Piglit mailing list