<category name="OES_matrix_get"/>
<category name="OES_read_format"/>
<category name="OES_compressed_paletted_texture"/>
+ <category name="OES_compressed_ETC1_RGB8_texture"/>
<category name="OES_point_size_array"/>
<category name="OES_point_sprite"/>
<category name="OES_query_matrix"/>
<category name="GLES2.0"/>
<category name="OES_compressed_paletted_texture"/>
+ <category name="OES_compressed_ETC1_RGB8_texture"/>
<category name="OES_depth24"/>
<category name="OES_depth32"/>
<category name="OES_fbo_render_mipmap"/>
{ "GL_OES_blend_func_separate", o(EXT_blend_func_separate), ES1, 2009 },
{ "GL_OES_blend_subtract", o(dummy_true), ES1, 2009 },
{ "GL_OES_byte_coordinates", o(dummy_true), ES1, 2002 },
+ { "GL_OES_compressed_ETC1_RGB8_texture", o(OES_compressed_ETC1_RGB8_texture), ES1 | ES2, 2005 },
{ "GL_OES_compressed_paletted_texture", o(dummy_true), ES1, 2003 },
{ "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2, 2005 },
{ "GL_OES_depth32", o(dummy_false), DISABLE, 2005 },
/* XXX to do */
}
+static void
+unpack_ETC1_RGB8(const void *src, GLfloat dst[][4], GLuint n)
+{
+ /* XXX to do */
+}
+
static void
unpack_SIGNED_A8(const void *src, GLfloat dst[][4], GLuint n)
{
table[MESA_FORMAT_LA_LATC2] = unpack_LA_LATC2;
table[MESA_FORMAT_SIGNED_LA_LATC2] = unpack_SIGNED_LA_LATC2;
+ table[MESA_FORMAT_ETC1_RGB8] = unpack_ETC1_RGB8;
+
table[MESA_FORMAT_SIGNED_A8] = unpack_SIGNED_A8;
table[MESA_FORMAT_SIGNED_L8] = unpack_SIGNED_L8;
table[MESA_FORMAT_SIGNED_AL88] = unpack_SIGNED_AL88;
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,
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));
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;
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:
MESA_FORMAT_SIGNED_LA_LATC2,
/*@}*/
+ MESA_FORMAT_ETC1_RGB8,
+
MESA_FORMAT_SIGNED_A8, /* AAAA AAAA */
MESA_FORMAT_SIGNED_L8, /* LLLL LLLL */
MESA_FORMAT_SIGNED_AL88, /* AAAA AAAA LLLL LLLL */
#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
#endif
+#ifndef GL_OES_compressed_ETC1_RGB8_texture
+#define GL_ETC1_RGB8_OES 0x8D64
+#endif
+
/**
* Internal token to represent a GLSL shader program (a collection of
case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT:
case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
+ case GL_ETC1_RGB8_OES:
/* generic integer formats */
case GL_RED_INTEGER_EXT:
case GL_GREEN_INTEGER_EXT:
return ctx->Extensions.EXT_texture_compression_latc;
case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI:
return ctx->Extensions.ATI_texture_compression_3dc;
+ case GL_ETC1_RGB8_OES:
+ return ctx->Extensions.OES_compressed_ETC1_RGB8_texture;
#if FEATURE_ES
case GL_PALETTE4_RGB8_OES:
case GL_PALETTE4_RGBA8_OES:
GLboolean OES_EGL_image;
GLboolean OES_draw_texture;
GLboolean OES_EGL_image_external;
+ GLboolean OES_compressed_ETC1_RGB8_texture;
GLboolean extension_sentinel;
/** The extension string */
const GLubyte *String;
#include "texcompress_fxt1.h"
#include "texcompress_rgtc.h"
#include "texcompress_s3tc.h"
+#include "texcompress_etc.h"
#include "swrast/s_context.h"
case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
case GL_COMPRESSED_RGB_FXT1_3DFX:
case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT:
+ case GL_ETC1_RGB8_OES:
return GL_RGB;
case GL_COMPRESSED_RGBA:
}
}
+ if (ctx->Extensions.OES_compressed_ETC1_RGB8_texture) {
+ if (formats) {
+ formats[n++] = GL_ETC1_RGB8_OES;
+ }
+ else {
+ n += 1;
+ }
+ }
+
#if FEATURE_ES1
if (ctx->API == API_OPENGLES) {
if (formats) {
case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT:
return MESA_FORMAT_SIGNED_LA_LATC2;
+ case GL_ETC1_RGB8_OES:
+ return MESA_FORMAT_ETC1_RGB8;
+
default:
return MESA_FORMAT_NONE;
}
case MESA_FORMAT_SIGNED_LA_LATC2:
return GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT;
+ case MESA_FORMAT_ETC1_RGB8:
+ return GL_ETC1_RGB8_OES;
+
default:
_mesa_problem(ctx, "Unexpected mesa texture format in"
" _mesa_compressed_format_to_glenum()");
fetch = _mesa_fetch_texel_2d_f_signed_la_latc2;
break;
+ /* ETC1 formats */
+ case MESA_FORMAT_ETC1_RGB8:
+ fetch = _mesa_fetch_texel_2d_f_etc1_rgb8;
+ break;
+
default:
_mesa_problem(NULL, "Unexpected format in _mesa_decompress_image()");
return;
}
}
+ if (ctx->Extensions.OES_compressed_ETC1_RGB8_texture) {
+ switch (internalFormat) {
+ case GL_ETC1_RGB8_OES:
+ RETURN_IF_SUPPORTED(MESA_FORMAT_ETC1_RGB8);
+ break;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
_mesa_problem(ctx, "unexpected format %s in _mesa_choose_tex_format()",
_mesa_lookup_enum_by_nr(internalFormat));
return MESA_FORMAT_NONE;
}
}
+ if (ctx->Extensions.OES_compressed_ETC1_RGB8_texture) {
+ switch (internalFormat) {
+ case GL_ETC1_RGB8_OES:
+ return GL_RGB;
+ default:
+ ; /* fallthrough */
+ }
+ }
+
if (ctx->API == API_OPENGLES) {
switch (internalFormat) {
case GL_PALETTE4_RGB8_OES:
}
+/**
+ * Return true if the format is only valid for glCompressedTexImage.
+ */
+static GLboolean
+compressedteximage_only_format(const struct gl_context *ctx, GLenum format)
+{
+ switch (format) {
+ case GL_ETC1_RGB8_OES:
+ return GL_TRUE;
+ default:
+ return GL_FALSE;
+ }
+}
+
/**
* Helper function to determine whether a target and specific compression
"glTexImage%dD(target)", dimensions);
return GL_TRUE;
}
+ if (compressedteximage_only_format(ctx, internalFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexImage%dD(no compression for format)", dimensions);
+ return GL_TRUE;
+ }
if (border != 0) {
if (!isProxy) {
_mesa_error(ctx, GL_INVALID_OPERATION,
if (_mesa_is_format_compressed(destTex->TexFormat)) {
GLuint bw, bh;
+ if (compressedteximage_only_format(ctx, destTex->InternalFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTexSubImage%dD(no compression for format)", dimensions);
+ return GL_TRUE;
+ }
+
/* do tests which depend on compression block size */
_mesa_get_format_block_size(destTex->TexFormat, &bw, &bh);
"glCopyTexImage%dD(target)", dimensions);
return GL_TRUE;
}
+ if (compressedteximage_only_format(ctx, internalFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexImage%dD(no compression for format)", dimensions);
+ return GL_TRUE;
+ }
if (border != 0) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"glCopyTexImage%dD(border!=0)", dimensions);
}
if (_mesa_is_format_compressed(teximage->TexFormat)) {
+ if (compressedteximage_only_format(ctx, teximage->InternalFormat)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyTexSubImage%dD(no compression for format)", dimensions);
+ return GL_TRUE;
+ }
/* offset must be multiple of 4 */
if ((xoffset & 3) || (yoffset & 3)) {
_mesa_error(ctx, GL_INVALID_VALUE,
return GL_TRUE;
}
+ if (compressedteximage_only_format(ctx, format)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCompressedTexSubImage%uD(format=0x%x cannot be updated)"
+ , dims, format);
+ return GL_TRUE;
+ }
+
if (((width == 1 || width == 2) &&
width != (GLsizei) texImage->Width) ||
(width > (GLsizei) texImage->Width)) {
#include "texcompress_fxt1.h"
#include "texcompress_rgtc.h"
#include "texcompress_s3tc.h"
+#include "texcompress_etc.h"
#include "teximage.h"
#include "texstore.h"
#include "enums.h"
table[MESA_FORMAT_SIGNED_L_LATC1] = _mesa_texstore_signed_red_rgtc1;
table[MESA_FORMAT_LA_LATC2] = _mesa_texstore_rg_rgtc2;
table[MESA_FORMAT_SIGNED_LA_LATC2] = _mesa_texstore_signed_rg_rgtc2;
+ table[MESA_FORMAT_ETC1_RGB8] = _mesa_texstore_etc1_rgb8;
table[MESA_FORMAT_SIGNED_A8] = _mesa_texstore_snorm8;
table[MESA_FORMAT_SIGNED_L8] = _mesa_texstore_snorm8;
table[MESA_FORMAT_SIGNED_AL88] = _mesa_texstore_snorm88;
#include "main/texcompress_fxt1.h"
#include "main/texcompress_s3tc.h"
#include "main/texcompress_rgtc.h"
+#include "main/texcompress_etc.h"
#include "main/teximage.h"
#include "s_context.h"
#include "s_texfetch.h"
NULL,
NULL
},
+ {
+ MESA_FORMAT_ETC1_RGB8,
+ NULL,
+ _mesa_fetch_texel_2d_f_etc1_rgb8,
+ NULL,
+ NULL
+ },
{
MESA_FORMAT_SIGNED_A8,
fetch_texel_1d_signed_a8,