Browse Source

GL: hey, let's rename WebGL extensions, why not!

The web isn't broken enough yet, apparently. Support for both of those
extensions was added in early 2020 (and I think I remember even seeing
them listed as supported in some browsers), one of them was renamed
mere two months later, one in January 2023.

And I discovered just by accident, the browsers *of course* don't even
bother advertising both to have some transition period. Or maybe that
transition period happened, for 3 weeks in January, and if some
developer didn't notice in that time, "it's their fault". Or maybe it's
my fault, for attempting to use an extension that was stuck in a "draft
status" for four years. THE WHOLE WEB IS EITHER IN A "DRAFT STATUS" OR
"DEPRECATED", THERE'S NOTHING IN BETWEEN, FFS!

Constant needless churn, UGH.
pull/168/head
Vladimír Vondruš 3 years ago
parent
commit
c0c4062daf
  1. 5
      doc/changelog.dox
  2. 4
      doc/opengl-support.dox
  3. 6
      src/Magnum/GL/Context.cpp
  4. 20
      src/Magnum/GL/Extensions.h
  5. 63
      src/Magnum/GL/Renderer.h

5
doc/changelog.dox

@ -570,6 +570,11 @@ See also:
@ref MAGNUM_GL_ABSTRACTSHADERPROGRAM_SUBCLASS_DISPATCH_IMPLEMENTATION()
macros for easier and more robust implementation of method chaining in
@ref GL::AbstractShaderProgram subclasses
- Recognizing @webgl_extension{OES,draw_buffers_indexed} and
@webgl_extension{WEBGL,clip_cull_distance} WebGL extensions that were
renamed from `EXT_draw_buffers_indexed` and `EXT_clip_cull_distance` in
March 2020 and January 2023. The old names are still recognized and present
in @ref GL::Extensions for compatibility with older browsers.
@subsubsection changelog-latest-changes-math Math library

4
doc/opengl-support.dox

@ -564,11 +564,10 @@ Extension | Status
@webgl_extension{EXT,float_blend} | |
@webgl_extension{EXT,texture_compression_rgtc} | done
@webgl_extension{EXT,texture_compression_bptc} | done
@webgl_extension{EXT,clip_cull_distance} | done
@webgl_extension{EXT,texture_norm16} | done
@webgl_extension{EXT,draw_buffers_indexed} | done
@webgl_extension{KHR,parallel_shader_compile} | done
@webgl_extension{OES,texture_float_linear} | done
@webgl_extension{OES,draw_buffers_indexed} \n (originally named `EXT_draw_buffers_indexed`) | done
@webgl_extension{OVR,multiview2} | |
@webgl_extension{WEBGL,lose_context} | |
@webgl_extension{WEBGL,debug_renderer_info} | done
@ -580,6 +579,7 @@ Extension | Status
@webgl_extension{WEBGL,compressed_texture_s3tc_srgb} | done
@webgl_extension{WEBGL,multi_draw} | done
@webgl_extension{WEBGL,blend_equation_advanced_coherent} | done
@webgl_extension{WEBGL,clip_cull_distance} \n (originally named `EXT_clip_cull_distance`) | done
@webgl_extension{WEBGL,draw_instanced_base_vertex_base_instance} | done
@webgl_extension{WEBGL,multi_draw_instanced_base_vertex_base_instance} | done

6
src/Magnum/GL/Context.cpp

