diff --git a/doc/opengl-support.dox b/doc/opengl-support.dox index c6c07001d..be3879ab4 100644 --- a/doc/opengl-support.dox +++ b/doc/opengl-support.dox @@ -524,7 +524,6 @@ namespace on @ref MAGNUM_TARGET_GLES2 "WebGL 2.0 builds". Extension | Status ------------------------------------------- | ------ @webgl_extension{ANGLE,instanced_arrays} | done -@webgl_extension{EXT,color_buffer_half_float} | | @webgl_extension{EXT,frag_depth} | done (shading language only) @webgl_extension{EXT,sRGB} | done @webgl_extension{EXT,blend_minmax} | done @@ -553,6 +552,7 @@ Extension | Status Extension | Status ------------------------------------------- | ------ @webgl_extension{EXT,texture_filter_anisotropic} | done +@webgl_extension{EXT,color_buffer_half_float} | | @webgl_extension{EXT,disjoint_timer_query} | only time elapsed query @webgl_extension{EXT,disjoint_timer_query_webgl2} | [missing support in Emscripten](https://github.com/emscripten-core/emscripten/pull/9652) @webgl_extension{EXT,color_buffer_float} | | diff --git a/src/Magnum/GL/Context.cpp b/src/Magnum/GL/Context.cpp index 1915328dc..b15b5a0fd 100644 --- a/src/Magnum/GL/Context.cpp +++ b/src/Magnum/GL/Context.cpp @@ -271,6 +271,7 @@ constexpr Extension ExtensionList[]{ #ifndef MAGNUM_TARGET_GLES2 Extensions::EXT::color_buffer_float{}, #endif + Extensions::EXT::color_buffer_half_float{}, #ifdef MAGNUM_TARGET_GLES2 Extensions::EXT::disjoint_timer_query{}, #endif @@ -311,7 +312,6 @@ constexpr Extension ExtensionListES300[]{ #ifdef MAGNUM_TARGET_GLES2 Extensions::ANGLE::instanced_arrays{}, Extensions::EXT::blend_minmax{}, - Extensions::EXT::color_buffer_half_float{}, Extensions::EXT::frag_depth{}, Extensions::EXT::sRGB{}, Extensions::EXT::shader_texture_lod{}, diff --git a/src/Magnum/GL/Extensions.h b/src/Magnum/GL/Extensions.h index 31f9b4cf4..9c2750da1 100644 --- a/src/Magnum/GL/Extensions.h +++ b/src/Magnum/GL/Extensions.h @@ -275,9 +275,7 @@ namespace ANGLE { #endif } namespace EXT { _extension( 2,EXT,texture_filter_anisotropic, GLES200, None) // #11 - #ifdef MAGNUM_TARGET_GLES2 _extension( 3,EXT,color_buffer_half_float, GLES200, None) // #14 - #endif #ifdef MAGNUM_TARGET_GLES2 _extension( 4,EXT,frag_depth, GLES200, GLES300) // #16 _extension( 5,EXT,sRGB, GLES200, GLES300) // #17 diff --git a/src/Magnum/GL/PixelFormat.h b/src/Magnum/GL/PixelFormat.h index 7700ebd62..11902026b 100644 --- a/src/Magnum/GL/PixelFormat.h +++ b/src/Magnum/GL/PixelFormat.h @@ -433,8 +433,10 @@ enum class PixelType: GLenum { * use for texture reading in WebGL 1.0. * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * for filtering the texture using @ref SamplerFilter::Linear. - * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_half_float} - * to use the texture as a render target. + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_half_float} in WebGL 1.0 and 2.0 + * or @webgl_extension{EXT,color_buffer_float} in WebGL 2.0 to use the + * texture as a render target. */ #ifndef MAGNUM_TARGET_GLES2 Half = GL_HALF_FLOAT, @@ -462,9 +464,10 @@ enum class PixelType: GLenum { * for texture reading in WebGL 1.0. * @requires_webgl_extension Extension @webgl_extension{OES,texture_float_linear} * for filtering the texture using @ref SamplerFilter::Linear. - * @requires_webgl_extension Extension @webgl_extension{WEBGL,color_buffer_float} - * in WebGL 1.0 or @webgl_extension{EXT,color_buffer_float} in WebGL - * 2.0 to use the texture as a render target. + * @requires_webgl_extension Extension + * @webgl_extension{WEBGL,color_buffer_float} in WebGL 1.0 or + * @webgl_extension{EXT,color_buffer_float} in WebGL 2.0 to use the + * texture as a render target. */ Float = GL_FLOAT, @@ -593,6 +596,8 @@ enum class PixelType: GLenum { * @requires_gles30 Only 8bit and 16bit types are available in OpenGL ES * 2.0. * @requires_webgl20 Only 8bit and 16bit types are available in WebGL 1.0. + * @requires_webgl_extension @webgl_extension{EXT,color_buffer_float} in + * WebGL 2.0 to use the texture as a render target. */ UnsignedInt5999Rev = GL_UNSIGNED_INT_5_9_9_9_REV, #endif diff --git a/src/Magnum/GL/RenderbufferFormat.h b/src/Magnum/GL/RenderbufferFormat.h index 0a0a3182a..b6d0ec9d8 100644 --- a/src/Magnum/GL/RenderbufferFormat.h +++ b/src/Magnum/GL/RenderbufferFormat.h @@ -408,9 +408,11 @@ enum class RenderbufferFormat: GLenum { * @requires_webgl20 Not defined in WebGL 1.0 builds. Only four-component * half-float formats can be ised as a render target in WebGL 1.0, see * @ref RenderbufferFormat::RGBA16F for more information. - * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} - * in WebGL 2.0. Use @ref RenderbufferFormat::R16UI or - * @ref RenderbufferFormat::R16I instead if not available. + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_half_float} or + * @webgl_extension{EXT,color_buffer_float} in WebGL 2.0. Use + * @ref RenderbufferFormat::R16UI or @ref RenderbufferFormat::R16I + * instead if not available. */ #ifndef MAGNUM_TARGET_GLES2 R16F = GL_R16F, @@ -427,9 +429,11 @@ enum class RenderbufferFormat: GLenum { * @requires_webgl20 Not defined in WebGL 1.0 builds. Only four-component * half-float formats can be ised as a render target in WebGL 1.0, see * @ref RenderbufferFormat::RGBA16F for more information. - * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} - * in WebGL 2.0. Use @ref RenderbufferFormat::RG16UI or - * @ref RenderbufferFormat::RG16I instead if not available. + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_half_float} or + * @webgl_extension{EXT,color_buffer_float} in WebGL 2.0. Use + * @ref RenderbufferFormat::RG16UI or @ref RenderbufferFormat::RG16I + * instead if not available. */ #ifndef MAGNUM_TARGET_GLES2 RG16F = GL_RG16F, @@ -444,10 +448,11 @@ enum class RenderbufferFormat: GLenum { * @requires_gles32 Extension @gl_extension{EXT,color_buffer_half_float}. Use * @ref RenderbufferFormat::RGBA16UI or @ref RenderbufferFormat::RGBA16I * instead if not available. - * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_half_float} - * in WebGL 1.0, @webgl_extension{EXT,color_buffer_half_float} in - * WebGL 2.0. Use @ref RenderbufferFormat::RGBA16UI or - * @ref RenderbufferFormat::RGBA16I instead if not available. + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_half_float} in WebGL 1.0 and 2.0 + * or @webgl_extension{EXT,color_buffer_float} in WebGL 2.0. Use + * @ref RenderbufferFormat::RGBA16UI or @ref RenderbufferFormat::RGBA16I + * instead if not available. */ #ifndef MAGNUM_TARGET_GLES2 RGBA16F = GL_RGBA16F, diff --git a/src/Magnum/GL/Test/ContextTest.cpp b/src/Magnum/GL/Test/ContextTest.cpp index af5c0132a..d8078e8d3 100644 --- a/src/Magnum/GL/Test/ContextTest.cpp +++ b/src/Magnum/GL/Test/ContextTest.cpp @@ -421,9 +421,8 @@ void ContextTest::extensions() { CORRADE_VERIFY(Int(e.coreVersion()) >= Int(e.requiredVersion())); bool coreVersionMismatch = e.coreVersion() != version #if defined(MAGNUM_TARGET_GLES2) && defined(MAGNUM_TARGET_WEBGL) - /* These two are replaced by EXT_color_buffer_float for 2.0, - but aren't core in WebGL 2 */ - && e.index() != Extensions::EXT::color_buffer_half_float::Index + /* Replaced by EXT_color_buffer_float for 2.0 but not core in + WebGL 2 */ && e.index() != Extensions::WEBGL::color_buffer_float::Index #endif ; diff --git a/src/Magnum/GL/TextureFormat.h b/src/Magnum/GL/TextureFormat.h index 3e34f77ca..9a870c0e3 100644 --- a/src/Magnum/GL/TextureFormat.h +++ b/src/Magnum/GL/TextureFormat.h @@ -739,9 +739,11 @@ enum class TextureFormat: GLenum { * in WebGL 1.0. * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * for filtering using @ref SamplerFilter::Linear in WebGL 1.0. - * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} - * to use as a render target in WebGL 2.0; use @ref TextureFormat::R16UI - * or @ref TextureFormat::R16I instead if not available. Only three- + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_half_float} or + * @webgl_extension{EXT,color_buffer_float} to use as a render target + * in WebGL 2.0; use @ref TextureFormat::R16UI or + * @ref TextureFormat::R16I instead if not available. Only three- * and four-component half-float texture formats can be used as * a render target in WebGL 1.0, see @ref TextureFormat::RGBA16F for * more information. @@ -767,9 +769,11 @@ enum class TextureFormat: GLenum { * in WebGL 1.0 instead. * @requires_webgl20 Extension @webgl_extension{OES,texture_half_float_linear} * for filtering using @ref SamplerFilter::Linear in WebGL 1.0. - * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} - * to use as a render target in WebGL 2.0; use @ref TextureFormat::RG16UI - * or @ref TextureFormat::RG16I instead if not available. Only three- + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_half_float} or + * @webgl_extension{EXT,color_buffer_float} to use as a render target + * in WebGL 2.0; use @ref TextureFormat::RG16UI or + * @ref TextureFormat::RG16I instead if not available. Only three- * and four-component half-float texture formats can be used as * a render target in WebGL 1.0, see @ref TextureFormat::RGBA16F for * more information. @@ -813,11 +817,14 @@ enum class TextureFormat: GLenum { * @requires_webgl20 Use @ref TextureFormat::RGBA in combination with * @ref PixelType::Half (@webgl_extension{OES,texture_half_float}) in * WebGL 1.0 instead. - * @requires_webgl_extension Extension @webgl_extension{EXT,color_buffer_float} - * to use as a render target in WebGL 2.0. Use @ref TextureFormat::RGBA16UI - * or @ref TextureFormat::RGBA16I instead if not available. Use + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_half_float} or + * @webgl_extension{EXT,color_buffer_float} to use as a render target + * in WebGL 2.0. Use @ref TextureFormat::RGBA16UI or + * @ref TextureFormat::RGBA16I instead if not available. Use * @ref TextureFormat::RGBA in combination with @ref PixelType::Half - * (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0 instead. + * (@webgl_extension{EXT,color_buffer_half_float}) in WebGL 1.0 + * instead. */ RGBA16F = GL_RGBA16F, @@ -1014,6 +1021,9 @@ enum class TextureFormat: GLenum { * OpenGL ES 2.0. * @requires_webgl20 Only normalized integral formats are available in * WebGL 1.0. + * @requires_webgl_extension Extension + * @webgl_extension{EXT,color_buffer_float} to use as a render target + * in WebGL 2.0. */ R11FG11FB10F = GL_R11F_G11F_B10F,