Ian Romanick <i...@freedesktop.org> writes: > From: Ian Romanick <ian.d.roman...@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;
pgpdsdJ0WXkwQ.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev