[Piglit] [PATCH] piglit-util-gl-common: fix ES1 / ES2 build error

Brian Paul brian.e.paul at gmail.com
Mon Oct 8 18:23:04 PDT 2012


On Mon, Oct 8, 2012 at 6:17 PM, Jordan Justen <jordan.l.justen at intel.com> wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> Cc: Brian Paul <brianp at vmware.com>
> Cc: Chad Versace <chad.versace at linux.intel.com>
> ---
>  tests/util/piglit-util-gl-common.c |    7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
> index 62b5312..4f9fe5f 100644
> --- a/tests/util/piglit-util-gl-common.c
> +++ b/tests/util/piglit-util-gl-common.c
> @@ -447,8 +447,14 @@ piglit_get_compressed_block_size(GLenum format,
>                                  unsigned *bw, unsigned *bh, unsigned *bytes)
>  {
>         switch (format) {
> +#if defined(USE_OPENGL) || defined(USE_OPENGL_ES2)
>         case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
>         case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
> +               *bw = *bh = 4;
> +               *bytes = 8;
> +               return true;
> +#endif
> +#if defined(USE_OPENGL)
>         case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
>         case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
>         case GL_COMPRESSED_RED_RGTC1:
> @@ -475,6 +481,7 @@ piglit_get_compressed_block_size(GLenum format,
>                 *bh = 4;
>                 *bytes = 16;
>                 return true;
> +#endif
>         default:
>                 /* return something rather than uninitialized values */
>                 *bw = *bh = *bytes = 1;

Actually, it would probably be better to test the extension #define,
such as GL_EXT_texture_compression_s3tc because off-hand I don't know
which compressed formats are supported by which APIs.

-Brian


More information about the Piglit mailing list