@ -294,11 +294,17 @@ constexpr Extension ExtensionList[]{
Extensions::EXT::texture_norm16{},
#endif
Extensions::KHR::parallel_shader_compile{},
#ifndef MAGNUM_TARGET_GLES2
Extensions::OES::draw_buffers_indexed{},
#endif
Extensions::OES::texture_float_linear{},
#ifndef MAGNUM_TARGET_GLES2
Extensions::OVR::multiview2{},
#endif
Extensions::WEBGL::blend_equation_advanced_coherent{},
#ifndef MAGNUM_TARGET_GLES2
Extensions::WEBGL::clip_cull_distance{},
#endif
Extensions::WEBGL::compressed_texture_astc{},
Extensions::WEBGL::compressed_texture_etc{},
Extensions::WEBGL::compressed_texture_pvrtc{},

20
src/Magnum/GL/Extensions.h

@ -300,10 +300,14 @@ namespace ANGLE {
_extension(12,EXT,texture_compression_rgtc, GLES200, None) // #38
_extension(13,EXT,texture_compression_bptc, GLES200, None) // #39
#ifndef MAGNUM_TARGET_GLES2
/* This one was renamed to WEBGL_clip_cull_distance in January 2023,
recognizing both for compatibility: https://github.com/KhronosGroup/WebGL/commit/c06fc8230ce4b1748be89ce3279cbe5348c9c9c9 */
_extension(14,EXT,clip_cull_distance, GLES300, None) // #43
_extension(15,EXT,texture_norm16, GLES300, None) // #44
#endif
#ifndef MAGNUM_TARGET_GLES2
/* This one was renamed to OES_draw_buffers_indexed in March 2020,
recognizing both for compatibility: https://github.com/KhronosGroup/WebGL/commit/00b799a56c90f94c1f4cc402f33a281ed9f43e31 */
_extension(16,EXT,draw_buffers_indexed, GLES300, None) // #45
#endif
} namespace KHR {
@ -321,6 +325,11 @@ namespace ANGLE {
_extension(26,OES,texture_half_float_linear, GLES200, GLES300) // #21
_extension(27,OES,fbo_render_mipmap, GLES200, GLES300) // #28
#endif
#ifndef MAGNUM_TARGET_GLES2
/* This one was renamed from EXT_draw_buffers_indexed in March 2020,
recognizing both for compatibility: https://github.com/KhronosGroup/WebGL/commit/00b799a56c90f94c1f4cc402f33a281ed9f43e31 */
_extension(28,OES,draw_buffers_indexed, GLES300, None) // #45
#endif
} namespace OVR {
#ifndef MAGNUM_TARGET_GLES2
_extension(30,OVR,multiview2, GLES300, None) // #36
@ -346,12 +355,17 @@ namespace ANGLE {
_extension(42,WEBGL,multi_draw, GLES200, None) // #40
_extension(43,WEBGL,blend_equation_advanced_coherent,GLES200,None) // #42
#ifndef MAGNUM_TARGET_GLES2
_extension(44,WEBGL,draw_instanced_base_vertex_base_instance,GLES300,None) // #46
_extension(45,WEBGL,multi_draw_instanced_base_vertex_base_instance,GLES300,None) // #47
/* This one was renamed from EXT_clip_cull_distance in January 2023,
recognizing both for compatibility: https://github.com/KhronosGroup/WebGL/commit/c06fc8230ce4b1748be89ce3279cbe5348c9c9c9 */
_extension(44,WEBGL,clip_cull_distance, GLES300, None) // #43
#endif
#ifndef MAGNUM_TARGET_GLES2
_extension(45,WEBGL,draw_instanced_base_vertex_base_instance,GLES300,None) // #46
_extension(46,WEBGL,multi_draw_instanced_base_vertex_base_instance,GLES300,None) // #47
#endif
} namespace MAGNUM {
#ifndef MAGNUM_TARGET_GLES2
_extension(46,MAGNUM,shader_vertex_id, GLES300, GLES300)
_extension(47,MAGNUM,shader_vertex_id, GLES300, GLES300)
#endif
}
#else

63
src/Magnum/GL/Renderer.h

@ -118,7 +118,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -141,7 +142,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -164,7 +166,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -187,7 +190,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -210,7 +214,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -233,7 +238,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -256,7 +262,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -279,7 +286,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @gl_extension{APPLE,clip_distance} or
* @gl_extension{EXT,clip_cull_distance}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,clip_cull_distance}
* @webgl_extension{WEBGL,clip_cull_distance} (originally
* named `EXT_clip_cull_distance`)
* @m_since{2020,06}
*/
#ifndef MAGNUM_TARGET_GLES
@ -557,7 +565,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl30 Extension @gl_extension{EXT,draw_buffers2}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void enable(Feature feature, UnsignedInt drawBuffer);
#endif
@ -583,7 +592,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl30 Extension @gl_extension{EXT,draw_buffers2}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void disable(Feature feature, UnsignedInt drawBuffer);
#endif
@ -613,7 +623,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl30 Extension @gl_extension{EXT,draw_buffers2}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void setFeature(Feature feature, UnsignedInt drawBuffer, bool enabled);
#endif
@ -1003,8 +1014,9 @@ class MAGNUM_GL_EXPORT Renderer {
* OpenGL calls. If neither OpenGL 3.0 nor
* @gl_extension{APPLE,clip_distance} /
* @gl_extension{EXT,clip_cull_distance} ES extension nor
* @webgl_extension{EXT,clip_cull_distance} WebGL extension is
* available, returns @cpp 0 @ce.
* @webgl_extension{WEBGL,clip_cull_distance} WebGL extension
* (originally named `EXT_clip_cull_distance`) is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_CLIP_DISTANCES}
* @requires_webgl20 Not defined in WebGL 1.0 builds.
*/
@ -1019,8 +1031,9 @@ class MAGNUM_GL_EXPORT Renderer {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither @gl_extension{ARB,cull_distance} (part of
* OpenGL 4.5) nor @gl_extension{EXT,clip_cull_distance} ES /
* @webgl_extension{EXT,clip_cull_distance} WebGL extension is
* available, returns @cpp 0 @ce.
* @webgl_extension{WEBGL,clip_cull_distance} WebGL extension
* (originally named `EXT_clip_cull_distance`) is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_CULL_DISTANCES}
* @requires_gles30 Not defined in OpenGL ES 2.0 builds.
* @requires_webgl20 Not defined in WebGL 1.0 builds.
@ -1034,8 +1047,9 @@ class MAGNUM_GL_EXPORT Renderer {
* The result is cached, repeated queries don't result in repeated
* OpenGL calls. If neither @gl_extension{ARB,cull_distance} (part of
* OpenGL 4.5) nor @gl_extension{EXT,clip_cull_distance} ES /
* @webgl_extension{EXT,clip_cull_distance} WebGL extension is
* available, returns @cpp 0 @ce.
* @webgl_extension{WEBGL,clip_cull_distance} WebGL extension
* (originally named `EXT_clip_cull_distance`) is available, returns
* @cpp 0 @ce.
* @see @fn_gl{Get} with @def_gl_keyword{MAX_COMBINED_CLIP_AND_CULL_DISTANCES}
* @requires_gles30 Not defined in OpenGL ES 2.0.
* @requires_webgl20 Not defined in WebGL 1.0 builds.
@ -1342,7 +1356,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl30 Extension @gl_extension{EXT,draw_buffers2}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void setColorMask(UnsignedInt drawBuffer, GLboolean allowRed, GLboolean allowGreen, GLboolean allowBlue, GLboolean allowAlpha);
#endif
@ -1777,7 +1792,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl40 Extension @gl_extension{ARB,draw_buffers_blend}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void setBlendEquation(UnsignedInt drawBuffer, BlendEquation equation);
#endif
@ -1806,7 +1822,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl40 Extension @gl_extension{ARB,draw_buffers_blend}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void setBlendEquation(UnsignedInt drawBuffer, BlendEquation rgb, BlendEquation alpha);
#endif
@ -1858,7 +1875,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl40 Extension @gl_extension{ARB,draw_buffers_blend}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void setBlendFunction(UnsignedInt drawBuffer, BlendFunction source, BlendFunction destination);
#endif
@ -1893,7 +1911,8 @@ class MAGNUM_GL_EXPORT Renderer {
* @requires_gl40 Extension @gl_extension{ARB,draw_buffers_blend}
* @requires_gles32 Extension @gl_extension{EXT,draw_buffers_indexed}
* @requires_webgl_extension WebGL 2.0 and extension
* @webgl_extension{EXT,draw_buffers_indexed}
* @webgl_extension{OES,draw_buffers_indexed} (originally named
* `EXT_draw_buffers_indexed`)
*/
static void setBlendFunction(UnsignedInt drawBuffer, BlendFunction sourceRgb, BlendFunction destinationRgb, BlendFunction sourceAlpha, BlendFunction destinationAlpha);

Loading…
Cancel
Save