summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2018-11-15 16:15:41 +0100
committerErik Faye-Lund <[email protected]>2018-12-03 18:16:44 +0100
commit27ca87cccaf32a2abea002d924933135daaf664c (patch)
tree1f7a2b11169fd4e2543f03b99027fff0bcce9830
parentd70cfb322a0fa0893e0d56e5a9441b96e8a474b7 (diff)
mesa/main: do not allow s3tc enums on gles1
There's no extension enabling S3TC formats on OpenGL ES 1.x, so we shouldn't allow these even if the driver can support it. So let's check for EXT_texture_compression_s3tc instead of ANGLE_texture_compression_dxt, which is supported on all other OpenGL variations. We also need to use _mesa_has_EXT_texture_compression_s3tc() instead of checking the driver cap directly, otherwise we end up enabling this on OpenGL ES 1.x, as the API isn't checked. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/mesa/main/glformats.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 8fbc9a3b0ba..0d782ce8bc7 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -1371,10 +1371,7 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format)
switch (_mesa_get_format_layout(m_format)) {
case MESA_FORMAT_LAYOUT_S3TC:
if (_mesa_get_format_color_encoding(m_format) == GL_LINEAR) {
- /* Assume that the ANGLE flag will always be set if the
- * EXT flag is set.
- */
- return ctx->Extensions.ANGLE_texture_compression_dxt;
+ return _mesa_has_EXT_texture_compression_s3tc(ctx);
} else {
return _mesa_has_EXT_texture_sRGB(ctx) &&
_mesa_has_EXT_texture_compression_s3tc(ctx);
@@ -2802,7 +2799,7 @@ _mesa_gles_error_check_format_and_type(const struct gl_context *ctx,
/* The GLES variant of EXT_texture_compression_s3tc is very vague and
* doesn't list valid types. Just do exactly what the spec says.
*/
- if (ctx->Extensions.EXT_texture_compression_s3tc &&
+ if (_mesa_has_EXT_texture_compression_s3tc(ctx) &&
(internalFormat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
internalFormat == GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||