Browse Source

external: entrypoints for WebGL exts implemented in Emscripten 3.1.66.

This is also the first time they just stopped bothering and introduced a
name that is neither in the official gl.xml nor in the
google-private ANGLE-specific gl.xml. So yeah, gotta make my own gl.xml.

I wonder how other people do this. Do they just type out the headers
themselves? Or what's the process for this fucking trash fire these
days??
pull/650/head
Vladimír Vondruš 2 years ago
parent
commit
e967cf551e
  1. 6
      doc/opengl-support.dox
  2. 14
      src/MagnumExternal/OpenGL/GLES2/Emscripten/extensions.txt
  3. 42
      src/MagnumExternal/OpenGL/GLES2/Emscripten/webgl.xml
  4. 32
      src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h
  5. 13
      src/MagnumExternal/OpenGL/GLES3/Emscripten/extensions.txt
  6. 34
      src/MagnumExternal/OpenGL/GLES3/Emscripten/webgl.xml
  7. 32
      src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h

6
doc/opengl-support.dox

@ -575,8 +575,8 @@ Extension | Status
@webgl_extension{EXT,texture_compression_rgtc} | done
@webgl_extension{EXT,texture_compression_bptc} | done
@webgl_extension{EXT,texture_norm16} | done
@webgl_extension{EXT,polygon_offset_clamp} | missing support in Emscripten
@webgl_extension{EXT,clip_control} | missing support in Emscripten
@webgl_extension{EXT,polygon_offset_clamp} | |
@webgl_extension{EXT,clip_control} | |
@webgl_extension{EXT,depth_clamp} | done
@webgl_extension{EXT,texture_mirror_clamp_to_edge} | done
@webgl_extension{KHR,parallel_shader_compile} | done
@ -598,7 +598,7 @@ Extension | Status
@webgl_extension{WEBGL,draw_instanced_base_vertex_base_instance} | done
@webgl_extension{WEBGL,multi_draw_instanced_base_vertex_base_instance} | done
@webgl_extension{WEBGL,provoking_vertex} | missing support in Emscripten
@webgl_extension{WEBGL,polygon_mode} | missing support in Emscripten
@webgl_extension{WEBGL,polygon_mode} | |
@webgl_extension{WEBGL,blend_func_extended} | done
@webgl_extension{WEBGL,stencil_texturing} | done

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

@ -5,6 +5,7 @@
version 2.0 es
extraspec https://raw.githubusercontent.com/google/angle/master/scripts/gl_angle_ext.xml
extraspec webgl.xml
# WebGL 1 only extensions
extension ANGLE_instanced_arrays optional
@ -33,9 +34,8 @@ extension EXT_texture_compression_bptc optional
extension EXT_color_buffer_float optional
extension EXT_texture_compression_s3tc optional
extension EXT_texture_compression_s3tc_srgb optional
# Entrypoints for these two not in Emscripten yet. Last checked on 2024-02-14.
# extension EXT_polygon_offset_clamp optional
# extension EXT_clip_control optional
extension EXT_polygon_offset_clamp optional
extension EXT_clip_control optional
extension EXT_depth_clamp optional
extension EXT_texture_mirror_clamp_to_edge optional
# These three are used as a base for WEBGL_* extensions
@ -60,11 +60,11 @@ extension ANGLE_base_vertex_base_instance optional
# GOOGLE!!!
# extension ANGLE_compressed_texture_etc optional
# These are based off ANGLE_ extensions, gl_angle_ext.xml has them but
# Emscripten not yet, and for Emscripten they'd need to get renamed from an
# ANGLE suffix to WEBGL. Last checked on 2024-02-14.
# These are based off ANGLE_ extensions, for Emscripten they need to get
# renamed from an ANGLE suffix to WEBGL so they come from webgl.xml above. The
# first one doesn't have Emscripten support yet, last checked w/ 3.1.67.
# extension WEBGL_provoking_vertex optional
# extension WEGBL_polygon_mode optional
extension WEBGL_polygon_mode optional
begin functions blacklist
# Not present in WebGL variant of EXT_blend_func_extended

