summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texcompress_etc.h
diff options
context:
space:
mode:
authorAnuj Phogat <[email protected]>2012-10-09 17:02:37 -0700
committerIan Romanick <[email protected]>2012-12-07 16:29:48 -0800
commit7697f25667d13031a46d1c373ea53919c06c9df5 (patch)
tree088806f6723668539a49fa30f33813df1cb03495 /src/mesa/main/texcompress_etc.h
parentaa217090f52dc532b84186a63c07167bd82e8f22 (diff)
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 <[email protected]> Tested-by: Matt Turner <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/texcompress_etc.h')
-rw-r--r--src/mesa/main/texcompress_etc.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/main/texcompress_etc.h b/src/mesa/main/texcompress_etc.h
index 36070a828af..a67df2feba7 100644
--- a/src/mesa/main/texcompress_etc.h
+++ b/src/mesa/main/texcompress_etc.h
@@ -52,6 +52,9 @@ _mesa_texstore_etc2_r11_eac(TEXSTORE_PARAMS);
GLboolean
_mesa_texstore_etc2_rg11_eac(TEXSTORE_PARAMS);
+GLboolean
+_mesa_texstore_etc2_signed_r11_eac(TEXSTORE_PARAMS);
+
void
_mesa_fetch_texel_2d_f_etc1_rgb8(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel);
@@ -77,6 +80,11 @@ void
_mesa_fetch_texel_2d_f_etc2_rg11_eac(const struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel);
void
+_mesa_fetch_texel_2d_f_etc2_signed_r11_eac(const struct
+ swrast_texture_image *texImage,
+ GLint i, GLint j,
+ GLint k, GLfloat *texel);
+void
_mesa_etc1_unpack_rgba8888(uint8_t *dst_row,
unsigned dst_stride,
const uint8_t *src_row,