[Mesa-dev] [PATCH] mesa: Add linear ETC2/EAC to the compressed format list with ES3 compat.
Eduardo Lima Mitev
elima at igalia.com
Fri Nov 4 10:13:47 UTC 2016
On 11/04/2016 01:48 AM, Kenneth Graunke wrote:
> GL_ARB_ES3_compatibility brings ETC2/EAC formats to desktop GL.
>
> The meaning of the GL compressed format list is pretty vague - it's
> supposed to return formats for "general-purpose usage". (GL 4.2
> deprecates the list because of this.) Basically everyone interprets
> this as "linear RGB/RGBA".
>
> ETC2/EAC meets that criteria, so while we shouldn't be required to add
> it to the list, there's also little harm in doing so, at least on
> platforms with native support. I doubt anyone is using this list for
> much anyway, so even on platforms without native support, it's probably
> not a big deal.
>
Makes sense, and it indeed fixes the tests below.
Reviewed-by: Eduardo Lima Mitev <elima at igalia.com>
Thanks!
> Makes the following GL45-CTS.gtf43 tests pass:
>
> * GL3Tests.eac_compression_r11.gl_compressed_r11_eac
> * GL3Tests.eac_compression_rg11.gl_compressed_rg11_eac
> * GL3Tests.eac_compression_signed_r11.gl_compressed_signed_r11_eac
> * GL3Tests.eac_compression_signed_rg11.gl_compressed_signed_rg11_eac
> * GL3Tests.etc2_compression_rgb8.gl_compressed_rgb8_etc2
> * GL3Tests.etc2_compression_rgb8_pt_alpha1.gl_compressed_rgb8_pt_alpha1_etc2
> * GL3Tests.etc2_compression_rgba8.gl_compressed_rgba8_etc2
>
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> ---
> src/mesa/main/texcompress.c | 18 ++++++++++++------
> 1 file changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
> index 9567c5d..15970a7 100644
> --- a/src/mesa/main/texcompress.c
> +++ b/src/mesa/main/texcompress.c
> @@ -358,21 +358,27 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats)
> }
> }
>
> - if (_mesa_is_gles3(ctx)) {
> + if (_mesa_is_gles3(ctx) || ctx->Extensions.ARB_ES3_compatibility) {
> if (formats) {
> formats[n++] = GL_COMPRESSED_RGB8_ETC2;
> - formats[n++] = GL_COMPRESSED_SRGB8_ETC2;
> formats[n++] = GL_COMPRESSED_RGBA8_ETC2_EAC;
> - formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
> formats[n++] = GL_COMPRESSED_R11_EAC;
> formats[n++] = GL_COMPRESSED_RG11_EAC;
> formats[n++] = GL_COMPRESSED_SIGNED_R11_EAC;
> formats[n++] = GL_COMPRESSED_SIGNED_RG11_EAC;
> formats[n++] = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2;
> - formats[n++] = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
> + } else {
> + n += 7;
> }
> - else {
> - n += 10;
> + }
> +
> + if (_mesa_is_gles3(ctx)) {
> + if (formats) {
> + formats[n++] = GL_COMPRESSED_SRGB8_ETC2;
> + formats[n++] = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC;
> + formats[n++] = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2;
> + } else {
> + n += 3;
> }
> }
>
>
More information about the mesa-dev
mailing list