<div dir="ltr"><div>Reviewed-by: Marek Olšák <<a href="mailto:marek.olsak@amd.com">marek.olsak@amd.com</a>><br><br></div>Marek<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 6, 2018 at 5:40 AM, Alejandro Piñeiro <span dir="ltr"><<a href="mailto:apinheiro@igalia.com" target="_blank">apinheiro@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">is_resource_supported returns if the combination of<br>
target/internalformat is supported in at least one operation. Online<br>
compression is only mandatory for glTexImage2D. Some formats doesn't<br>
support online compression, but can be used in any case, with<br>
glCompressed*D methods.<br>
<br>
Without this commit, ETC2 internalformats were returning FALSE, even<br>
for the drivers supporting it. So any other query (like<br>
TEXTURE_COMPRESSED) was returning FALSE/NONE instead of the proper<br>
value.<br>
---<br>
<br>
This was not detected until now because most of the formats that<br>
doesn't support online compression were added with<br>
GL_ARB_ES3_compatibility, that was not core until 4.3. The base for<br>
GL_ARB_internalformat_query2 is 4.2, and the piglit tests were based<br>
on it.<br>
<br>
When we tried to test those formats on piglit (I'm sending a series<br>
soon) we found that they were found as not supported, even if they can<br>
be used with CompressedTexture*D.<br>
<br>
Note to Eleni: all this was mentioned on a review of some of your<br>
patches, specifically in relation to TEXTURE_COMPRESSED. The issue is<br>
that without this patch, all the queries with those internalformats<br>
were affected, not only TEXTURE_COMPRESSED. If the specific value for<br>
TEXTURE_COMPRESSED needs to be different (example: the current one),<br>
would be as part of a different patch for that specific query.<br>
<br>
<br>
src/mesa/main/formatquery.c | 3 +--<br>
1 file changed, 1 insertion(+), 2 deletions(-)<br>
<br>
diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c<br>
index 3b000fac5c4..84b5f512ba5 100644<br>
--- a/src/mesa/main/formatquery.c<br>
+++ b/src/mesa/main/formatquery.c<br>
@@ -501,8 +501,7 @@ _is_resource_supported(struct gl_context *ctx, GLenum target,<br>
<br>
/* additional checks for compressed textures */<br>
if (_mesa_is_compressed_format(<wbr>ctx, internalformat) &&<br>
- (!_mesa_target_can_be_<wbr>compressed(ctx, target, internalformat, NULL) ||<br>
- _mesa_format_no_online_<wbr>compression(internalformat)))<br>
+ !_mesa_target_can_be_<wbr>compressed(ctx, target, internalformat, NULL))<br>
return false;<br>
<br>
break;<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.14.1<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>