42
src/MagnumExternal/OpenGL/GLES2/Emscripten/webgl.xml vendored

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<registry>
<comment>
This contains signatures of functions that are in WebGL 1 but not in ES
and (of course) gl.xml doesn't bother adding any WebGL-specific special
case.
</comment>
<!-- SECTION: GL command definitions. -->
<commands namespace="GL">
<!-- Copied from gl_angle_ext.xml with the suffix changed -->
<command>
<proto>void <name>glPolygonModeWEBGL</name></proto>
<param group="TriangleFace"><ptype>GLenum</ptype> <name>face</name></param>
<param group="PolygonMode"><ptype>GLenum</ptype> <name>mode</name></param>
</command>
</commands>
<!-- SECTION: extension interface definitions. -->
<extensions>
<!-- WEBGL extension interface definitions, which are basically just
from ANGLE's gl_angle_ext.xml with the suffix changed -->
<extension name="GL_WEBGL_polygon_mode" supported='gles2'>
<require>
<enum name="GL_POLYGON_MODE_WEBGL"/>
<enum name="GL_LINE_WEBGL"/>
<enum name="GL_FILL_WEBGL"/>
<enum name="GL_POLYGON_OFFSET_LINE_WEBGL"/>
<command name="glPolygonModeWEBGL"/>
</require>
</extension>
</extensions>
<!-- SECTION: GL enumerant (token) definitions. -->
<enums namespace="GL" vendor="ANGLE">
<!-- Copied from gl_angle_ext.xml with the suffix changed -->
<enum value="0x0B40" name="GL_POLYGON_MODE_WEBGL" group="GetPName"/>
<enum value="0x1B01" name="GL_LINE_WEBGL" group="PolygonMode"/>
<enum value="0x1B02" name="GL_FILL_WEBGL" group="PolygonMode"/>
<enum value="0x2A02" name="GL_POLYGON_OFFSET_LINE_WEBGL" group="GetPName,EnableCap"/>
</enums>
</registry>

32
src/MagnumExternal/OpenGL/GLES2/flextGLEmscripten.h vendored

@ -520,6 +520,19 @@ typedef khronos_uint64_t GLuint64;
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
/* GL_EXT_polygon_offset_clamp */
#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B
/* GL_EXT_clip_control */
#define GL_LOWER_LEFT_EXT 0x8CA1
#define GL_UPPER_LEFT_EXT 0x8CA2
#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E
#define GL_ZERO_TO_ONE_EXT 0x935F
#define GL_CLIP_ORIGIN_EXT 0x935C
#define GL_CLIP_DEPTH_MODE_EXT 0x935D
/* GL_EXT_depth_clamp */
#define GL_DEPTH_CLAMP_EXT 0x864F
@ -599,6 +612,13 @@ typedef khronos_uint64_t GLuint64;
#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
#define GL_COMPLETION_STATUS_KHR 0x91B1
/* GL_WEBGL_polygon_mode */
#define GL_POLYGON_MODE_WEBGL 0x0B40
#define GL_LINE_WEBGL 0x1B01
#define GL_FILL_WEBGL 0x1B02
#define GL_POLYGON_OFFSET_LINE_WEBGL 0x2A02
/* Function prototypes */
/* GL_ANGLE_base_vertex_base_instance */
@ -766,6 +786,10 @@ GLAPI void glVertexAttrib4fv(GLuint, const GLfloat *);
GLAPI void glVertexAttribPointer(GLuint, GLint, GLenum, GLboolean, GLsizei, const void *);
GLAPI void glViewport(GLint, GLint, GLsizei, GLsizei);
/* GL_EXT_clip_control */
GLAPI void glClipControlEXT(GLenum, GLenum);
/* GL_EXT_disjoint_timer_query */
GLAPI void glBeginQueryEXT(GLenum, GLuint);
@ -785,6 +809,10 @@ GLAPI void glQueryCounterEXT(GLuint, GLenum);
GLAPI void glDrawBuffersEXT(GLsizei, const GLenum *);
/* GL_EXT_polygon_offset_clamp */
GLAPI void glPolygonOffsetClampEXT(GLfloat, GLfloat, GLfloat);
/* GL_OES_vertex_array_object */
GLAPI void glBindVertexArrayOES(GLuint);
@ -792,6 +820,10 @@ GLAPI void glDeleteVertexArraysOES(GLsizei, const GLuint *);
GLAPI void glGenVertexArraysOES(GLsizei, GLuint *);
GLAPI GLboolean glIsVertexArrayOES(GLuint);
/* GL_WEBGL_polygon_mode */
GLAPI void glPolygonModeWEBGL(GLenum, GLenum);
#ifdef __cplusplus
}
#endif

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

