[Mesa-dev] [PATCH 6/6] mesa: fix NUM_COMPRESSED_TEXTURE_FORMATS query

Ian Romanick idr at freedesktop.org
Thu Oct 31 18:19:20 CET 2013


On 10/31/2013 08:42 AM, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> Cc: mesa-stable at lists.freedesktop.org

This is not correct.  GL_COMPRESSED_TEXTURE_FORMATS is only supposed to
return texture formats "suitable for general-purpose usage."  Since
GL_COMPRESSED_RGBA_S3TC_DXT1_EXT only has 1 bit for alpha, it's not
suitable for general-purpose usage.  As far as I'm aware, nobody else
returns that format either... and I think we have a piglit test.

I just noticed that the most recent version of the spec adds it to the
state tables.  I'll file a spec bug.

> ---
>  src/mesa/main/texcompress.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
> index e71d0c4..7393d3f 100644
> --- a/src/mesa/main/texcompress.c
> +++ b/src/mesa/main/texcompress.c
> @@ -257,11 +257,12 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
>     if (ctx->Extensions.EXT_texture_compression_s3tc) {
>        if (formats) {
>           formats[n++] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT;
> +         formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT;
>           formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT3_EXT;
>           formats[n++] = GL_COMPRESSED_RGBA_S3TC_DXT5_EXT;
>        }
>        else {
> -         n += 3;
> +         n += 4;
>        }
>     }
>  
> 



More information about the mesa-dev mailing list