From db24132d801e913b41d0af2ebffaa11e7724d1a4 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Tue, 29 Jan 2019 18:46:11 -0800 Subject: [PATCH] mesa/main: Expose EXT_texture_compression_s3tc_srgb Required for the following test: bin/compressedteximage GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT pass when emulating GL on GLES. Reviewed-by: Erik Faye-Lund --- src/mesa/main/extensions_table.h | 1 + src/mesa/main/glformats.c | 3 ++- src/mesa/main/mtypes.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index f0a37d57559..4ae5ab97fb9 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -285,6 +285,7 @@ EXT(EXT_texture_compression_dxt1 , ANGLE_texture_compression_dxt EXT(EXT_texture_compression_latc , EXT_texture_compression_latc , GLL, x , x , x , 2006) EXT(EXT_texture_compression_rgtc , ARB_texture_compression_rgtc , GLL, GLC, x , 30, 2004) EXT(EXT_texture_compression_s3tc , EXT_texture_compression_s3tc , GLL, GLC, x , ES2, 2000) +EXT(EXT_texture_compression_s3tc_srgb , EXT_texture_compression_s3tc_srgb , x , x, x , ES2, 2016) EXT(EXT_texture_cube_map , ARB_texture_cube_map , GLL, x , x , x , 2001) EXT(EXT_texture_cube_map_array , OES_texture_cube_map_array , x , x , x , 31, 2014) EXT(EXT_texture_edge_clamp , dummy_true , GLL, x , x , x , 1997) diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 3a916009735..ea72cab5b3e 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -1373,7 +1373,8 @@ _mesa_is_compressed_format(const struct gl_context *ctx, GLenum format) if (_mesa_get_format_color_encoding(m_format) == GL_LINEAR) { return _mesa_has_EXT_texture_compression_s3tc(ctx); } else { - return _mesa_has_EXT_texture_sRGB(ctx) && + return (_mesa_has_EXT_texture_sRGB(ctx) || + _mesa_has_EXT_texture_compression_s3tc_srgb(ctx)) && _mesa_has_EXT_texture_compression_s3tc(ctx); } case MESA_FORMAT_LAYOUT_FXT1: diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 794b7b8f73e..dda96cd2f19 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -4270,6 +4270,7 @@ struct gl_extensions GLboolean EXT_texture_array; GLboolean EXT_texture_compression_latc; GLboolean EXT_texture_compression_s3tc; + GLboolean EXT_texture_compression_s3tc_srgb; GLboolean EXT_texture_env_dot3; GLboolean EXT_texture_filter_anisotropic; GLboolean EXT_texture_integer; -- 2.30.2