@ -22,9 +22,8 @@ extension OVR_multiview2 optional
# These two are used as a base for WEBGL_* extensions
extension EXT_texture_compression_s3tc optional
extension EXT_texture_compression_s3tc_srgb optional
# Entrypoints for these two not in Emscripten yet. Last checked on 2024-02-14.
# extension EXT_polygon_offset_clamp optional
# extension EXT_clip_control optional
extension EXT_polygon_offset_clamp optional
extension EXT_clip_control optional
extension EXT_depth_clamp optional
extension EXT_texture_mirror_clamp_to_edge optional
# These three are used as a base for WEBGL_* extensions
@ -53,11 +52,11 @@ extension ANGLE_stencil_texturing optional
extension MAGNUM_what_webgl_has_but_es_not optional
# These are based off ANGLE_ extensions, gl_angle_ext.xml has them but
# Emscripten not yet, and for Emscripten they'd need to get renamed from an
# ANGLE suffix to WEBGL. Last checked on 2024-02-14.
# These are based off ANGLE_ extensions, for Emscripten they need to get
# renamed from an ANGLE suffix to WEBGL so they come from webgl.xml above. The
# first one doesn't have Emscripten support yet, last checked w/ 3.1.67.
# extension WEBGL_provoking_vertex optional
# extension WEGBL_polygon_mode optional
extension WEBGL_polygon_mode optional
begin functions blacklist
# Not present in WebGL variant of EXT_blend_func_extended

34
src/MagnumExternal/OpenGL/GLES3/Emscripten/webgl.xml vendored

@ -7,18 +7,48 @@
</comment>
<!-- SECTION: GL command definitions. -->
<commands namespace="GL">
<commands namespace="GL">
<!-- glGetBufferSubData is defined in gl.xml already, so nothing to do
here. It only needs to be required from some extension that's then
listed in extensions.txt. -->
<!-- Copied from gl_angle_ext.xml with the suffix changed -->
<command>
<proto>void <name>glPolygonModeWEBGL</name></proto>
<param group="TriangleFace"><ptype>GLenum</ptype> <name>face</name></param>
<param group="PolygonMode"><ptype>GLenum</ptype> <name>mode</name></param>
</command>
</commands>
<!-- SECTION: MAGNUM extension interface definitions -->
<!-- SECTION: extension interface definitions. -->
<extensions>
<!-- WEBGL extension interface definitions, which are basically just
from ANGLE's gl_angle_ext.xml with the suffix changed -->
<extension name="GL_WEBGL_polygon_mode" supported='gles2'>
<require>
<enum name="GL_POLYGON_MODE_WEBGL"/>
<enum name="GL_LINE_WEBGL"/>
<enum name="GL_FILL_WEBGL"/>
<enum name="GL_POLYGON_OFFSET_LINE_WEBGL"/>
<command name="glPolygonModeWEBGL"/>
</require>
</extension>
<!-- MAGNUM extension interface definitions, which are just to bring
desktop-only entrypoints over to WebGL -->
<extension name="GL_MAGNUM_what_webgl_has_but_es_not" supported="gles2">
<require>
<command name="glGetBufferSubData"/>
</require>
</extension>
</extensions>
<!-- SECTION: GL enumerant (token) definitions. -->
<enums namespace="GL" vendor="ANGLE">
<!-- Copied from gl_angle_ext.xml with the suffix changed -->
<enum value="0x0B40" name="GL_POLYGON_MODE_WEBGL" group="GetPName"/>
<enum value="0x1B01" name="GL_LINE_WEBGL" group="PolygonMode"/>
<enum value="0x1B02" name="GL_FILL_WEBGL" group="PolygonMode"/>
<enum value="0x2A02" name="GL_POLYGON_OFFSET_LINE_WEBGL" group="GetPName,EnableCap"/>
</enums>
</registry>

