The spec was modified to support GLES. Tested by piglit.
v2: rebase
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> (v1)
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
<ul>
<li>GL_EXT_shader_implicit_conversions on all drivers (ES extension).</li>
+<li>GL_EXT_texture_compression_rgtc on all GL 3.0 drivers (ES extension).</li>
<li>GL_EXT_texture_view on drivers supporting texture views (ES extension).</li>
<li>GL_OES_texture_view on drivers supporting texture views (ES extension).</li>
</ul>
EXT(EXT_texture_buffer , OES_texture_buffer , x , x , x , 31, 2014)
EXT(EXT_texture_compression_dxt1 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2004)
EXT(EXT_texture_compression_latc , EXT_texture_compression_latc , GLL, x , x , x , 2006)
-EXT(EXT_texture_compression_rgtc , ARB_texture_compression_rgtc , GLL, GLC, x , x , 2004)
+EXT(EXT_texture_compression_rgtc , ARB_texture_compression_rgtc , GLL, GLC, x , 30, 2004)
EXT(EXT_texture_compression_s3tc , EXT_texture_compression_s3tc , GLL, GLC, x , ES2, 2000)
EXT(EXT_texture_cube_map , ARB_texture_cube_map , GLL, x , x , x , 2001)
EXT(EXT_texture_cube_map_array , OES_texture_cube_map_array , x , x , x , 31, 2014)
case MESA_FORMAT_LAYOUT_FXT1:
return _mesa_has_3DFX_texture_compression_FXT1(ctx);
case MESA_FORMAT_LAYOUT_RGTC:
- return _mesa_has_ARB_texture_compression_rgtc(ctx);
+ return _mesa_has_ARB_texture_compression_rgtc(ctx) ||
+ _mesa_has_EXT_texture_compression_rgtc(ctx);
case MESA_FORMAT_LAYOUT_LATC:
return _mesa_has_EXT_texture_compression_latc(ctx);
case MESA_FORMAT_LAYOUT_ETC1:
return GL_INVALID_OPERATION;
switch (type) {
case GL_UNSIGNED_BYTE:
- if (internalFormat != GL_RG8)
+ if (internalFormat != GL_RG8 &&
+ (!_mesa_has_EXT_texture_compression_rgtc(ctx) ||
+ internalFormat != GL_COMPRESSED_RED_GREEN_RGTC2_EXT))
return GL_INVALID_OPERATION;
break;
case GL_BYTE:
- if (internalFormat != GL_RG8_SNORM)
+ if (internalFormat != GL_RG8_SNORM &&
+ (!_mesa_has_EXT_texture_compression_rgtc(ctx) ||
+ internalFormat != GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT))
return GL_INVALID_OPERATION;
break;
case GL_UNSIGNED_BYTE:
if (internalFormat == GL_R8 ||
((internalFormat == GL_SR8_EXT) &&
- _mesa_has_EXT_texture_sRGB_R8(ctx)))
+ _mesa_has_EXT_texture_sRGB_R8(ctx)) ||
+ (internalFormat == GL_COMPRESSED_RED_RGTC1_EXT &&
+ _mesa_has_EXT_texture_compression_rgtc(ctx)))
break;
return GL_INVALID_OPERATION;
case GL_BYTE:
- if (internalFormat != GL_R8_SNORM)
+ if (internalFormat != GL_R8_SNORM &&
+ (!_mesa_has_EXT_texture_compression_rgtc(ctx) ||
+ internalFormat != GL_COMPRESSED_SIGNED_RED_RGTC1_EXT))
return GL_INVALID_OPERATION;
break;
formats[n++] = GL_ETC1_RGB8_OES;
}
+ /* Required by EXT_texture_compression_rgtc in GLES. */
+ if (_mesa_is_gles3(ctx) &&
+ _mesa_has_EXT_texture_compression_rgtc(ctx)) {
+ formats[n++] = GL_COMPRESSED_RED_RGTC1_EXT;
+ formats[n++] = GL_COMPRESSED_SIGNED_RED_RGTC1_EXT;
+ formats[n++] = GL_COMPRESSED_RED_GREEN_RGTC2_EXT;
+ formats[n++] = GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT;
+ }
+
if (ctx->API == API_OPENGLES) {
formats[n++] = GL_PALETTE4_RGB8_OES;
formats[n++] = GL_PALETTE4_RGBA8_OES;