<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Nov 30, 2018 at 5:57 PM Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/30/2018 02:17 PM, Marek Olšák wrote:<br>
> <br>
> <br>
> On Fri, Nov 23, 2018 at 5:54 AM Erik Faye-Lund<br>
> <<a href="mailto:erik.faye-lund@collabora.com" target="_blank">erik.faye-lund@collabora.com</a> <mailto:<a href="mailto:erik.faye-lund@collabora.com" target="_blank">erik.faye-lund@collabora.com</a>>> wrote:<br>
> <br>
>     S3_s3tc is the extension that enables this functionality on desktop, so<br>
>     let's check for that one. The _mesa_has_S3_s3tc() helper already<br>
>     verifies the API according to the extension-table.<br>
> <br>
>     Signed-off-by: Erik Faye-Lund <<a href="mailto:erik.faye-lund@collabora.com" target="_blank">erik.faye-lund@collabora.com</a><br>
>     <mailto:<a href="mailto:erik.faye-lund@collabora.com" target="_blank">erik.faye-lund@collabora.com</a>>><br>
>     ---<br>
>      src/mesa/main/glformats.c | 8 +++-----<br>
>      1 file changed, 3 insertions(+), 5 deletions(-)<br>
> <br>
>     diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c<br>
>     index 9a507d11b96..b2c18aa6d94 100644<br>
>     --- a/src/mesa/main/glformats.c<br>
>     +++ b/src/mesa/main/glformats.c<br>
>     @@ -1352,8 +1352,7 @@ _mesa_is_compressed_format(const struct<br>
>     gl_context *ctx, GLenum format)<br>
>         case GL_RGB4_S3TC:<br>
>         case GL_RGBA_S3TC:<br>
>         case GL_RGBA4_S3TC:<br>
>     -      return _mesa_is_desktop_gl(ctx) &&<br>
>     -         ctx->Extensions.ANGLE_texture_compression_dxt;<br>
>     +      return _mesa_has_S3_s3tc(ctx);<br>
>         case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:<br>
>            return ctx->API == API_OPENGL_COMPAT<br>
>               && ctx->Extensions.ATI_texture_compression_3dc;<br>
>     @@ -1378,9 +1377,8 @@ _mesa_is_compressed_format(const struct<br>
>     gl_context *ctx, GLenum format)<br>
>                */<br>
>               return ctx->Extensions.ANGLE_texture_compression_dxt;<br>
>            } else {<br>
>     -         return _mesa_is_desktop_gl(ctx)<br>
>     -            && ctx->Extensions.EXT_texture_sRGB<br>
>     -            && ctx->Extensions.EXT_texture_compression_s3tc;<br>
>     +         return _mesa_has_EXT_texture_sRGB(ctx) &&<br>
>     +            _mesa_has_S3_s3tc(ctx);<br>
> <br>
> This looks like it should be _mesa_has_EXT_texture_compression_s3tc.<br>
<br>
I haven't looked at the code to verify, but I think<br>
_mesa_has_EXT_texture_compression_s3tc can be true in OpenGL ES, but<br>
_mesa_has_S3_s3tc cannot.  The original code has _mesa_is_desktop_gl, so<br>
we don't want to allow ES.  But I also thought _mesa_has_S3_s3tc wasn't<br>
allowed in core profile, so that might not be right either?<br></blockquote><div><br></div><div>They are all allowed by core & compat. EXT_texture_sRGB is only available in desktop GL, so any s3tc extension should work, but EXT_texture_sRGB defines interactions with EXT_texture_compression_s3tc, not S3_s3tc.</div><div><br></div><div>Marek<br></div></div></div>