32
src/MagnumExternal/OpenGL/GLES3/flextGLEmscripten.h vendored

@ -823,6 +823,19 @@ typedef struct __GLsync *GLsync;
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
/* GL_EXT_polygon_offset_clamp */
#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B
/* GL_EXT_clip_control */
#define GL_LOWER_LEFT_EXT 0x8CA1
#define GL_UPPER_LEFT_EXT 0x8CA2
#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E
#define GL_ZERO_TO_ONE_EXT 0x935F
#define GL_CLIP_ORIGIN_EXT 0x935C
#define GL_CLIP_DEPTH_MODE_EXT 0x935D
/* GL_EXT_depth_clamp */
#define GL_DEPTH_CLAMP_EXT 0x864F
@ -907,6 +920,13 @@ typedef struct __GLsync *GLsync;
#define GL_DEPTH_STENCIL_TEXTURE_MODE_ANGLE 0x90EA
#define GL_STENCIL_INDEX_ANGLE 0x1901
/* GL_WEBGL_polygon_mode */
#define GL_POLYGON_MODE_WEBGL 0x0B40
#define GL_LINE_WEBGL 0x1B01
#define GL_FILL_WEBGL 0x1B02
#define GL_POLYGON_OFFSET_LINE_WEBGL 0x2A02
/* Function prototypes */
/* GL_ANGLE_base_vertex_base_instance */
@ -1175,6 +1195,10 @@ GLAPI void glVertexAttribI4uiv(GLuint, const GLuint *);
GLAPI void glVertexAttribIPointer(GLuint, GLint, GLenum, GLsizei, const void *);
GLAPI void glWaitSync(GLsync, GLbitfield, GLuint64);
/* GL_EXT_clip_control */
GLAPI void glClipControlEXT(GLenum, GLenum);
/* GL_EXT_disjoint_timer_query */
GLAPI void glBeginQueryEXT(GLenum, GLuint);
@ -1201,6 +1225,10 @@ GLAPI void glDisableiEXT(GLenum, GLuint);
GLAPI void glEnableiEXT(GLenum, GLuint);
GLAPI GLboolean glIsEnablediEXT(GLenum, GLuint);
/* GL_EXT_polygon_offset_clamp */
GLAPI void glPolygonOffsetClampEXT(GLfloat, GLfloat, GLfloat);
/* GL_MAGNUM_what_webgl_has_but_es_not */
GLAPI void glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, void *);
@ -1210,6 +1238,10 @@ GLAPI void glGetBufferSubData(GLenum, GLintptr, GLsizeiptr, void *);
GLAPI void glFramebufferTextureMultiviewOVR(GLenum, GLenum, GLuint, GLint, GLint, GLsizei);
GLAPI void glNamedFramebufferTextureMultiviewOVR(GLuint, GLenum, GLuint, GLint, GLint, GLsizei);
/* GL_WEBGL_polygon_mode */
GLAPI void glPolygonModeWEBGL(GLenum, GLenum);
#ifdef __cplusplus
}
#endif

Loading…
Cancel
Save