Browse Source

GL: TextureFormat::SR[G]8 aren't supposed to be available on ES2.

pull/495/head
Vladimír Vondruš 5 years ago
parent
commit
08893165f2
  1. 4
      doc/changelog.dox
  2. 8
      src/Magnum/GL/AbstractTexture.cpp
  3. 4
      src/Magnum/GL/TextureFormat.cpp
  4. 10
      src/Magnum/GL/TextureFormat.h
  5. 2
      src/MagnumExternal/OpenGL/GLES2/extensions.txt
  6. 8
      src/MagnumExternal/OpenGL/GLES2/flextGL.h
  7. 8
      src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h

4
doc/changelog.dox

@ -435,6 +435,10 @@ See also:
@ref Corrade::Containers::ArrayView are now removed. This should have a @ref Corrade::Containers::ArrayView are now removed. This should have a
significant positive effect on compile times of code using the @ref GL, significant positive effect on compile times of code using the @ref GL,
@ref Audio, @ref Trade and @ref Text libraries @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 - @ref SceneGraph::Object::addChild() no longer requires the type constructor
to have the last parameter a parent object object pointer, as that was to have the last parameter a parent object object pointer, as that was
quite limiting. Instead it's calling @ref SceneGraph::Object::setParent() quite limiting. Instead it's calling @ref SceneGraph::Object::setParent()

8
src/Magnum/GL/AbstractTexture.cpp

@ -561,7 +561,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
case TextureFormat::R8Snorm: case TextureFormat::R8Snorm:
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #if !defined(MAGNUM_TARGET_WEBGL) && !defined(MAGNUM_TARGET_GLES2)
case TextureFormat::SR8: case TextureFormat::SR8:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -611,7 +611,7 @@ PixelFormat pixelFormatForInternalFormat(const TextureFormat internalFormat) {
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
case TextureFormat::RG8Snorm: case TextureFormat::RG8Snorm:
#endif #endif
#ifdef MAGNUM_TARGET_GLES #if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2)
case TextureFormat::SRG8: case TextureFormat::SRG8:
#endif #endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
@ -929,8 +929,10 @@ PixelType pixelTypeForInternalFormat(const TextureFormat internalFormat) {
case TextureFormat::LuminanceAlpha: case TextureFormat::LuminanceAlpha:
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
#ifndef MAGNUM_TARGET_GLES2
case TextureFormat::SR8: case TextureFormat::SR8:
#ifdef MAGNUM_TARGET_GLES #endif
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2)
case TextureFormat::SRG8: case TextureFormat::SRG8:
#endif #endif
#endif #endif

4
src/Magnum/GL/TextureFormat.cpp

@ -64,8 +64,10 @@ Debug& operator<<(Debug& debug, const TextureFormat value) {
_c(RGBA8) _c(RGBA8)
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
#ifndef MAGNUM_TARGET_GLES2
_c(SR8) _c(SR8)
#ifdef MAGNUM_TARGET_GLES #endif
#if defined(MAGNUM_TARGET_GLES) && !defined(MAGNUM_TARGET_GLES2)
_c(SRG8) _c(SRG8)
#endif #endif
#endif #endif

10
src/Magnum/GL/TextureFormat.h

@ -196,21 +196,25 @@ enum class TextureFormat: GLenum {
#endif #endif
#ifndef MAGNUM_TARGET_WEBGL #ifndef MAGNUM_TARGET_WEBGL
#ifndef MAGNUM_TARGET_GLES2
/** /**
* sRGB-encoded red component, normalized unsigned byte. * sRGB-encoded red component, normalized unsigned byte.
* @requires_extension Extension @gl_extension{EXT,texture_sRGB_R8} * @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 * @requires_gles One- and two-component sRGB texture formats are not
* available in WebGL, use @ref TextureFormat::SRGB8 or * available in WebGL, use @ref TextureFormat::SRGB8 or
* @ref TextureFormat::SRGB8Alpha8 * @ref TextureFormat::SRGB8Alpha8
* @m_since{2019,10} * @m_since{2019,10}
*/ */
SR8 = GL_SR8_EXT, 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. * 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 * @requires_gles One- and two-component sRGB texture formats are not
* available in WebGL, use @ref TextureFormat::SRGB8 or * available in WebGL, use @ref TextureFormat::SRGB8 or
* @ref TextureFormat::SRGB8Alpha8 instead. Only * @ref TextureFormat::SRGB8Alpha8 instead. Only

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

@ -87,8 +87,6 @@ extension EXT_texture_sRGB_decode optional
extension EXT_sRGB_write_control optional extension EXT_sRGB_write_control optional
extension EXT_texture_compression_s3tc optional extension EXT_texture_compression_s3tc optional
extension EXT_pvrtc_sRGB 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_polygon_offset_clamp optional
extension EXT_texture_compression_s3tc_srgb optional extension EXT_texture_compression_s3tc_srgb optional
extension IMG_texture_compression_pvrtc optional extension IMG_texture_compression_pvrtc optional

8
src/MagnumExternal/OpenGL/GLES2/flextGL.h vendored

@ -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_2BPPV2_IMG 0x93F0
#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 #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 */ /* GL_EXT_polygon_offset_clamp */
#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B

8
src/MagnumExternal/OpenGL/GLES2/flextGLWindowsDesktop.h vendored

@ -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_2BPPV2_IMG 0x93F0
#define GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV2_IMG 0x93F1 #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 */ /* GL_EXT_polygon_offset_clamp */
#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B #define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B

Loading…
Cancel
Save