[Mesa-dev] [PATCH 2/5] mesa: Don't assert on the compressed convertformat for GenerateMipmaps.

Ian Romanick idr at freedesktop.org
Wed Apr 20 16:20:20 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/20/2011 11:08 AM, Eric Anholt wrote:
> This assertion doesn't make any sense to me -- the convertFormat is
> already something valid (tested above), and the BaseFormat dictated by
> convertFormat doesn't matter to the function about to be called (it's
> the datatype/comps that were pulled out of convertFormat).

This is because, without the 2-channel formats, all of the compressed
formats were either GL_RGB or GL_RGBA.  The data that convertFormat
describes in this case is the new mipmap created from the (decompressed)
compressed base level.  The assertion was intended to catch cases that
would have caused errors in the call to _mesa_texstore (maybe?).

There are still a limited set of internal formats that can be
compressed.  I feel like the assertion should be moved out of the
if-statement, and it should be changed to 'assert(srcImage->TexFormat ==
dstImage->TexFormat);'

> Fixes assertion failure in
> GL_EXT_texture_compression_rgtc/fbo-generatemipmap-formats
> 
> (still has a rendering failure in NPOT like S3TC does).
> ---
>  src/mesa/main/mipmap.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c
> index e594160..75bc9a0 100644
> --- a/src/mesa/main/mipmap.c
> +++ b/src/mesa/main/mipmap.c
> @@ -1896,7 +1896,6 @@ _mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
>           const GLenum srcFormat = _mesa_get_format_base_format(convertFormat);
>           GLint dstRowStride
>              = _mesa_format_row_stride(dstImage->TexFormat, dstWidth);
> -         ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA);
>  
>           _mesa_texstore(ctx, 2, dstImage->_BaseFormat,
>                          dstImage->TexFormat,

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk2vajQACgkQX1gOwKyEAw8kKwCeIIZT318Xw0G9lmfeFmqyy4CH
yucAnj5F8S1J24ne/d7fGbQHT7z71aI0
=ABit
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list