diff --git a/doc/changelog.dox b/doc/changelog.dox index b5249d819..c345876d0 100644 --- a/doc/changelog.dox +++ b/doc/changelog.dox @@ -435,6 +435,10 @@ See also: @ref Corrade::Containers::ArrayView are now removed. This should have a significant positive effect on compile times of code using the @ref GL, @ref Audio, @ref Trade and @ref Text libraries +- @ref GL::TextureFormat::SR8 and @ref GL::TextureFormat::SRG8 were present + on ES2 builds by mistake --- the @gl_extension{EXT,texture_sRGB_R8} and + @gl_extension{EXT,texture_sRGB_RG8} extensions require OpenGL ES 3.0 at + least - @ref SceneGraph::Object::addChild() no longer requires the type constructor to have the last parameter a parent object object pointer, as that was quite limiting. Instead it's calling @ref SceneGraph::Object::setParent() diff --git a/src/Magnum/GL/AbstractTexture.cpp b/src/Magnum/GL/AbstractTexture.cpp index 606424ae3..275035e57 100644 --- a/src/Magnum/GL/AbstractTexture.cpp +++ b/src/Magnum/GL/AbstractTexture.cpp @@ -561,7 +561,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::R8Snorm: #endif - #ifndef MAGNUM_TARGET_WEBGL + #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2) case TextureFormat::SR8: #endif #ifndef MAGNUM_TARGET_GLES2 @@ -611,7 +611,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) { #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::RG8Snorm: #endif - #ifdef MAGNUM_TARGET_GLES + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) case TextureFormat::SRG8: #endif #ifndef MAGNUM_TARGET_GLES2 @@ -929,8 +929,10 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) { case TextureFormat::LuminanceAlpha: #endif #ifndef MAGNUM_TARGET_WEBGL + #ifndef MAGNUM_TARGET_GLES2 case TextureFormat::SR8: - #ifdef MAGNUM_TARGET_GLES + #endif + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) case TextureFormat::SRG8: #endif #endif diff --git a/src/Magnum/GL/TextureFormat.cpp b/src/Magnum/GL/TextureFormat.cpp index d2f7ab08e..6d43e02e4 100644 --- a/src/Magnum/GL/TextureFormat.cpp +++ b/src/Magnum/GL/TextureFormat.cpp @@ -64,8 +64,10 @@ Debug& operator<<(Debug& debug, const TextureFormat value) { _c(RGBA8) #endif #ifndef MAGNUM_TARGET_WEBGL + #ifndef MAGNUM_TARGET_GLES2 _c(SR8) - #ifdef MAGNUM_TARGET_GLES + #endif + #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2) _c(SRG8) #endif #endif diff --git a/src/Magnum/GL/TextureFormat.h b/src/Magnum/GL/TextureFormat.h index d38bc333c..a9638cf0a 100644 --- a/src/Magnum/GL/TextureFormat.h +++ b/src/Magnum/GL/TextureFormat.h @@ -196,21 +196,25 @@ enum class TextureFormat: GLenum { #endif #ifndef MAGNUM_TARGET_WEBGL + #ifndef MAGNUM_TARGET_GLES2 /** * sRGB-encoded red component, normalized unsigned byte. * @requires_extension Extension @gl_extension{EXT,texture_sRGB_R8} - * @requires_es_extension Extension @gl_extension{EXT,texture_sRGB_R8} + * @requires_es_extension OpenGL ES 3.0 and extension + * @gl_extension{EXT,texture_sRGB_R8} * @requires_gles One- and two-component sRGB texture formats are not * available in WebGL, use @ref TextureFormat::SRGB8 or * @ref TextureFormat::SRGB8Alpha8 * @m_since{2019,10} */ SR8 = GL_SR8_EXT, + #endif - #if defined(MAGNUM_TARGET_GLES) || defined(DOXYGEN_GENERATING_OUTPUT) + #if (defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2)) || defined(DOXYGEN_GENERATING_OUTPUT) /** * sRGB-encoded red and green component, normalized unsigned byte. - * @requires_es_extension Extension @gl_extension{EXT,texture_sRGB_RG8} + * @requires_es_extension OpenGL ES 3.0 and extension + * @gl_extension{EXT,texture_sRGB_RG8} * @requires_gles One- and two-component sRGB texture formats are not * available in WebGL, use @ref TextureFormat::SRGB8 or * @ref TextureFormat::SRGB8Alpha8 instead. Only diff --git a/src/MagnumExternal/OpenGL/GLES2/extensions.txt b/src/MagnumExternal/OpenGL/GLES2/extensions.txt index a54bd2612..8f8a361d0 100644 --- a/src/MagnumExternal/OpenGL/GLES2/extensions.txt +++ b/src/MagnumExternal/OpenGL/GLES2/extensions.txt @@ -87,8 +87,6 @@ extension EXT_texture_sRGB_decode optional extension EXT_sRGB_write_control optional extension EXT_texture_compression_s3tc optional extension EXT_pvrtc_sRGB optional -extension EXT_texture_sRGB_R8 optional -extension EXT_texture_sRGB_RG8 optional extension EXT_polygon_offset_clamp optional extension EXT_texture_compression_s3tc_srgb optional extension IMG_texture_compression_pvrtc optional diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGL.h b/src/MagnumExternal/OpenGL/GLES2/flextGL.h index 12380c2e8..9e51a4eae 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGL.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGL.h @@ -988,14 +988,6 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0 #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 -/* GL_EXT_texture_sRGB_R8 */ - -#define GL_SR8_EXT 0x8FBD - -/* GL_EXT_texture_sRGB_RG8 */ - -#define GL_SRG8_EXT 0x8FBE - /* GL_EXT_polygon_offset_clamp */ #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B diff --git a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h index a58fd626d..2ab6ff922 100644 --- a/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h +++ b/src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h @@ -983,14 +983,6 @@ typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLen #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV2_IMG 0x93F0 #define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 -/* GL_EXT_texture_sRGB_R8 */ - -#define GL_SR8_EXT 0x8FBD - -/* GL_EXT_texture_sRGB_RG8 */ - -#define GL_SRG8_EXT 0x8FBE - /* GL_EXT_polygon_offset_clamp */ #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B