From 7697f25667d13031a46d1c373ea53919c06c9df5 Mon Sep 17 00:00:00 2001 From: Anuj Phogat Date: Tue, 9 Oct 2012 17:02:37 -0700 Subject: mesa: Add decoding functions for GL_COMPRESSED_SIGNED_R11_EAC Data in GL_COMPRESSED_SIGNED_R11_EAC format is decoded and stored in MESA_FORMAT_SIGNED_R16. v2: 16 bit signed data is converted to 16 bit unsigned data by adding 2 ^ 15 and stored in an unsigned texture format. v3: 1. Handle a corner case when base code word value is -128. As per OpenGL ES 3.0 specification -128 is not an allowed value and should be truncated to -127. 2. Converting a decoded 16 bit signed data to 16 bit unsigned data by adding 2 ^ 15 gives us an output which matches the decompressed image (.ppm) generated by ericsson's etcpack tool. ericsson is also doing this conversion in their tool because .ppm image files don't support signed data. But gles 3.0 specification doesn't suggest this conversion. We need to keep the decoded data in signed format. Both signed format tests in gles3 conformance pass with these changes. Signed-off-by: Anuj Phogat Tested-by: Matt Turner Reviewed-by: Brian Paul --- src/mesa/main/texstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/main/texstore.c') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 4e6003013d5..0d89c6aae04 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -4130,7 +4130,7 @@ _mesa_get_texstore_func(gl_format format) table[MESA_FORMAT_ETC2_SRGB8_ALPHA8_EAC] = _mesa_texstore_etc2_srgb8_alpha8_eac; table[MESA_FORMAT_ETC2_R11_EAC] = _mesa_texstore_etc2_r11_eac; table[MESA_FORMAT_ETC2_RG11_EAC] = _mesa_texstore_etc2_rg11_eac; - /* table[MESA_FORMAT_ETC2_SIGNED_R11_EAC] = _mesa_texstore_etc2_signed_r11_eac; -- not implemented yet */ + table[MESA_FORMAT_ETC2_SIGNED_R11_EAC] = _mesa_texstore_etc2_signed_r11_eac; /* table[MESA_FORMAT_ETC2_SIGNED_RG11_EAC] = _mesa_texstore_etc2_signed_rg11_eac; -- not implemented yet */ /* table[MESA_FORMAT_ETC2_RGB8_PUNCHTHROUGH_ALPHA1] = _mesa_texstore_etc2_rgb8_punchthrough_alpha1; -- not implemented yet */ -- cgit v1.2.3