Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/include/webgl/webgl1_ext.h
6175 views
1
#pragma once
2
3
/* This header webgl1_ext.h provides static linkage entry points to all WebGL extensions that
4
the Khronos WebGL registry adds on top of the WebGL 1 API.
5
6
In Emscripten, all GL extension function entry points are provided via static linkage.
7
For best WebGL performance, call the statically linked gl*() functions in this header
8
instead of using a dynamic function pointers via the glGetProcAddress() function.
9
10
Include this header instead of the headers GLES2/gl2ext.h or GL/glext.h if you are
11
developing a WebGL renderer as a first tier platform, and want to get "fail fast"
12
compiler errors of GL symbols that are not supported on WebGL.
13
14
Other features:
15
- If you want to use one of the WebGL specific extensions that do not exist in
16
GLES or desktop GL (such as WEBGL_lose_context or WEBGL_debug_shaders), include
17
this header to get the function declarations and defines.
18
19
- Unlike GLES and desktop GL, in WebGL one must explicitly enable an extension
20
before using it. See below in the section of each extension for instructions
21
on how to enable it, or link with -sGL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS=1
22
to automatically enable all non-debugging related WebGL extensions at startup.
23
24
- If you are targeting multiple Emscripten compiler versions (e.g. a rendering
25
library middleware), you can query whether static linkage to a particular
26
extension is provided, by including this header and then checking
27
28
#if EMSCRIPTEN_GL_WEBGL_polygon_mode
29
// we can call glPolygonModeWEBGL() function
30
#endif
31
32
- To disable a particular WebGL extension from being declared in this header,
33
you can add e.g.
34
#define EMSCRIPTEN_GL_OES_texture_float 0
35
before including this header.
36
37
- For technical reasons, each function declaration comes in two variants:
38
a glFoo() declaration, and a second emscripten_glFoo() copy.
39
The emscripten_glFoo() variants exist for internal *GetProcAddress() and
40
Emscripten -sOFFSCREEN_FRAMEBUFFER=1 features linkage purposes, and should
41
be ignored by end users.
42
*/
43
#include "webgl1.h"
44
#include <emscripten/html5.h>
45
46
// 1. https://www.khronos.org/registry/webgl/extensions/OES_texture_float/
47
#ifndef EMSCRIPTEN_GL_OES_texture_float
48
#define EMSCRIPTEN_GL_OES_texture_float 1
49
// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_float");
50
// <no functions exposed>
51
#endif /* EMSCRIPTEN_GL_OES_texture_float */
52
53
// 2. https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/
54
#ifndef EMSCRIPTEN_GL_OES_texture_half_float
55
#define EMSCRIPTEN_GL_OES_texture_half_float 1
56
// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_half_float");
57
#define GL_HALF_FLOAT_OES 0x8D61
58
// <no functions exposed>
59
#endif /* EMSCRIPTEN_GL_OES_texture_half_float */
60
61
// 3. https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/
62
#ifndef EMSCRIPTEN_GL_WEBGL_lose_context
63
//#define EMSCRIPTEN_GL_WEBGL_lose_context 1
64
// TODO:
65
//WEBGL_APICALL EMSCRIPTEN_RESULT GL_APIENTRY emscripten_webgl_loseContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE contextHandle);
66
//WEBGL_APICALL EMSCRIPTEN_RESULT GL_APIENTRY emscripten_webgl_restoreContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE contextHandle);
67
#endif /* EMSCRIPTEN_GL_WEBGL_lose_context */
68
69
// 4. https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/
70
#ifndef EMSCRIPTEN_GL_OES_standard_derivatives
71
#define EMSCRIPTEN_GL_OES_standard_derivatives 1
72
// To enable: call emscripten_webgl_enable_extension(ctx, "OES_standard_derivatives");
73
#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
74
// <no functions exposed>
75
#endif /* EMSCRIPTEN_GL_OES_standard_derivatives */
76
77
// 5. https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/
78
#ifndef EMSCRIPTEN_GL_OES_vertex_array_object
79
#define EMSCRIPTEN_GL_OES_vertex_array_object 1
80
// To enable: call
81
bool emscripten_webgl_enable_OES_vertex_array_object(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);
82
// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and
83
// call emscripten_webgl_enable_extension(ctx, "OES_vertex_array_object");
84
#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
85
WEBGL_APICALL void GL_APIENTRY emscripten_glBindVertexArrayOES(GLuint array);
86
WEBGL_APICALL void GL_APIENTRY emscripten_glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays __attribute__((nonnull)));
87
WEBGL_APICALL void GL_APIENTRY emscripten_glGenVertexArraysOES(GLsizei n, GLuint *arrays __attribute__((nonnull)));
88
WEBGL_APICALL GLboolean GL_APIENTRY emscripten_glIsVertexArrayOES(GLuint array);
89
WEBGL_APICALL void GL_APIENTRY glBindVertexArrayOES(GLuint array);
90
WEBGL_APICALL void GL_APIENTRY glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays __attribute__((nonnull)));
91
WEBGL_APICALL void GL_APIENTRY glGenVertexArraysOES(GLsizei n, GLuint *arrays __attribute__((nonnull)));
92
WEBGL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES(GLuint array);
93
#endif /* EMSCRIPTEN_GL_OES_vertex_array_object */
94
95
// 6. https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/
96
#ifndef EMSCRIPTEN_GL_WEBGL_debug_renderer_info
97
#define EMSCRIPTEN_GL_WEBGL_debug_renderer_info 1
98
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_debug_renderer_info");
99
#define GL_UNMASKED_VENDOR_WEBGL 0x9245
100
#define GL_UNMASKED_RENDERER_WEBGL 0x9246
101
// <no functions exposed>
102
#endif /* EMSCRIPTEN_GL_WEBGL_debug_renderer_info */
103
104
// 7. https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/
105
#ifndef EMSCRIPTEN_GL_WEBGL_debug_shaders
106
#define EMSCRIPTEN_GL_WEBGL_debug_shaders 1
107
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_debug_shaders");
108
//TODO:
109
//WEBGL_APICALL void GL_APIENTRY emscripten_webgl_getTranslatedShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length __attribute__((nonnull)), GLchar *source __attribute__((nonnull)));
110
#endif /* EMSCRIPTEN_GL_WEBGL_debug_shaders */
111
112
// 8. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/
113
#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc
114
#define EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc 1
115
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_s3tc");
116
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
117
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
118
#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
119
#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
120
// <no functions exposed>
121
#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc */
122
123
// 9. https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/
124
#ifndef EMSCRIPTEN_GL_WEBGL_depth_texture
125
#define EMSCRIPTEN_GL_WEBGL_depth_texture 1
126
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_depth_texture");
127
#define GL_UNSIGNED_INT_24_8_WEBGL 0x84FA
128
// <no functions exposed>
129
#endif /* EMSCRIPTEN_GL_WEBGL_depth_texture */
130
131
// 10. https://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/
132
#ifndef EMSCRIPTEN_GL_OES_element_index_uint
133
#define EMSCRIPTEN_GL_OES_element_index_uint 1
134
// To enable: call emscripten_webgl_enable_extension(ctx, "OES_element_index_uint");
135
// <no functions exposed>
136
#endif /* EMSCRIPTEN_GL_OES_element_index_uint */
137
138
// 11. https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/
139
#ifndef EMSCRIPTEN_GL_EXT_texture_filter_anisotropic
140
#define EMSCRIPTEN_GL_EXT_texture_filter_anisotropic 1
141
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_texture_filter_anisotropic");
142
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
143
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
144
// <no functions exposed>
145
#endif /* EMSCRIPTEN_GL_EXT_texture_filter_anisotropic */
146
147
// 16. https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/
148
#ifndef EMSCRIPTEN_GL_EXT_frag_depth
149
#define EMSCRIPTEN_GL_EXT_frag_depth 1
150
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_frag_depth");
151
// <no functions exposed>
152
#endif /* EMSCRIPTEN_GL_EXT_frag_depth */
153
154
// 18. https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/
155
#ifndef EMSCRIPTEN_GL_WEBGL_draw_buffers
156
#define EMSCRIPTEN_GL_WEBGL_draw_buffers 1
157
// To enable: call
158
bool emscripten_webgl_enable_WEBGL_draw_buffers(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);
159
// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and
160
// call emscripten_webgl_enable_extension(ctx, "WEBGL_draw_buffers");
161
#define GL_COLOR_ATTACHMENT0_WEBGL 0x8CE0
162
#define GL_COLOR_ATTACHMENT1_WEBGL 0x8CE1
163
#define GL_COLOR_ATTACHMENT2_WEBGL 0x8CE2
164
#define GL_COLOR_ATTACHMENT3_WEBGL 0x8CE3
165
#define GL_COLOR_ATTACHMENT4_WEBGL 0x8CE4
166
#define GL_COLOR_ATTACHMENT5_WEBGL 0x8CE5
167
#define GL_COLOR_ATTACHMENT6_WEBGL 0x8CE6
168
#define GL_COLOR_ATTACHMENT7_WEBGL 0x8CE7
169
#define GL_COLOR_ATTACHMENT8_WEBGL 0x8CE8
170
#define GL_COLOR_ATTACHMENT9_WEBGL 0x8CE9
171
#define GL_COLOR_ATTACHMENT10_WEBGL 0x8CEA
172
#define GL_COLOR_ATTACHMENT11_WEBGL 0x8CEB
173
#define GL_COLOR_ATTACHMENT12_WEBGL 0x8CEC
174
#define GL_COLOR_ATTACHMENT13_WEBGL 0x8CED
175
#define GL_COLOR_ATTACHMENT14_WEBGL 0x8CEE
176
#define GL_COLOR_ATTACHMENT15_WEBGL 0x8CEF
177
#define GL_DRAW_BUFFER0_WEBGL 0x8825
178
#define GL_DRAW_BUFFER1_WEBGL 0x8826
179
#define GL_DRAW_BUFFER2_WEBGL 0x8827
180
#define GL_DRAW_BUFFER3_WEBGL 0x8828
181
#define GL_DRAW_BUFFER4_WEBGL 0x8829
182
#define GL_DRAW_BUFFER5_WEBGL 0x882A
183
#define GL_DRAW_BUFFER6_WEBGL 0x882B
184
#define GL_DRAW_BUFFER7_WEBGL 0x882C
185
#define GL_DRAW_BUFFER8_WEBGL 0x882D
186
#define GL_DRAW_BUFFER9_WEBGL 0x882E
187
#define GL_DRAW_BUFFER10_WEBGL 0x882F
188
#define GL_DRAW_BUFFER11_WEBGL 0x8830
189
#define GL_DRAW_BUFFER12_WEBGL 0x8831
190
#define GL_DRAW_BUFFER13_WEBGL 0x8832
191
#define GL_DRAW_BUFFER14_WEBGL 0x8833
192
#define GL_DRAW_BUFFER15_WEBGL 0x8834
193
#define GL_MAX_COLOR_ATTACHMENTS_WEBGL 0x8CDF
194
#define GL_MAX_DRAW_BUFFERS_WEBGL 0x8824
195
WEBGL_APICALL void GL_APIENTRY emscripten_glDrawBuffersWEBGL(GLsizei n, const GLenum *buffers);
196
WEBGL_APICALL void GL_APIENTRY glDrawBuffersWEBGL(GLsizei n, const GLenum *buffers);
197
#endif /* EMSCRIPTEN_GL_WEBGL_draw_buffers */
198
199
// 19. https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/
200
#ifndef EMSCRIPTEN_GL_ANGLE_instanced_arrays
201
#define EMSCRIPTEN_GL_ANGLE_instanced_arrays 1
202
// To enable: call
203
bool emscripten_webgl_enable_ANGLE_instanced_arrays(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);
204
// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and
205
// call emscripten_webgl_enable_extension(ctx, "ANGLE_instanced_arrays");
206
#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
207
WEBGL_APICALL void GL_APIENTRY emscripten_glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
208
WEBGL_APICALL void GL_APIENTRY emscripten_glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);
209
WEBGL_APICALL void GL_APIENTRY emscripten_glVertexAttribDivisorANGLE(GLuint index, GLuint divisor);
210
WEBGL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
211
WEBGL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);
212
WEBGL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE(GLuint index, GLuint divisor);
213
#endif /* EMSCRIPTEN_GL_ANGLE_instanced_arrays */
214
215
// 20. https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/
216
#ifndef EMSCRIPTEN_GL_OES_texture_float_linear
217
#define EMSCRIPTEN_GL_OES_texture_float_linear 1
218
// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_float_linear");
219
// <no functions exposed>
220
#endif /* EMSCRIPTEN_GL_OES_texture_float_linear */
221
222
// 21. https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/
223
#ifndef EMSCRIPTEN_GL_OES_texture_half_float_linear
224
#define EMSCRIPTEN_GL_OES_texture_half_float_linear 1
225
// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_half_float_linear");
226
// <no functions exposed>
227
#endif /* EMSCRIPTEN_GL_OES_texture_half_float_linear */
228
229
// 25. https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/
230
#ifndef EMSCRIPTEN_GL_EXT_blend_minmax
231
#define EMSCRIPTEN_GL_EXT_blend_minmax 1
232
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_blend_minmax");
233
#define GL_MIN_EXT 0x8007
234
#define GL_MAX_EXT 0x8008
235
// <no functions exposed>
236
#endif /* EMSCRIPTEN_GL_EXT_blend_minmax */
237
238
// 27. https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/
239
#ifndef EMSCRIPTEN_GL_EXT_shader_texture_lod
240
#define EMSCRIPTEN_GL_EXT_shader_texture_lod 1
241
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_shader_texture_lod");
242
// <no functions exposed>
243
#endif /* EMSCRIPTEN_GL_EXT_shader_texture_lod */
244
245
// 13. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/
246
#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_pvrtc
247
#define EMSCRIPTEN_GL_WEBGL_compressed_texture_pvrtc 1
248
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_pvrtc");
249
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
250
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
251
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
252
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
253
// <no functions exposed>
254
#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_pvrtc */
255
256
// 14. https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/
257
#ifndef EMSCRIPTEN_GL_EXT_color_buffer_half_float
258
#define EMSCRIPTEN_GL_EXT_color_buffer_half_float 1
259
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_color_buffer_half_float");
260
#define GL_RGBA16F_EXT 0x881A
261
#define GL_RGB16F_EXT 0x881B
262
#define GL_RG16F_EXT 0x822F
263
#define GL_R16F_EXT 0x822D
264
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
265
#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
266
// <no functions exposed>
267
#endif /* EMSCRIPTEN_GL_EXT_color_buffer_half_float */
268
269
// 15. https://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/
270
#ifndef EMSCRIPTEN_GL_WEBGL_color_buffer_float
271
#define EMSCRIPTEN_GL_WEBGL_color_buffer_float 1
272
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_color_buffer_float");
273
#define GL_RGBA32F_EXT 0x8814
274
#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211
275
#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17
276
// <no functions exposed>
277
#endif /* EMSCRIPTEN_GL_WEBGL_color_buffer_float */
278
279
// 17. https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/
280
#ifndef EMSCRIPTEN_GL_EXT_sRGB
281
#define EMSCRIPTEN_GL_EXT_sRGB 1
282
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_sRGB");
283
#define GL_SRGB_EXT 0x8C40
284
#define GL_SRGB_ALPHA_EXT 0x8C42
285
#define GL_SRGB8_ALPHA8_EXT 0x8C43
286
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
287
// <no functions exposed>
288
#endif /* EMSCRIPTEN_GL_EXT_sRGB */
289
290
// 24. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/
291
#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_etc1
292
#define EMSCRIPTEN_GL_WEBGL_compressed_texture_etc1 1
293
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_etc1");
294
#define GL_COMPRESSED_RGB_ETC1_WEBGL 0x8D64
295
// <no functions exposed>
296
#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_etc1 */
297
298
// 26. https://www.khronos.org/registry/webgl/extensions/EXT_disjoint_timer_query/
299
#ifndef EMSCRIPTEN_GL_EXT_disjoint_timer_query
300
#define EMSCRIPTEN_GL_EXT_disjoint_timer_query 1
301
#define GL_QUERY_COUNTER_BITS_EXT 0x8864
302
#define GL_CURRENT_QUERY_EXT 0x8865
303
#define GL_QUERY_RESULT_EXT 0x8866
304
#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867
305
#define GL_TIME_ELAPSED_EXT 0x88BF
306
#define GL_TIMESTAMP_EXT 0x8E28
307
#define GL_GPU_DISJOINT_EXT 0x8FBB
308
WEBGL_APICALL void GL_APIENTRY emscripten_glGenQueriesEXT(GLsizei n, GLuint *ids __attribute__((nonnull)));
309
WEBGL_APICALL void GL_APIENTRY emscripten_glDeleteQueriesEXT(GLsizei n, const GLuint *ids __attribute__((nonnull)));
310
WEBGL_APICALL GLboolean GL_APIENTRY emscripten_glIsQueryEXT(GLuint id);
311
WEBGL_APICALL void GL_APIENTRY emscripten_glBeginQueryEXT(GLenum target, GLuint id);
312
WEBGL_APICALL void GL_APIENTRY emscripten_glEndQueryEXT(GLenum target);
313
WEBGL_APICALL void GL_APIENTRY emscripten_glQueryCounterEXT(GLuint id, GLenum target);
314
WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params __attribute__((nonnull)));
315
WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params __attribute__((nonnull)));
316
WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params __attribute__((nonnull)));
317
WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params __attribute__((nonnull)));
318
WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params __attribute__((nonnull)));
319
WEBGL_APICALL void GL_APIENTRY glGenQueriesEXT(GLsizei n, GLuint *ids __attribute__((nonnull)));
320
WEBGL_APICALL void GL_APIENTRY glDeleteQueriesEXT(GLsizei n, const GLuint *ids __attribute__((nonnull)));
321
WEBGL_APICALL GLboolean GL_APIENTRY glIsQueryEXT(GLuint id);
322
WEBGL_APICALL void GL_APIENTRY glBeginQueryEXT(GLenum target, GLuint id);
323
WEBGL_APICALL void GL_APIENTRY glEndQueryEXT(GLenum target);
324
WEBGL_APICALL void GL_APIENTRY glQueryCounterEXT(GLuint id, GLenum target);
325
WEBGL_APICALL void GL_APIENTRY glGetQueryivEXT(GLenum target, GLenum pname, GLint *params __attribute__((nonnull)));
326
WEBGL_APICALL void GL_APIENTRY glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params __attribute__((nonnull)));
327
WEBGL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params __attribute__((nonnull)));
328
WEBGL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params __attribute__((nonnull)));
329
WEBGL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params __attribute__((nonnull)));
330
#endif /* EMSCRIPTEN_GL_EXT_disjoint_timer_query */
331
332
// 29. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/
333
#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_etc
334
#define EMSCRIPTEN_GL_WEBGL_compressed_texture_etc 1
335
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_etc");
336
#define GL_COMPRESSED_R11_EAC 0x9270
337
#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
338
#define GL_COMPRESSED_RG11_EAC 0x9272
339
#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
340
#define GL_COMPRESSED_RGB8_ETC2 0x9274
341
#define GL_COMPRESSED_SRGB8_ETC2 0x9275
342
#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
343
#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
344
#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
345
#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
346
// <no functions exposed>
347
#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_etc */
348
349
// 30. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/
350
#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_astc
351
#define EMSCRIPTEN_GL_WEBGL_compressed_texture_astc 1
352
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_astc");
353
#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
354
#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
355
#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
356
#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
357
#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
358
#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
359
#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
360
#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
361
#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
362
#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
363
#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
364
#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
365
#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
366
#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
367
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
368
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
369
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
370
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
371
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
372
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
373
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
374
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
375
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
376
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
377
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
378
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
379
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
380
#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
381
//TODO:
382
//WEBGL_APICALL void GL_APIENTRY emscripten_webgl_getSupportedAstcProfiles(GLsizei bufSize, GLsizei *length __attribute__((nonnull)), GLchar *buf __attribute__((nonnull)));
383
#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_astc */
384
385
// 31. https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/
386
#ifndef EMSCRIPTEN_GL_EXT_color_buffer_float
387
#define EMSCRIPTEN_GL_EXT_color_buffer_float 1
388
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_color_buffer_float");
389
// <no functions exposed>
390
#endif /* EMSCRIPTEN_GL_EXT_color_buffer_float */
391
392
// 32. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/
393
#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc_srgb
394
#define EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc_srgb 1
395
// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_s3tc_srgb");
396
#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
397
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
398
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
399
#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
400
// <no functions exposed>
401
#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc_srgb */
402
403
// 37. https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/
404
#ifndef EMSCRIPTEN_GL_KHR_parallel_shader_compile
405
#define EMSCRIPTEN_GL_KHR_parallel_shader_compile 1
406
// To enable: call emscripten_webgl_enable_extension(ctx, "KHR_parallel_shader_compile");
407
#define GL_COMPLETION_STATUS_KHR 0x91B1
408
// <no functions exposed>
409
#endif
410
411
// 40. https://www.khronos.org/registry/webgl/extensions/WEBGL_multi_draw/
412
#ifndef EMSCRIPTEN_GL_WEBGL_multi_draw
413
#define EMSCRIPTEN_GL_WEBGL_multi_draw 1
414
// To enable: call
415
bool emscripten_webgl_enable_WEBGL_multi_draw(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);
416
// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and
417
// call emscripten_webgl_enable_extension(ctx, "WEBGL_multi_draw");
418
WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawArraysWEBGL(GLenum mode,
419
const GLint* firsts __attribute__((nonnull)),
420
const GLsizei* counts __attribute__((nonnull)),
421
GLsizei drawcount);
422
WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawArraysInstancedWEBGL(GLenum mode,
423
const GLint* firsts __attribute__((nonnull)),
424
const GLsizei* counts __attribute__((nonnull)),
425
const GLsizei* instanceCounts __attribute__((nonnull)),
426
GLsizei drawcount);
427
WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawElementsWEBGL(GLenum mode,
428
const GLsizei* counts __attribute__((nonnull)),
429
GLenum type,
430
const GLvoid* const* offsets __attribute__((nonnull)),
431
GLsizei drawcount);
432
WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawElementsInstancedWEBGL(GLenum mode,
433
const GLsizei* counts __attribute__((nonnull)),
434
GLenum type,
435
const GLvoid* const* offsets __attribute__((nonnull)),
436
const GLsizei* instanceCounts __attribute__((nonnull)),
437
GLsizei drawcount);
438
WEBGL_APICALL void GL_APIENTRY glMultiDrawArraysWEBGL(GLenum mode,
439
const GLint* firsts __attribute__((nonnull)),
440
const GLsizei* counts __attribute__((nonnull)),
441
GLsizei drawcount);
442
WEBGL_APICALL void GL_APIENTRY glMultiDrawArraysInstancedWEBGL(GLenum mode,
443
const GLint* firsts __attribute__((nonnull)),
444
const GLsizei* counts __attribute__((nonnull)),
445
const GLsizei* instanceCounts __attribute__((nonnull)),
446
GLsizei drawcount);
447
WEBGL_APICALL void GL_APIENTRY glMultiDrawElementsWEBGL(GLenum mode,
448
const GLsizei* counts __attribute__((nonnull)),
449
GLenum type,
450
const GLvoid* const* offsets __attribute__((nonnull)),
451
GLsizei drawcount);
452
WEBGL_APICALL void GL_APIENTRY glMultiDrawElementsInstancedWEBGL(GLenum mode,
453
const GLsizei* counts __attribute__((nonnull)),
454
GLenum type,
455
const GLvoid* const* offsets __attribute__((nonnull)),
456
const GLsizei* instanceCounts __attribute__((nonnull)),
457
GLsizei drawcount);
458
#endif /* EMSCRIPTEN_GL_WEBGL_multi_draw */
459
460
// 44. https://www.khronos.org/registry/webgl/extensions/EXT_texture_norm16/
461
#ifndef EMSCRIPTEN_GL_EXT_texture_norm16
462
#define EMSCRIPTEN_GL_EXT_texture_norm16 1
463
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_texture_norm16");
464
#define GL_R16_EXT 0x822A
465
#define GL_RG16_EXT 0x822C
466
#define GL_RGB16_EXT 0x8054
467
#define GL_RGBA16_EXT 0x805B
468
#define GL_R16_SNORM_EXT 0x8F98
469
#define GL_RG16_SNORM_EXT 0x8F99
470
#define GL_RGB16_SNORM_EXT 0x8F9A
471
#define GL_RGBA16_SNORM_EXT 0x8F9B
472
// <no functions exposed>
473
#endif /* EMSCRIPTEN_GL_EXT_texture_norm16 */
474
475
// EMSCRIPTEN_explicit_uniform_location
476
// https://github.com/emscripten-core/emscripten/blob/main/docs/EMSCRIPTEN_explicit_uniform_location.txt
477
#ifndef EMSCRIPTEN_explicit_uniform_location
478
#define EMSCRIPTEN_explicit_uniform_location 1
479
// To enable: link with -sGL_EXPLICIT_UNIFORM_LOCATION=1
480
#define GL_MAX_UNIFORM_LOCATIONS 0x826E
481
// <no functions exposed>
482
#endif
483
484
// EMSCRIPTEN_explicit_uniform_binding
485
// https://github.com/emscripten-core/emscripten/blob/main/docs/EMSCRIPTEN_explicit_uniform_binding.txt
486
#ifndef EMSCRIPTEN_explicit_uniform_binding
487
#define EMSCRIPTEN_explicit_uniform_binding 1
488
// To enable: link with -sGL_EXPLICIT_UNIFORM_BINDING=1
489
// <no functions or defines exposed>
490
#endif
491
492
// 50. https://registry.khronos.org/webgl/extensions/EXT_polygon_offset_clamp/
493
#ifndef EMSCRIPTEN_GL_EXT_polygon_offset_clamp
494
#define EMSCRIPTEN_GL_EXT_polygon_offset_clamp 1
495
// To enable: call
496
bool emscripten_webgl_enable_EXT_polygon_offset_clamp(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);
497
// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and
498
// call emscripten_webgl_enable_extension(ctx, "EXT_polygon_offset_clamp");
499
#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B
500
WEBGL_APICALL void GL_APIENTRY emscripten_glPolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp);
501
WEBGL_APICALL void GL_APIENTRY glPolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp);
502
#endif
503
504
// 51. https://registry.khronos.org/webgl/extensions/EXT_clip_control/
505
#ifndef EMSCRIPTEN_GL_EXT_clip_control
506
#define EMSCRIPTEN_GL_EXT_clip_control 1
507
// To enable: call
508
bool emscripten_webgl_enable_EXT_clip_control(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);
509
// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and
510
// call emscripten_webgl_enable_extension(ctx, "EXT_clip_control");
511
#define GL_LOWER_LEFT_EXT 0x8CA1
512
#define GL_UPPER_LEFT_EXT 0x8CA2
513
#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E
514
#define GL_ZERO_TO_ONE_EXT 0x935F
515
#define GL_CLIP_ORIGIN_EXT 0x935C
516
#define GL_CLIP_DEPTH_MODE_EXT 0x935D
517
WEBGL_APICALL void GL_APIENTRY emscripten_glClipControlEXT(GLenum origin, GLenum depth);
518
WEBGL_APICALL void GL_APIENTRY glClipControlEXT(GLenum origin, GLenum depth);
519
#endif
520
521
// 52. https://registry.khronos.org/webgl/extensions/EXT_depth_clamp/
522
#ifndef EMSCRIPTEN_GL_EXT_depth_clamp
523
#define EMSCRIPTEN_GL_EXT_depth_clamp 1
524
// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_depth_clamp");
525
#define GL_DEPTH_CLAMP_EXT 0x864F
526
// <no functions exposed>
527
#endif
528
529
// 53. https://registry.khronos.org/webgl/extensions/WEBGL_polygon_mode/
530
#ifndef EMSCRIPTEN_GL_WEBGL_polygon_mode
531
#define EMSCRIPTEN_GL_WEBGL_polygon_mode 1
532
// To enable: call
533
bool emscripten_webgl_enable_WEBGL_polygon_mode(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);
534
// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and
535
// call emscripten_webgl_enable_extension(ctx, "WEBGL_polygon_mode");
536
#define GL_POLYGON_MODE_WEBGL 0x0B40
537
#define GL_POLYGON_OFFSET_LINE_WEBGL 0x2A02
538
#define GL_LINE_WEBGL 0x1B01
539
#define GL_FILL_WEBGL 0x1B02
540
WEBGL_APICALL void GL_APIENTRY emscripten_glPolygonModeWEBGL(GLenum face, GLenum mode);
541
WEBGL_APICALL void GL_APIENTRY glPolygonModeWEBGL(GLenum face, GLenum mode);
542
#endif
543
544
/* To add a new GL extension here, follow the template
545
546
// <num>. <online URL to extension documentation>
547
#ifndef EMSCRIPTEN_GL_<extension_name>
548
#ifndef EMSCRIPTEN_GL_<extension_name> 1
549
// To enable: <enable_instructions>
550
<exposed defines>
551
<exposed emscripten_gl* function declarations>
552
<exposed gl* function declarations>
553
#endif
554
*/
555
556