[Mesa-dev] [PATCH 2/3] mesa: Like EXT_texture_compression_dxt1, advertise ANGLE_texture_compression_dxt in all APIs

Eric Anholt eric at anholt.net
Mon Jan 21 11:42:26 PST 2013


Ian Romanick <idr at freedesktop.org> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> This is technically outside the ANGLE spec, but it seems unlikely to
> cause any harm.

Seems like there's some cleanup available if one asserts that the ANGLE
extension is present if the old EXT S3TC extension is present.

> +   if (_mesa_is_desktop_gl(ctx) && ctx->Extensions.EXT_texture_compression_s3tc
> +       || ctx->Extensions.ANGLE_texture_compression_dxt) {

I think this is going to throw a "warning: suggest parentheses around
‘&&’ within ‘||’ [-Wparentheses)"

>        switch (internalFormat) {
>           case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
>  	    RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_DXT1);
> @@ -608,21 +607,20 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
>  	    RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
>              break;
>           case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
> -            if (ctx->Extensions.EXT_texture_compression_s3tc)
> +            if (ctx->Extensions.EXT_texture_compression_s3tc ||
> +                ctx->Extensions.ANGLE_texture_compression_dxt)

I'm pretty sure these extension checks in this function should all die,
actually.  We've already validated the internalformat, right?  If not,
then it's odd to me that this and the following 2 extension checks
differ from the one above (missing _mesa_is_desktop_gl() check for
accepting EXT_t_c_s3tc).

>  	       RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT1);
>  	    RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
>              break;
>           case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
>              if (ctx->Extensions.EXT_texture_compression_s3tc ||
> -		(ctx->API == API_OPENGLES2 &&
> -		 ctx->Extensions.ANGLE_texture_compression_dxt))
> +                ctx->Extensions.ANGLE_texture_compression_dxt)
>  	       RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT3);
>  	    RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
>              break;
>           case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:
>              if (ctx->Extensions.EXT_texture_compression_s3tc ||
> -		(ctx->API == API_OPENGLES2 &&
> -		 ctx->Extensions.ANGLE_texture_compression_dxt))
> +                ctx->Extensions.ANGLE_texture_compression_dxt)
>  	       RETURN_IF_SUPPORTED(MESA_FORMAT_SRGBA_DXT5);
>  	    RETURN_IF_SUPPORTED(MESA_FORMAT_SARGB8);
>              break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130121/292e4629/attachment-0001.pgp>


More information about the mesa-dev mailing list