Browse Source

GL: support {ANGLE,WEBGL}_compressed_texture_etc.

pull/539/head
Vladimír Vondruš 4 years ago
parent
commit
4fa4f726ec
  1. 6
      doc/changelog.dox
  2. 2
      doc/opengl-support.dox
  3. 30
      src/Magnum/GL/AbstractTexture.cpp
  4. 2
      src/Magnum/GL/Context.cpp
  5. 30
      src/Magnum/GL/Extensions.h
  6. 13
      src/Magnum/GL/Implementation/compressedPixelFormatMapping.hpp
  7. 2
      src/Magnum/GL/PixelFormat.cpp
  8. 110
      src/Magnum/GL/PixelFormat.h
  9. 12
      src/Magnum/GL/Test/PixelFormatTest.cpp
  10. 2
      src/Magnum/GL/TextureFormat.cpp
  11. 110
      src/Magnum/GL/TextureFormat.h
  12. 4
      src/MagnumExternal/OpenGL/GLES2/Emscripten/extensions.txt
  13. 3
      src/MagnumExternal/OpenGL/GLES2/extensions.txt
  14. 3
      src/MagnumExternal/OpenGL/GLES3/Emscripten/extensions.txt
  15. 3
      src/MagnumExternal/OpenGL/GLES3/extensions.txt

6
doc/changelog.dox

@ -116,6 +116,12 @@ See also:
- @webgl_extension{WEBGL,multi_draw} - @webgl_extension{WEBGL,multi_draw}
- @webgl_extension{WEBGL,draw_instanced_base_vertex_base_instance} - @webgl_extension{WEBGL,draw_instanced_base_vertex_base_instance}
- @webgl_extension{WEBGL,multi_draw_instanced_base_vertex_base_instance} - @webgl_extension{WEBGL,multi_draw_instanced_base_vertex_base_instance}
- Recognizing @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
OpenGL ES and @webgl_extension{WEBGL,compressed_texture_etc} WebGL
extensions, making ETC and EAC @ref GL::CompressedPixelFormat and
@ref GL::TextureFormat values available also on OpenGL ES 2.0 and WebGL.
The values were already present in WebGL 2.0 builds by accident before,
without documenting corresponding extension requirements.
- Added a @ref GL::AbstractTexture::target() getter to simplify interaction - Added a @ref GL::AbstractTexture::target() getter to simplify interaction
with raw GL code with raw GL code
- Exposed @gl_extension{ARB,buffer_storage} as - Exposed @gl_extension{ARB,buffer_storage} as

2
doc/opengl-support.dox

@ -391,6 +391,7 @@ Extension | Status
@gl_extension{ANGLE,framebuffer_multisample} | done @gl_extension{ANGLE,framebuffer_multisample} | done
@gl_extension{ANGLE,instanced_arrays} | done @gl_extension{ANGLE,instanced_arrays} | done
@gl_extension{ANGLE,depth_texture} | done @gl_extension{ANGLE,depth_texture} | done
@m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt) (unlisted) | done
@gl_extension{APPLE,framebuffer_multisample} | done (ES 3.0 subset) @gl_extension{APPLE,framebuffer_multisample} | done (ES 3.0 subset)
@gl_extension{APPLE,texture_max_level} | done @gl_extension{APPLE,texture_max_level} | done
@gl_extension{ARM,rgba8} | done @gl_extension{ARM,rgba8} | done
@ -570,6 +571,7 @@ Extension | Status
@webgl_extension{WEBGL,debug_shaders} | | @webgl_extension{WEBGL,debug_shaders} | |
@webgl_extension{WEBGL,compressed_texture_s3tc} | done @webgl_extension{WEBGL,compressed_texture_s3tc} | done
@webgl_extension{WEBGL,compressed_texture_pvrtc} | done @webgl_extension{WEBGL,compressed_texture_pvrtc} | done
@webgl_extension{WEBGL,compressed_texture_etc} | done
@webgl_extension{WEBGL,compressed_texture_astc} | done @webgl_extension{WEBGL,compressed_texture_astc} | done
@webgl_extension{WEBGL,compressed_texture_s3tc_srgb} | done @webgl_extension{WEBGL,compressed_texture_s3tc_srgb} | done
@webgl_extension{WEBGL,multi_draw} | done @webgl_extension{WEBGL,multi_draw} | done

30
src/Magnum/GL/AbstractTexture.cpp

