summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-11-28 16:57:02 +0800
committerChia-I Wu <[email protected]>2011-12-02 08:43:46 +0800
commitd4a38e86d4b4d66cca20ee63222f940cb73fa709 (patch)
tree059bf69787804996049163ffa2ee809560bfc04a /src/mesa/main/formats.c
parent51f4d2725417088c75d512b69a31a26ae5cb3ef2 (diff)
mesa: add support for GL_OES_compressed_ETC1_RGB8_texture
Add support for GL_OES_compressed_ETC1_RGB8_texture to core mesa. There is no driver support yet. Unlike desktop GL compressed texture formats, GLES compressed texture formats usually can only be used with glCompressedTexImage2D. All other gl*Tex*Image* functions are updated to check for that. Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index 873fedc6539..4b163d16289 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -1386,6 +1386,16 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] =
4, 4, 16 /* 16 bytes per 4x4 block */
},
+ {
+ MESA_FORMAT_ETC1_RGB8,
+ "MESA_FORMAT_ETC1_RGB8",
+ GL_RGB,
+ GL_UNSIGNED_NORMALIZED,
+ 8, 8, 8, 0,
+ 0, 0, 0, 0, 0,
+ 4, 4, 8 /* 8 bytes per 4x4 block */
+ },
+
/* Signed formats from EXT_texture_snorm that are not in GL3.1 */
{
MESA_FORMAT_SIGNED_A8,
@@ -1790,6 +1800,8 @@ _mesa_get_uncompressed_format(gl_format format)
return MESA_FORMAT_AL88;
case MESA_FORMAT_SIGNED_LA_LATC2:
return MESA_FORMAT_SIGNED_AL88;
+ case MESA_FORMAT_ETC1_RGB8:
+ return MESA_FORMAT_RGB888;
default:
#ifdef DEBUG
assert(!_mesa_is_format_compressed(format));
@@ -2240,6 +2252,7 @@ _mesa_format_to_type_and_comps(gl_format format,
case MESA_FORMAT_SIGNED_L_LATC1:
case MESA_FORMAT_LA_LATC2:
case MESA_FORMAT_SIGNED_LA_LATC2:
+ case MESA_FORMAT_ETC1_RGB8:
/* XXX generate error instead? */
*datatype = GL_UNSIGNED_BYTE;
*comps = 0;
@@ -2777,6 +2790,9 @@ _mesa_format_matches_format_and_type(gl_format gl_format,
case MESA_FORMAT_SIGNED_LA_LATC2:
return GL_FALSE;
+ case MESA_FORMAT_ETC1_RGB8:
+ return GL_FALSE;
+
case MESA_FORMAT_SIGNED_A8:
case MESA_FORMAT_SIGNED_L8:
case MESA_FORMAT_SIGNED_AL88: