[Mesa-dev] [PATCH] mesa/formatquery: remove online compression check on is_resource_supported

Marek Olšák maraeo at gmail.com
Tue May 8 03:03:55 UTC 2018


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Sun, May 6, 2018 at 5:40 AM, Alejandro Piñeiro <apinheiro at igalia.com>
wrote:

> is_resource_supported returns if the combination of
> target/internalformat is supported in at least one operation. Online
> compression is only mandatory for glTexImage2D. Some formats doesn't
> support online compression, but can be used in any case, with
> glCompressed*D methods.
>
> Without this commit, ETC2 internalformats were returning FALSE, even
> for the drivers supporting it. So any other query (like
> TEXTURE_COMPRESSED) was returning FALSE/NONE instead of the proper
> value.
> ---
>
> This was not detected until now because most of the formats that
> doesn't support online compression were added with
> GL_ARB_ES3_compatibility, that was not core until 4.3. The base for
> GL_ARB_internalformat_query2 is 4.2, and the piglit tests were based
> on it.
>
> When we tried to test those formats on piglit (I'm sending a series
> soon) we found that they were found as not supported, even if they can
> be used with CompressedTexture*D.
>
> Note to Eleni: all this was mentioned on a review of some of your
> patches, specifically in relation to TEXTURE_COMPRESSED. The issue is
> that without this patch, all the queries with those internalformats
> were affected, not only TEXTURE_COMPRESSED. If the specific value for
> TEXTURE_COMPRESSED needs to be different (example: the current one),
> would be as part of a different patch for that specific query.
>
>
>  src/mesa/main/formatquery.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c
> index 3b000fac5c4..84b5f512ba5 100644
> --- a/src/mesa/main/formatquery.c
> +++ b/src/mesa/main/formatquery.c
> @@ -501,8 +501,7 @@ _is_resource_supported(struct gl_context *ctx, GLenum
> target,
>
>        /* additional checks for compressed textures */
>        if (_mesa_is_compressed_format(ctx, internalformat) &&
> -          (!_mesa_target_can_be_compressed(ctx, target, internalformat,
> NULL) ||
> -           _mesa_format_no_online_compression(internalformat)))
> +          !_mesa_target_can_be_compressed(ctx, target, internalformat,
> NULL))
>           return false;
>
>        break;
> --
> 2.14.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180507/2ddafb28/attachment.html>


More information about the mesa-dev mailing list