@ -574,10 +574,9 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
case TextureFormat::CompressedRed: case TextureFormat::CompressedRed:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 /* for WebGL 1 these two are in the Luminance case instead */
case TextureFormat::CompressedR11Eac: case TextureFormat::CompressedR11Eac:
case TextureFormat::CompressedSignedR11Eac: case TextureFormat::CompressedSignedR11Eac:
#endif
return PixelFormat::Red; return PixelFormat::Red;
#endif #endif
@ -624,10 +623,9 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#ifndef MAGNUM_TARGET_GLES #ifndef MAGNUM_TARGET_GLES
case TextureFormat::CompressedRG: case TextureFormat::CompressedRG:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 /* for WebGL 1 these two are in the LuminanceAlpha case instead */
case TextureFormat::CompressedRG11Eac: case TextureFormat::CompressedRG11Eac:
case TextureFormat::CompressedSignedRG11Eac: case TextureFormat::CompressedSignedRG11Eac:
#endif
return PixelFormat::RG; return PixelFormat::RG;
#endif #endif
@ -692,9 +690,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
case TextureFormat::CompressedRGBBptcUnsignedFloat: case TextureFormat::CompressedRGBBptcUnsignedFloat:
case TextureFormat::CompressedRGBBptcSignedFloat: case TextureFormat::CompressedRGBBptcSignedFloat:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
case TextureFormat::CompressedRGB8Etc2: case TextureFormat::CompressedRGB8Etc2:
#endif
case TextureFormat::CompressedRGBS3tcDxt1: case TextureFormat::CompressedRGBS3tcDxt1:
#ifdef MAGNUM_TARGET_GLES #ifdef MAGNUM_TARGET_GLES
case TextureFormat::CompressedRGBPvrtc2bppV1: case TextureFormat::CompressedRGBPvrtc2bppV1:
@ -708,9 +704,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
case TextureFormat::SRGB8: case TextureFormat::SRGB8:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
case TextureFormat::CompressedSRGB8Etc2: case TextureFormat::CompressedSRGB8Etc2:
#endif
case TextureFormat::CompressedSRGBS3tcDxt1: case TextureFormat::CompressedSRGBS3tcDxt1:
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL) #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_WEBGL)
case TextureFormat::CompressedSRGBPvrtc2bppV1: case TextureFormat::CompressedSRGBPvrtc2bppV1:
@ -764,10 +758,8 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL)
case TextureFormat::CompressedRGBABptcUnorm: case TextureFormat::CompressedRGBABptcUnorm:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
case TextureFormat::CompressedRGB8PunchthroughAlpha1Etc2: case TextureFormat::CompressedRGB8PunchthroughAlpha1Etc2:
case TextureFormat::CompressedRGBA8Etc2Eac: case TextureFormat::CompressedRGBA8Etc2Eac:
#endif
case TextureFormat::CompressedRGBAS3tcDxt1: case TextureFormat::CompressedRGBAS3tcDxt1:
case TextureFormat::CompressedRGBAS3tcDxt3: case TextureFormat::CompressedRGBAS3tcDxt3:
case TextureFormat::CompressedRGBAS3tcDxt5: case TextureFormat::CompressedRGBAS3tcDxt5:
@ -800,10 +792,8 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL) #if !defined(MAGNUM_TARGET_GLES2) || defined(MAGNUM_TARGET_WEBGL)
case TextureFormat::CompressedSRGBAlphaBptcUnorm: case TextureFormat::CompressedSRGBAlphaBptcUnorm:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
case TextureFormat::CompressedSRGB8PunchthroughAlpha1Etc2: case TextureFormat::CompressedSRGB8PunchthroughAlpha1Etc2:
case TextureFormat::CompressedSRGB8Alpha8Etc2Eac: case TextureFormat::CompressedSRGB8Alpha8Etc2Eac:
#endif
case TextureFormat::CompressedSRGBAlphaS3tcDxt1: case TextureFormat::CompressedSRGBAlphaS3tcDxt1:
case TextureFormat::CompressedSRGBAlphaS3tcDxt3: case TextureFormat::CompressedSRGBAlphaS3tcDxt3:
case TextureFormat::CompressedSRGBAlphaS3tcDxt5: case TextureFormat::CompressedSRGBAlphaS3tcDxt5:
@ -850,8 +840,22 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
case TextureFormat::Luminance: case TextureFormat::Luminance:
#ifdef MAGNUM_TARGET_WEBGL
/* Not sure if this is the right place, as neither of the
{ANGLE,WEBGL}_compressed_texture_etc specifications says what the corresponding pixel format is meant to be. For desktop, ES and
WebGL 2 these two are in the Red case instead. */
case TextureFormat::CompressedR11Eac:
case TextureFormat::CompressedSignedR11Eac:
#endif
return PixelFormat::Luminance; return PixelFormat::Luminance;
case TextureFormat::LuminanceAlpha: case TextureFormat::LuminanceAlpha:
#ifdef MAGNUM_TARGET_WEBGL
/* Not sure if this is the right place, as neither of the
{ANGLE,WEBGL}_compressed_texture_etc specifications says what the corresponding pixel format is meant to be. For desktop, ES and
WebGL 2 these two are in the RG case instead. */
case TextureFormat::CompressedRG11Eac:
case TextureFormat::CompressedSignedRG11Eac:
#endif
return PixelFormat::LuminanceAlpha; return PixelFormat::LuminanceAlpha;
#endif #endif
@ -950,7 +954,6 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) {
case TextureFormat::CompressedRGBABptcUnorm: case TextureFormat::CompressedRGBABptcUnorm:
case TextureFormat::CompressedSRGBAlphaBptcUnorm: case TextureFormat::CompressedSRGBAlphaBptcUnorm:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
case TextureFormat::CompressedRGB8Etc2: case TextureFormat::CompressedRGB8Etc2:
case TextureFormat::CompressedSRGB8Etc2: case TextureFormat::CompressedSRGB8Etc2:
case TextureFormat::CompressedRGB8PunchthroughAlpha1Etc2: case TextureFormat::CompressedRGB8PunchthroughAlpha1Etc2:
@ -961,7 +964,6 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) {
case TextureFormat::CompressedSignedR11Eac: case TextureFormat::CompressedSignedR11Eac:
case TextureFormat::CompressedRG11Eac: case TextureFormat::CompressedRG11Eac:
case TextureFormat::CompressedSignedRG11Eac: case TextureFormat::CompressedSignedRG11Eac:
#endif
case TextureFormat::CompressedRGBS3tcDxt1: case TextureFormat::CompressedRGBS3tcDxt1:
case TextureFormat::CompressedSRGBS3tcDxt1: case TextureFormat::CompressedSRGBS3tcDxt1:
case TextureFormat::CompressedRGBAS3tcDxt1: case TextureFormat::CompressedRGBAS3tcDxt1:

2
src/Magnum/GL/Context.cpp

@ -295,6 +295,7 @@ constexpr Extension ExtensionList[]{
#endif #endif
Extensions::WEBGL::blend_equation_advanced_coherent{}, Extensions::WEBGL::blend_equation_advanced_coherent{},
Extensions::WEBGL::compressed_texture_astc{}, Extensions::WEBGL::compressed_texture_astc{},
Extensions::WEBGL::compressed_texture_etc{},
Extensions::WEBGL::compressed_texture_pvrtc{}, Extensions::WEBGL::compressed_texture_pvrtc{},
Extensions::WEBGL::compressed_texture_s3tc{}, Extensions::WEBGL::compressed_texture_s3tc{},
Extensions::WEBGL::compressed_texture_s3tc_srgb{}, Extensions::WEBGL::compressed_texture_s3tc_srgb{},
@ -341,6 +342,7 @@ constexpr Extension ExtensionList[]{
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
Extensions::ANGLE::base_vertex_base_instance{}, Extensions::ANGLE::base_vertex_base_instance{},
#endif #endif
Extensions::ANGLE::compressed_texture_etc{},
Extensions::ANGLE::multi_draw{}, Extensions::ANGLE::multi_draw{},
Extensions::ANGLE::texture_compression_dxt1{}, Extensions::ANGLE::texture_compression_dxt1{},
Extensions::ANGLE::texture_compression_dxt3{}, Extensions::ANGLE::texture_compression_dxt3{},

30
src/Magnum/GL/Extensions.h

@ -337,17 +337,18 @@ namespace ANGLE {
_extension(37,WEBGL,color_buffer_float, GLES200, None) // #14 _extension(37,WEBGL,color_buffer_float, GLES200, None) // #14
_extension(38,WEBGL,draw_buffers, GLES200, GLES300) // #18 _extension(38,WEBGL,draw_buffers, GLES200, GLES300) // #18
#endif #endif
_extension(39,WEBGL,compressed_texture_astc, GLES200, None) // #30 _extension(39,WEBGL,compressed_texture_etc, GLES200, None) // #29
_extension(40,WEBGL,compressed_texture_s3tc_srgb, GLES200, None) // #32 _extension(40,WEBGL,compressed_texture_astc, GLES200, None) // #30
_extension(41,WEBGL,multi_draw, GLES200, None) // #40 _extension(41,WEBGL,compressed_texture_s3tc_srgb, GLES200, None) // #32
_extension(42,WEBGL,blend_equation_advanced_coherent,GLES200,None) // #42 _extension(42,WEBGL,multi_draw, GLES200, None) // #40
_extension(43,WEBGL,blend_equation_advanced_coherent,GLES200,None) // #42
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_extension(43,WEBGL,draw_instanced_base_vertex_base_instance,GLES300,None) // #46 _extension(44,WEBGL,draw_instanced_base_vertex_base_instance,GLES300,None) // #46
_extension(44,WEBGL,multi_draw_instanced_base_vertex_base_instance,GLES300,None) // #47 _extension(45,WEBGL,multi_draw_instanced_base_vertex_base_instance,GLES300,None) // #47
#endif #endif
} namespace MAGNUM { } namespace MAGNUM {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
_extension(45,MAGNUM,shader_vertex_id, GLES300, GLES300) _extension(46,MAGNUM,shader_vertex_id, GLES300, GLES300)
#endif #endif
} }
#else #else
@ -377,21 +378,22 @@ namespace ANDROID {
and this is THE ONLY SINGLE IMPLEMENTER so what gives?! */ and this is THE ONLY SINGLE IMPLEMENTER so what gives?! */
_extension( 10,ANGLE,base_vertex_base_instance, GLES300, None) // #??? _extension( 10,ANGLE,base_vertex_base_instance, GLES300, None) // #???
#endif #endif
_extension( 11,ANGLE,compressed_texture_etc, GLES200, None) // #???
} namespace APPLE { } namespace APPLE {
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
_extension( 11,APPLE,framebuffer_multisample, GLES200, GLES300) // #78 _extension( 12,APPLE,framebuffer_multisample, GLES200, GLES300) // #78
#endif #endif
_extension( 12,APPLE,texture_format_BGRA8888, GLES200, None) // #79 _extension( 13,APPLE,texture_format_BGRA8888, GLES200, None) // #79
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
_extension( 13,APPLE,texture_max_level, GLES200, GLES300) // #80 _extension( 14,APPLE,texture_max_level, GLES200, GLES300) // #80
#endif #endif
_extension( 14,APPLE,clip_distance, GLES200, None) // #193 _extension( 15,APPLE,clip_distance, GLES200, None) // #193
} namespace ARM { } namespace ARM {
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
_extension( 15,ARM,rgba8, GLES200, GLES300) // #82 _extension( 16,ARM,rgba8, GLES200, GLES300) // #82
#endif #endif
_extension( 16,ARM,shader_framebuffer_fetch, GLES200, None) // #165 _extension( 17,ARM,shader_framebuffer_fetch, GLES200, None) // #165
_extension( 17,ARM,shader_framebuffer_fetch_depth_stencil, GLES200, None) // #166 _extension( 18,ARM,shader_framebuffer_fetch_depth_stencil, GLES200, None) // #166
} namespace EXT { } namespace EXT {
_extension( 19,EXT,texture_filter_anisotropic, GLES200, None) // #41 _extension( 19,EXT,texture_filter_anisotropic, GLES200, None) // #41
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2

13
src/Magnum/GL/Implementation/compressedPixelFormatMapping.hpp

@ -52,7 +52,6 @@ _s(Bc6hRGBSfloat)
_s(Bc7RGBAUnorm) _s(Bc7RGBAUnorm)
_s(Bc7RGBASrgb) _s(Bc7RGBASrgb)
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
_c(EacR11Unorm, R11Eac) _c(EacR11Unorm, R11Eac)
_c(EacR11Snorm, SignedR11Eac) _c(EacR11Snorm, SignedR11Eac)
_c(EacRG11Unorm, RG11Eac) _c(EacRG11Unorm, RG11Eac)
@ -63,18 +62,6 @@ _c(Etc2RGB8A1Unorm, RGB8PunchthroughAlpha1Etc2)
_c(Etc2RGB8A1Srgb, SRGB8PunchthroughAlpha1Etc2) _c(Etc2RGB8A1Srgb, SRGB8PunchthroughAlpha1Etc2)
_c(Etc2RGBA8Unorm, RGBA8Etc2Eac) _c(Etc2RGBA8Unorm, RGBA8Etc2Eac)
_c(Etc2RGBA8Srgb, SRGB8Alpha8Etc2Eac) _c(Etc2RGBA8Srgb, SRGB8Alpha8Etc2Eac)
#else
_s(EacR11Unorm)
_s(EacR11Snorm)
_s(EacRG11Unorm)
_s(EacRG11Snorm)
_s(Etc2RGB8Unorm)
_s(Etc2RGB8Srgb)
_s(Etc2RGB8A1Unorm)
_s(Etc2RGB8A1Srgb)
_s(Etc2RGBA8Unorm)
_s(Etc2RGBA8Srgb)
#endif
_c(Astc4x4RGBAUnorm, RGBAAstc4x4) _c(Astc4x4RGBAUnorm, RGBAAstc4x4)
_c(Astc4x4RGBASrgb, SRGB8Alpha8Astc4x4) _c(Astc4x4RGBASrgb, SRGB8Alpha8Astc4x4)
_c(Astc4x4RGBAF, RGBAAstc4x4) _c(Astc4x4RGBAF, RGBAAstc4x4)

2
src/Magnum/GL/PixelFormat.cpp

@ -481,7 +481,6 @@ Debug& operator<<(Debug& debug, const CompressedPixelFormat value) {
_c(RGBABptcUnorm) _c(RGBABptcUnorm)
_c(SRGBAlphaBptcUnorm) _c(SRGBAlphaBptcUnorm)
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
_c(RGB8Etc2) _c(RGB8Etc2)
_c(SRGB8Etc2) _c(SRGB8Etc2)
_c(RGB8PunchthroughAlpha1Etc2) _c(RGB8PunchthroughAlpha1Etc2)
@ -492,7 +491,6 @@ Debug& operator<<(Debug& debug, const CompressedPixelFormat value) {
_c(SignedR11Eac) _c(SignedR11Eac)
_c(RG11Eac) _c(RG11Eac)
_c(SignedRG11Eac) _c(SignedRG11Eac)
#endif
_c(RGBS3tcDxt1) _c(RGBS3tcDxt1)
_c(SRGBS3tcDxt1) _c(SRGBS3tcDxt1)
_c(RGBAS3tcDxt1) _c(RGBAS3tcDxt1)

110
src/Magnum/GL/PixelFormat.h

@ -885,98 +885,166 @@ enum class CompressedPixelFormat: GLenum {
#endif #endif
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
/** /**
* ETC2 compressed RGB, normalized unsigned. **Available only on 2D, 2D * ETC2 compressed RGB, normalized unsigned. **Available only on 2D, 2D
* array, cube map and cube map array textures.** * array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * on OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
RGB8Etc2 = GL_COMPRESSED_RGB8_ETC2, RGB8Etc2 = GL_COMPRESSED_RGB8_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
RGB8Etc2 = 0x9274,
#endif
/** /**
* ETC2 compressed sRGB, normalized unsigned. **Available only on 2D, 2D * ETC2 compressed sRGB, normalized unsigned. **Available only on 2D, 2D
* array, cube map and cube map array textures.** * array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
SRGB8Etc2 = GL_COMPRESSED_SRGB8_ETC2, SRGB8Etc2 = GL_COMPRESSED_SRGB8_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
SRGB8Etc2 = 0x9275,
#endif
/** /**
* ETC2 compressed RGB with punchthrough (single-bit) alpha, normalized * ETC2 compressed RGB with punchthrough (single-bit) alpha, normalized
* unsigned. **Available only on 2D, 2D array, cube map and cube map array * unsigned. **Available only on 2D, 2D array, cube map and cube map array
* textures.** * textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
RGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, RGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
RGB8PunchthroughAlpha1Etc2 = 0x9276,
#endif
/** /**
* ETC2 compressed sRGB with punchthrough (single-bit) alpha, normalized * ETC2 compressed sRGB with punchthrough (single-bit) alpha, normalized
* unsigned. **Available only on 2D, 2D array, cube map and cube map array * unsigned. **Available only on 2D, 2D array, cube map and cube map array
* textures.** * textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
SRGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, SRGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
SRGB8PunchthroughAlpha1Etc2 = 0x9277,
#endif
/** /**
* ETC2/EAC compressed RGBA, normalized unsigned. **Available only on 2D, * ETC2/EAC compressed RGBA, normalized unsigned. **Available only on 2D,
* 2D array, cube map and cube map array textures.** * 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
RGBA8Etc2Eac = GL_COMPRESSED_RGBA8_ETC2_EAC, RGBA8Etc2Eac = GL_COMPRESSED_RGBA8_ETC2_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
RGBA8Etc2Eac = 0x9278,
#endif
/** /**
* ETC2/EAC compressed sRGB with alpha, normalized unsigned. **Available * ETC2/EAC compressed sRGB with alpha, normalized unsigned. **Available
* only on 2D, 2D array, cube map and cube map array textures.** * only on 2D, 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
SRGB8Alpha8Etc2Eac = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, SRGB8Alpha8Etc2Eac = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
SRGB8Alpha8Etc2Eac = 0x9279,
#endif
/** /**
* EAC compressed red channel, normalized unsigned. **Available only on 2D, * EAC compressed red channel, normalized unsigned. **Available only on 2D,
* 2D array, cube map and cube map array textures.** * 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
R11Eac = GL_COMPRESSED_R11_EAC, R11Eac = GL_COMPRESSED_R11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
R11Eac = 0x9270,
#endif
/** /**
* EAC compressed red channel, normalized signed. **Available only on 2D, * EAC compressed red channel, normalized signed. **Available only on 2D,
* 2D array, cube map and cube map array textures.** * 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
SignedR11Eac = GL_COMPRESSED_SIGNED_R11_EAC, SignedR11Eac = GL_COMPRESSED_SIGNED_R11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
SignedR11Eac = 0x9271,
#endif
/** /**
* EAC compressed red and green channel, normalized unsigned. **Available * EAC compressed red and green channel, normalized unsigned. **Available
* only on 2D, 2D array, cube map and cube map array textures.** * only on 2D, 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
RG11Eac = GL_COMPRESSED_RG11_EAC, RG11Eac = GL_COMPRESSED_RG11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
RG11Eac = 0x9272,
#endif
/** /**
* EAC compressed red and green channel, normalized signed. **Available * EAC compressed red and green channel, normalized signed. **Available
* only on 2D, 2D array, cube map and cube map array textures.** * only on 2D, 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
SignedRG11Eac = GL_COMPRESSED_SIGNED_RG11_EAC, SignedRG11Eac = GL_COMPRESSED_SIGNED_RG11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
SignedRG11Eac = 0x9273,
#endif #endif
/** /**

12
src/Magnum/GL/Test/PixelFormatTest.cpp

@ -441,12 +441,12 @@ void PixelFormatTest::mapCompressedFormatUnsupported() {
#endif #endif
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
CORRADE_VERIFY(!hasCompressedPixelFormat(Magnum::CompressedPixelFormat::Etc2RGB8Unorm)); CORRADE_VERIFY(!hasCompressedPixelFormat(Magnum::CompressedPixelFormat::Astc3x3x3RGBAUnorm));
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
compressedPixelFormat(Magnum::CompressedPixelFormat::Etc2RGB8Unorm); compressedPixelFormat(Magnum::CompressedPixelFormat::Astc3x3x3RGBAUnorm);
CORRADE_COMPARE(out.str(), "GL::compressedPixelFormat(): format CompressedPixelFormat::Etc2RGB8Unorm is not supported on this target\n"); CORRADE_COMPARE(out.str(), "GL::compressedPixelFormat(): format CompressedPixelFormat::Astc3x3x3RGBAUnorm is not supported on this target\n");
#elif !defined(MAGNUM_TARGET_GLES) #elif !defined(MAGNUM_TARGET_GLES)
CORRADE_VERIFY(!hasCompressedPixelFormat(Magnum::CompressedPixelFormat::PvrtcRGB2bppUnorm)); CORRADE_VERIFY(!hasCompressedPixelFormat(Magnum::CompressedPixelFormat::PvrtcRGB2bppUnorm));
@ -490,12 +490,12 @@ void PixelFormatTest::mapCompressedTextureFormatUnsupported() {
#endif #endif
#ifdef MAGNUM_TARGET_GLES2 #ifdef MAGNUM_TARGET_GLES2
CORRADE_VERIFY(!hasTextureFormat(Magnum::CompressedPixelFormat::Etc2RGB8Unorm)); CORRADE_VERIFY(!hasTextureFormat(Magnum::CompressedPixelFormat::Astc3x3x3RGBAUnorm));
std::ostringstream out; std::ostringstream out;
Error redirectError{&out}; Error redirectError{&out};
textureFormat(Magnum::CompressedPixelFormat::Etc2RGB8Unorm); textureFormat(Magnum::CompressedPixelFormat::Astc3x3x3RGBAUnorm);
CORRADE_COMPARE(out.str(), "GL::textureFormat(): format CompressedPixelFormat::Etc2RGB8Unorm is not supported on this target\n"); CORRADE_COMPARE(out.str(), "GL::textureFormat(): format CompressedPixelFormat::Astc3x3x3RGBAUnorm is not supported on this target\n");
#elif !defined(MAGNUM_TARGET_GLES) #elif !defined(MAGNUM_TARGET_GLES)
CORRADE_VERIFY(!hasTextureFormat(Magnum::CompressedPixelFormat::PvrtcRGB2bppUnorm)); CORRADE_VERIFY(!hasTextureFormat(Magnum::CompressedPixelFormat::PvrtcRGB2bppUnorm));

2
src/Magnum/GL/TextureFormat.cpp

@ -183,7 +183,6 @@ Debug& operator<<(Debug& debug, const TextureFormat value) {
_c(CompressedRGBABptcUnorm) _c(CompressedRGBABptcUnorm)
_c(CompressedSRGBAlphaBptcUnorm) _c(CompressedSRGBAlphaBptcUnorm)
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
_c(CompressedRGB8Etc2) _c(CompressedRGB8Etc2)
_c(CompressedSRGB8Etc2) _c(CompressedSRGB8Etc2)
_c(CompressedRGB8PunchthroughAlpha1Etc2) _c(CompressedRGB8PunchthroughAlpha1Etc2)
@ -194,7 +193,6 @@ Debug& operator<<(Debug& debug, const TextureFormat value) {
_c(CompressedSignedR11Eac) _c(CompressedSignedR11Eac)
_c(CompressedRG11Eac) _c(CompressedRG11Eac)
_c(CompressedSignedRG11Eac) _c(CompressedSignedRG11Eac)
#endif
_c(CompressedRGBS3tcDxt1) _c(CompressedRGBS3tcDxt1)
_c(CompressedSRGBS3tcDxt1) _c(CompressedSRGBS3tcDxt1)
_c(CompressedRGBAS3tcDxt1) _c(CompressedRGBAS3tcDxt1)

110
src/Magnum/GL/TextureFormat.h

@ -1306,98 +1306,166 @@ enum class TextureFormat: GLenum {
#endif #endif
#endif #endif
#ifndef MAGNUM_TARGET_GLES2
/** /**
* ETC2 compressed RGB, normalized unsigned. **Available only on 2D, 2D * ETC2 compressed RGB, normalized unsigned. **Available only on 2D, 2D
* array, cube map and cube map array textures.** * array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedRGB8Etc2 = GL_COMPRESSED_RGB8_ETC2, CompressedRGB8Etc2 = GL_COMPRESSED_RGB8_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedRGB8Etc2 = 0x9274,
#endif
/** /**
* ETC2 compressed sRGB, normalized unsigned. **Available only on 2D, 2D * ETC2 compressed sRGB, normalized unsigned. **Available only on 2D, 2D
* array, cube map and cube map array textures.** * array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedSRGB8Etc2 = GL_COMPRESSED_SRGB8_ETC2, CompressedSRGB8Etc2 = GL_COMPRESSED_SRGB8_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedSRGB8Etc2 = 0x9275,
#endif
/** /**
* ETC2 compressed RGB with punchthrough (single-bit) alpha, normalized * ETC2 compressed RGB with punchthrough (single-bit) alpha, normalized
* unsigned. **Available only on 2D, 2D array, cube map and cube map array * unsigned. **Available only on 2D, 2D array, cube map and cube map array
* textures.** * textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedRGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, CompressedRGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedRGB8PunchthroughAlpha1Etc2 = 0x9276,
#endif
/** /**
* ETC2 compressed sRGB with punchthrough (single-bit) alpha, normalized * ETC2 compressed sRGB with punchthrough (single-bit) alpha, normalized
* unsigned. **Available only on 2D, 2D array, cube map and cube map array * unsigned. **Available only on 2D, 2D array, cube map and cube map array
* textures.** * textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedSRGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, CompressedSRGB8PunchthroughAlpha1Etc2 = GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedSRGB8PunchthroughAlpha1Etc2 = 0x9277,
#endif
/** /**
* ETC2/EAC compressed RGBA, normalized unsigned. **Available only on 2D, * ETC2/EAC compressed RGBA, normalized unsigned. **Available only on 2D,
* 2D array, cube map and cube map array textures.** * 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedRGBA8Etc2Eac = GL_COMPRESSED_RGBA8_ETC2_EAC, CompressedRGBA8Etc2Eac = GL_COMPRESSED_RGBA8_ETC2_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedRGBA8Etc2Eac = 0x9278,
#endif
/** /**
* ETC2/EAC compressed sRGB with alpha, normalized unsigned. **Available * ETC2/EAC compressed sRGB with alpha, normalized unsigned. **Available
* only on 2D, 2D array, cube map and cube map array textures.** * only on 2D, 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedSRGB8Alpha8Etc2Eac = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, CompressedSRGB8Alpha8Etc2Eac = GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedSRGB8Alpha8Etc2Eac = 0x9279,
#endif
/** /**
* EAC compressed red channel, normalized unsigned. **Available only on 2D, * EAC compressed red channel, normalized unsigned. **Available only on 2D,
* 2D array, cube map and cube map array textures.** * 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedR11Eac = GL_COMPRESSED_R11_EAC, CompressedR11Eac = GL_COMPRESSED_R11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedR11Eac = 0x9270,
#endif
/** /**
* EAC compressed red channel, normalized signed. **Available only on 2D, * EAC compressed red channel, normalized signed. **Available only on 2D,
* 2D array, cube map and cube map array textures.** * 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedSignedR11Eac = GL_COMPRESSED_SIGNED_R11_EAC, CompressedSignedR11Eac = GL_COMPRESSED_SIGNED_R11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedSignedR11Eac = 0x9271,
#endif
/** /**
* EAC compressed red and green channel, normalized unsigned. **Available * EAC compressed red and green channel, normalized unsigned. **Available
* only on 2D, 2D array, cube map and cube map array textures.** * only on 2D, 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedRG11Eac = GL_COMPRESSED_RG11_EAC, CompressedRG11Eac = GL_COMPRESSED_RG11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedRG11Eac = 0x9272,
#endif
/** /**
* EAC compressed red and green channel, normalized signed. **Available * EAC compressed red and green channel, normalized signed. **Available
* only on 2D, 2D array, cube map and cube map array textures.** * only on 2D, 2D array, cube map and cube map array textures.**
* @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility} * @requires_gl43 Extension @gl_extension{ARB,ES3_compatibility}
* @requires_gles30 ETC2 texture compression is not available in OpenGL ES * @requires_gles30 Extension @m_class{m-doc-external} [ANGLE_compressed_texture_etc](https://chromium.googlesource.com/angle/angle/+/master/extensions/ANGLE_compressed_texture_etc.txt)
* 2.0. * in OpenGL ES 2.0.
* @requires_webgl_extension Extension @webgl_extension{WEBGL,compressed_texture_etc}
*/ */
#ifndef MAGNUM_TARGET_GLES2
CompressedSignedRG11Eac = GL_COMPRESSED_SIGNED_RG11_EAC, CompressedSignedRG11Eac = GL_COMPRESSED_SIGNED_RG11_EAC,
#else
/* ANGLE_compressed_texture_etc is not listed in gl_angle_ext.xml so we
have to hardcode; on ES3 (and thus WebGL 2) it's in the core header */
CompressedSignedRG11Eac = 0x9273,
#endif #endif
/** /**

4
src/MagnumExternal/OpenGL/GLES2/Emscripten/extensions.txt vendored

@ -42,6 +42,10 @@ extension KHR_blend_equation_advanced optional
extension ANGLE_multi_draw optional extension ANGLE_multi_draw optional
# Base for WEBGL_{multi_,}draw_instanced_base_vertex_base_instance # Base for WEBGL_{multi_,}draw_instanced_base_vertex_base_instance
extension ANGLE_base_vertex_base_instance optional extension ANGLE_base_vertex_base_instance optional
# Base for WEBGL_compressed_texture_etc. Haha you wish, OF COURSE it's not
# included in gl_angle_ext.xml so I have to hardcode the numeric values there.
# GOOGLE!!!
# extension ANGLE_compressed_texture_etc optional
begin functions blacklist begin functions blacklist
# Not present in WEBGL_blend_equation_advanced_coherent # Not present in WEBGL_blend_equation_advanced_coherent

3
src/MagnumExternal/OpenGL/GLES2/extensions.txt vendored

@ -113,6 +113,9 @@ extension OES_draw_elements_base_vertex optional
# From the gl_angle_ext file # From the gl_angle_ext file
extension ANGLE_multi_draw optional extension ANGLE_multi_draw optional
# Haha you wish, OF COURSE it's not included in gl_angle_ext.xml so I have to
# hardcode the numeric values there. GOOGLE!!!
# extension ANGLE_compressed_texture_etc optional
begin functions blacklist begin functions blacklist
# These are listed in EXT_separate_shader_objects with only the comment # These are listed in EXT_separate_shader_objects with only the comment

3
src/MagnumExternal/OpenGL/GLES3/Emscripten/extensions.txt vendored

@ -31,6 +31,9 @@ extension KHR_blend_equation_advanced optional
# From the gl_angle_ext file, base for WEBGL_multi_draw etc # From the gl_angle_ext file, base for WEBGL_multi_draw etc
extension ANGLE_multi_draw optional extension ANGLE_multi_draw optional
extension ANGLE_base_vertex_base_instance optional extension ANGLE_base_vertex_base_instance optional
# Haha you wish, OF COURSE it's not included in gl_angle_ext.xml. But
# fortunately ES3 defines these constants on its own so I don't need it anyway.
# extension ANGLE_compressed_texture_etc optional
begin functions blacklist begin functions blacklist
# Not present in WEBGL_blend_equation_advanced_coherent # Not present in WEBGL_blend_equation_advanced_coherent

3
src/MagnumExternal/OpenGL/GLES3/extensions.txt vendored

@ -93,5 +93,8 @@ extension OVR_multiview2 optional
# From the gl_angle_ext file # From the gl_angle_ext file
extension ANGLE_multi_draw optional extension ANGLE_multi_draw optional
extension ANGLE_base_vertex_base_instance optional extension ANGLE_base_vertex_base_instance optional
# Haha you wish, OF COURSE it's not included in gl_angle_ext.xml. But
# fortunately ES3 defines these constants on its own so I don't need it anyway.
# extension ANGLE_compressed_texture_etc optional
# kate: hl python # kate: hl python

Loading…
Cancel
Save