Path: blob/main/system/include/webgl/webgl1_ext.h
6175 views
#pragma once12/* This header webgl1_ext.h provides static linkage entry points to all WebGL extensions that3the Khronos WebGL registry adds on top of the WebGL 1 API.45In Emscripten, all GL extension function entry points are provided via static linkage.6For best WebGL performance, call the statically linked gl*() functions in this header7instead of using a dynamic function pointers via the glGetProcAddress() function.89Include this header instead of the headers GLES2/gl2ext.h or GL/glext.h if you are10developing a WebGL renderer as a first tier platform, and want to get "fail fast"11compiler errors of GL symbols that are not supported on WebGL.1213Other features:14- If you want to use one of the WebGL specific extensions that do not exist in15GLES or desktop GL (such as WEBGL_lose_context or WEBGL_debug_shaders), include16this header to get the function declarations and defines.1718- Unlike GLES and desktop GL, in WebGL one must explicitly enable an extension19before using it. See below in the section of each extension for instructions20on how to enable it, or link with -sGL_SUPPORT_AUTOMATIC_ENABLE_EXTENSIONS=121to automatically enable all non-debugging related WebGL extensions at startup.2223- If you are targeting multiple Emscripten compiler versions (e.g. a rendering24library middleware), you can query whether static linkage to a particular25extension is provided, by including this header and then checking2627#if EMSCRIPTEN_GL_WEBGL_polygon_mode28// we can call glPolygonModeWEBGL() function29#endif3031- To disable a particular WebGL extension from being declared in this header,32you can add e.g.33#define EMSCRIPTEN_GL_OES_texture_float 034before including this header.3536- For technical reasons, each function declaration comes in two variants:37a glFoo() declaration, and a second emscripten_glFoo() copy.38The emscripten_glFoo() variants exist for internal *GetProcAddress() and39Emscripten -sOFFSCREEN_FRAMEBUFFER=1 features linkage purposes, and should40be ignored by end users.41*/42#include "webgl1.h"43#include <emscripten/html5.h>4445// 1. https://www.khronos.org/registry/webgl/extensions/OES_texture_float/46#ifndef EMSCRIPTEN_GL_OES_texture_float47#define EMSCRIPTEN_GL_OES_texture_float 148// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_float");49// <no functions exposed>50#endif /* EMSCRIPTEN_GL_OES_texture_float */5152// 2. https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float/53#ifndef EMSCRIPTEN_GL_OES_texture_half_float54#define EMSCRIPTEN_GL_OES_texture_half_float 155// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_half_float");56#define GL_HALF_FLOAT_OES 0x8D6157// <no functions exposed>58#endif /* EMSCRIPTEN_GL_OES_texture_half_float */5960// 3. https://www.khronos.org/registry/webgl/extensions/WEBGL_lose_context/61#ifndef EMSCRIPTEN_GL_WEBGL_lose_context62//#define EMSCRIPTEN_GL_WEBGL_lose_context 163// TODO:64//WEBGL_APICALL EMSCRIPTEN_RESULT GL_APIENTRY emscripten_webgl_loseContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE contextHandle);65//WEBGL_APICALL EMSCRIPTEN_RESULT GL_APIENTRY emscripten_webgl_restoreContext(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE contextHandle);66#endif /* EMSCRIPTEN_GL_WEBGL_lose_context */6768// 4. https://www.khronos.org/registry/webgl/extensions/OES_standard_derivatives/69#ifndef EMSCRIPTEN_GL_OES_standard_derivatives70#define EMSCRIPTEN_GL_OES_standard_derivatives 171// To enable: call emscripten_webgl_enable_extension(ctx, "OES_standard_derivatives");72#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B73// <no functions exposed>74#endif /* EMSCRIPTEN_GL_OES_standard_derivatives */7576// 5. https://www.khronos.org/registry/webgl/extensions/OES_vertex_array_object/77#ifndef EMSCRIPTEN_GL_OES_vertex_array_object78#define EMSCRIPTEN_GL_OES_vertex_array_object 179// To enable: call80bool emscripten_webgl_enable_OES_vertex_array_object(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);81// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and82// call emscripten_webgl_enable_extension(ctx, "OES_vertex_array_object");83#define GL_VERTEX_ARRAY_BINDING_OES 0x85B584WEBGL_APICALL void GL_APIENTRY emscripten_glBindVertexArrayOES(GLuint array);85WEBGL_APICALL void GL_APIENTRY emscripten_glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays __attribute__((nonnull)));86WEBGL_APICALL void GL_APIENTRY emscripten_glGenVertexArraysOES(GLsizei n, GLuint *arrays __attribute__((nonnull)));87WEBGL_APICALL GLboolean GL_APIENTRY emscripten_glIsVertexArrayOES(GLuint array);88WEBGL_APICALL void GL_APIENTRY glBindVertexArrayOES(GLuint array);89WEBGL_APICALL void GL_APIENTRY glDeleteVertexArraysOES(GLsizei n, const GLuint *arrays __attribute__((nonnull)));90WEBGL_APICALL void GL_APIENTRY glGenVertexArraysOES(GLsizei n, GLuint *arrays __attribute__((nonnull)));91WEBGL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOES(GLuint array);92#endif /* EMSCRIPTEN_GL_OES_vertex_array_object */9394// 6. https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_renderer_info/95#ifndef EMSCRIPTEN_GL_WEBGL_debug_renderer_info96#define EMSCRIPTEN_GL_WEBGL_debug_renderer_info 197// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_debug_renderer_info");98#define GL_UNMASKED_VENDOR_WEBGL 0x924599#define GL_UNMASKED_RENDERER_WEBGL 0x9246100// <no functions exposed>101#endif /* EMSCRIPTEN_GL_WEBGL_debug_renderer_info */102103// 7. https://www.khronos.org/registry/webgl/extensions/WEBGL_debug_shaders/104#ifndef EMSCRIPTEN_GL_WEBGL_debug_shaders105#define EMSCRIPTEN_GL_WEBGL_debug_shaders 1106// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_debug_shaders");107//TODO:108//WEBGL_APICALL void GL_APIENTRY emscripten_webgl_getTranslatedShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length __attribute__((nonnull)), GLchar *source __attribute__((nonnull)));109#endif /* EMSCRIPTEN_GL_WEBGL_debug_shaders */110111// 8. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc/112#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc113#define EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc 1114// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_s3tc");115#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0116#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1117#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2118#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3119// <no functions exposed>120#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc */121122// 9. https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/123#ifndef EMSCRIPTEN_GL_WEBGL_depth_texture124#define EMSCRIPTEN_GL_WEBGL_depth_texture 1125// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_depth_texture");126#define GL_UNSIGNED_INT_24_8_WEBGL 0x84FA127// <no functions exposed>128#endif /* EMSCRIPTEN_GL_WEBGL_depth_texture */129130// 10. https://www.khronos.org/registry/webgl/extensions/OES_element_index_uint/131#ifndef EMSCRIPTEN_GL_OES_element_index_uint132#define EMSCRIPTEN_GL_OES_element_index_uint 1133// To enable: call emscripten_webgl_enable_extension(ctx, "OES_element_index_uint");134// <no functions exposed>135#endif /* EMSCRIPTEN_GL_OES_element_index_uint */136137// 11. https://www.khronos.org/registry/webgl/extensions/EXT_texture_filter_anisotropic/138#ifndef EMSCRIPTEN_GL_EXT_texture_filter_anisotropic139#define EMSCRIPTEN_GL_EXT_texture_filter_anisotropic 1140// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_texture_filter_anisotropic");141#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE142#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF143// <no functions exposed>144#endif /* EMSCRIPTEN_GL_EXT_texture_filter_anisotropic */145146// 16. https://www.khronos.org/registry/webgl/extensions/EXT_frag_depth/147#ifndef EMSCRIPTEN_GL_EXT_frag_depth148#define EMSCRIPTEN_GL_EXT_frag_depth 1149// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_frag_depth");150// <no functions exposed>151#endif /* EMSCRIPTEN_GL_EXT_frag_depth */152153// 18. https://www.khronos.org/registry/webgl/extensions/WEBGL_draw_buffers/154#ifndef EMSCRIPTEN_GL_WEBGL_draw_buffers155#define EMSCRIPTEN_GL_WEBGL_draw_buffers 1156// To enable: call157bool emscripten_webgl_enable_WEBGL_draw_buffers(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);158// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and159// call emscripten_webgl_enable_extension(ctx, "WEBGL_draw_buffers");160#define GL_COLOR_ATTACHMENT0_WEBGL 0x8CE0161#define GL_COLOR_ATTACHMENT1_WEBGL 0x8CE1162#define GL_COLOR_ATTACHMENT2_WEBGL 0x8CE2163#define GL_COLOR_ATTACHMENT3_WEBGL 0x8CE3164#define GL_COLOR_ATTACHMENT4_WEBGL 0x8CE4165#define GL_COLOR_ATTACHMENT5_WEBGL 0x8CE5166#define GL_COLOR_ATTACHMENT6_WEBGL 0x8CE6167#define GL_COLOR_ATTACHMENT7_WEBGL 0x8CE7168#define GL_COLOR_ATTACHMENT8_WEBGL 0x8CE8169#define GL_COLOR_ATTACHMENT9_WEBGL 0x8CE9170#define GL_COLOR_ATTACHMENT10_WEBGL 0x8CEA171#define GL_COLOR_ATTACHMENT11_WEBGL 0x8CEB172#define GL_COLOR_ATTACHMENT12_WEBGL 0x8CEC173#define GL_COLOR_ATTACHMENT13_WEBGL 0x8CED174#define GL_COLOR_ATTACHMENT14_WEBGL 0x8CEE175#define GL_COLOR_ATTACHMENT15_WEBGL 0x8CEF176#define GL_DRAW_BUFFER0_WEBGL 0x8825177#define GL_DRAW_BUFFER1_WEBGL 0x8826178#define GL_DRAW_BUFFER2_WEBGL 0x8827179#define GL_DRAW_BUFFER3_WEBGL 0x8828180#define GL_DRAW_BUFFER4_WEBGL 0x8829181#define GL_DRAW_BUFFER5_WEBGL 0x882A182#define GL_DRAW_BUFFER6_WEBGL 0x882B183#define GL_DRAW_BUFFER7_WEBGL 0x882C184#define GL_DRAW_BUFFER8_WEBGL 0x882D185#define GL_DRAW_BUFFER9_WEBGL 0x882E186#define GL_DRAW_BUFFER10_WEBGL 0x882F187#define GL_DRAW_BUFFER11_WEBGL 0x8830188#define GL_DRAW_BUFFER12_WEBGL 0x8831189#define GL_DRAW_BUFFER13_WEBGL 0x8832190#define GL_DRAW_BUFFER14_WEBGL 0x8833191#define GL_DRAW_BUFFER15_WEBGL 0x8834192#define GL_MAX_COLOR_ATTACHMENTS_WEBGL 0x8CDF193#define GL_MAX_DRAW_BUFFERS_WEBGL 0x8824194WEBGL_APICALL void GL_APIENTRY emscripten_glDrawBuffersWEBGL(GLsizei n, const GLenum *buffers);195WEBGL_APICALL void GL_APIENTRY glDrawBuffersWEBGL(GLsizei n, const GLenum *buffers);196#endif /* EMSCRIPTEN_GL_WEBGL_draw_buffers */197198// 19. https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/199#ifndef EMSCRIPTEN_GL_ANGLE_instanced_arrays200#define EMSCRIPTEN_GL_ANGLE_instanced_arrays 1201// To enable: call202bool emscripten_webgl_enable_ANGLE_instanced_arrays(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);203// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and204// call emscripten_webgl_enable_extension(ctx, "ANGLE_instanced_arrays");205#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE206WEBGL_APICALL void GL_APIENTRY emscripten_glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);207WEBGL_APICALL void GL_APIENTRY emscripten_glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);208WEBGL_APICALL void GL_APIENTRY emscripten_glVertexAttribDivisorANGLE(GLuint index, GLuint divisor);209WEBGL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);210WEBGL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);211WEBGL_APICALL void GL_APIENTRY glVertexAttribDivisorANGLE(GLuint index, GLuint divisor);212#endif /* EMSCRIPTEN_GL_ANGLE_instanced_arrays */213214// 20. https://www.khronos.org/registry/webgl/extensions/OES_texture_float_linear/215#ifndef EMSCRIPTEN_GL_OES_texture_float_linear216#define EMSCRIPTEN_GL_OES_texture_float_linear 1217// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_float_linear");218// <no functions exposed>219#endif /* EMSCRIPTEN_GL_OES_texture_float_linear */220221// 21. https://www.khronos.org/registry/webgl/extensions/OES_texture_half_float_linear/222#ifndef EMSCRIPTEN_GL_OES_texture_half_float_linear223#define EMSCRIPTEN_GL_OES_texture_half_float_linear 1224// To enable: call emscripten_webgl_enable_extension(ctx, "OES_texture_half_float_linear");225// <no functions exposed>226#endif /* EMSCRIPTEN_GL_OES_texture_half_float_linear */227228// 25. https://www.khronos.org/registry/webgl/extensions/EXT_blend_minmax/229#ifndef EMSCRIPTEN_GL_EXT_blend_minmax230#define EMSCRIPTEN_GL_EXT_blend_minmax 1231// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_blend_minmax");232#define GL_MIN_EXT 0x8007233#define GL_MAX_EXT 0x8008234// <no functions exposed>235#endif /* EMSCRIPTEN_GL_EXT_blend_minmax */236237// 27. https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/238#ifndef EMSCRIPTEN_GL_EXT_shader_texture_lod239#define EMSCRIPTEN_GL_EXT_shader_texture_lod 1240// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_shader_texture_lod");241// <no functions exposed>242#endif /* EMSCRIPTEN_GL_EXT_shader_texture_lod */243244// 13. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_pvrtc/245#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_pvrtc246#define EMSCRIPTEN_GL_WEBGL_compressed_texture_pvrtc 1247// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_pvrtc");248#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00249#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01250#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02251#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03252// <no functions exposed>253#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_pvrtc */254255// 14. https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/256#ifndef EMSCRIPTEN_GL_EXT_color_buffer_half_float257#define EMSCRIPTEN_GL_EXT_color_buffer_half_float 1258// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_color_buffer_half_float");259#define GL_RGBA16F_EXT 0x881A260#define GL_RGB16F_EXT 0x881B261#define GL_RG16F_EXT 0x822F262#define GL_R16F_EXT 0x822D263#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211264#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17265// <no functions exposed>266#endif /* EMSCRIPTEN_GL_EXT_color_buffer_half_float */267268// 15. https://www.khronos.org/registry/webgl/extensions/WEBGL_color_buffer_float/269#ifndef EMSCRIPTEN_GL_WEBGL_color_buffer_float270#define EMSCRIPTEN_GL_WEBGL_color_buffer_float 1271// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_color_buffer_float");272#define GL_RGBA32F_EXT 0x8814273#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT 0x8211274#define GL_UNSIGNED_NORMALIZED_EXT 0x8C17275// <no functions exposed>276#endif /* EMSCRIPTEN_GL_WEBGL_color_buffer_float */277278// 17. https://www.khronos.org/registry/webgl/extensions/EXT_sRGB/279#ifndef EMSCRIPTEN_GL_EXT_sRGB280#define EMSCRIPTEN_GL_EXT_sRGB 1281// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_sRGB");282#define GL_SRGB_EXT 0x8C40283#define GL_SRGB_ALPHA_EXT 0x8C42284#define GL_SRGB8_ALPHA8_EXT 0x8C43285#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210286// <no functions exposed>287#endif /* EMSCRIPTEN_GL_EXT_sRGB */288289// 24. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc1/290#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_etc1291#define EMSCRIPTEN_GL_WEBGL_compressed_texture_etc1 1292// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_etc1");293#define GL_COMPRESSED_RGB_ETC1_WEBGL 0x8D64294// <no functions exposed>295#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_etc1 */296297// 26. https://www.khronos.org/registry/webgl/extensions/EXT_disjoint_timer_query/298#ifndef EMSCRIPTEN_GL_EXT_disjoint_timer_query299#define EMSCRIPTEN_GL_EXT_disjoint_timer_query 1300#define GL_QUERY_COUNTER_BITS_EXT 0x8864301#define GL_CURRENT_QUERY_EXT 0x8865302#define GL_QUERY_RESULT_EXT 0x8866303#define GL_QUERY_RESULT_AVAILABLE_EXT 0x8867304#define GL_TIME_ELAPSED_EXT 0x88BF305#define GL_TIMESTAMP_EXT 0x8E28306#define GL_GPU_DISJOINT_EXT 0x8FBB307WEBGL_APICALL void GL_APIENTRY emscripten_glGenQueriesEXT(GLsizei n, GLuint *ids __attribute__((nonnull)));308WEBGL_APICALL void GL_APIENTRY emscripten_glDeleteQueriesEXT(GLsizei n, const GLuint *ids __attribute__((nonnull)));309WEBGL_APICALL GLboolean GL_APIENTRY emscripten_glIsQueryEXT(GLuint id);310WEBGL_APICALL void GL_APIENTRY emscripten_glBeginQueryEXT(GLenum target, GLuint id);311WEBGL_APICALL void GL_APIENTRY emscripten_glEndQueryEXT(GLenum target);312WEBGL_APICALL void GL_APIENTRY emscripten_glQueryCounterEXT(GLuint id, GLenum target);313WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryivEXT(GLenum target, GLenum pname, GLint *params __attribute__((nonnull)));314WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params __attribute__((nonnull)));315WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params __attribute__((nonnull)));316WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params __attribute__((nonnull)));317WEBGL_APICALL void GL_APIENTRY emscripten_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params __attribute__((nonnull)));318WEBGL_APICALL void GL_APIENTRY glGenQueriesEXT(GLsizei n, GLuint *ids __attribute__((nonnull)));319WEBGL_APICALL void GL_APIENTRY glDeleteQueriesEXT(GLsizei n, const GLuint *ids __attribute__((nonnull)));320WEBGL_APICALL GLboolean GL_APIENTRY glIsQueryEXT(GLuint id);321WEBGL_APICALL void GL_APIENTRY glBeginQueryEXT(GLenum target, GLuint id);322WEBGL_APICALL void GL_APIENTRY glEndQueryEXT(GLenum target);323WEBGL_APICALL void GL_APIENTRY glQueryCounterEXT(GLuint id, GLenum target);324WEBGL_APICALL void GL_APIENTRY glGetQueryivEXT(GLenum target, GLenum pname, GLint *params __attribute__((nonnull)));325WEBGL_APICALL void GL_APIENTRY glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params __attribute__((nonnull)));326WEBGL_APICALL void GL_APIENTRY glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint *params __attribute__((nonnull)));327WEBGL_APICALL void GL_APIENTRY glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params __attribute__((nonnull)));328WEBGL_APICALL void GL_APIENTRY glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params __attribute__((nonnull)));329#endif /* EMSCRIPTEN_GL_EXT_disjoint_timer_query */330331// 29. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_etc/332#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_etc333#define EMSCRIPTEN_GL_WEBGL_compressed_texture_etc 1334// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_etc");335#define GL_COMPRESSED_R11_EAC 0x9270336#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271337#define GL_COMPRESSED_RG11_EAC 0x9272338#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273339#define GL_COMPRESSED_RGB8_ETC2 0x9274340#define GL_COMPRESSED_SRGB8_ETC2 0x9275341#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276342#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277343#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278344#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279345// <no functions exposed>346#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_etc */347348// 30. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_astc/349#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_astc350#define EMSCRIPTEN_GL_WEBGL_compressed_texture_astc 1351// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_astc");352#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0353#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1354#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2355#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3356#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4357#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5358#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6359#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7360#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8361#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9362#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA363#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB364#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC365#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD366#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0367#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1368#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2369#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3370#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4371#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5372#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6373#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7374#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8375#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9376#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA377#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB378#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC379#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD380//TODO:381//WEBGL_APICALL void GL_APIENTRY emscripten_webgl_getSupportedAstcProfiles(GLsizei bufSize, GLsizei *length __attribute__((nonnull)), GLchar *buf __attribute__((nonnull)));382#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_astc */383384// 31. https://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float/385#ifndef EMSCRIPTEN_GL_EXT_color_buffer_float386#define EMSCRIPTEN_GL_EXT_color_buffer_float 1387// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_color_buffer_float");388// <no functions exposed>389#endif /* EMSCRIPTEN_GL_EXT_color_buffer_float */390391// 32. https://www.khronos.org/registry/webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/392#ifndef EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc_srgb393#define EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc_srgb 1394// To enable: call emscripten_webgl_enable_extension(ctx, "WEBGL_compressed_texture_s3tc_srgb");395#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C396#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D397#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E398#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F399// <no functions exposed>400#endif /* EMSCRIPTEN_GL_WEBGL_compressed_texture_s3tc_srgb */401402// 37. https://www.khronos.org/registry/webgl/extensions/KHR_parallel_shader_compile/403#ifndef EMSCRIPTEN_GL_KHR_parallel_shader_compile404#define EMSCRIPTEN_GL_KHR_parallel_shader_compile 1405// To enable: call emscripten_webgl_enable_extension(ctx, "KHR_parallel_shader_compile");406#define GL_COMPLETION_STATUS_KHR 0x91B1407// <no functions exposed>408#endif409410// 40. https://www.khronos.org/registry/webgl/extensions/WEBGL_multi_draw/411#ifndef EMSCRIPTEN_GL_WEBGL_multi_draw412#define EMSCRIPTEN_GL_WEBGL_multi_draw 1413// To enable: call414bool emscripten_webgl_enable_WEBGL_multi_draw(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);415// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and416// call emscripten_webgl_enable_extension(ctx, "WEBGL_multi_draw");417WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawArraysWEBGL(GLenum mode,418const GLint* firsts __attribute__((nonnull)),419const GLsizei* counts __attribute__((nonnull)),420GLsizei drawcount);421WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawArraysInstancedWEBGL(GLenum mode,422const GLint* firsts __attribute__((nonnull)),423const GLsizei* counts __attribute__((nonnull)),424const GLsizei* instanceCounts __attribute__((nonnull)),425GLsizei drawcount);426WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawElementsWEBGL(GLenum mode,427const GLsizei* counts __attribute__((nonnull)),428GLenum type,429const GLvoid* const* offsets __attribute__((nonnull)),430GLsizei drawcount);431WEBGL_APICALL void GL_APIENTRY emscripten_glMultiDrawElementsInstancedWEBGL(GLenum mode,432const GLsizei* counts __attribute__((nonnull)),433GLenum type,434const GLvoid* const* offsets __attribute__((nonnull)),435const GLsizei* instanceCounts __attribute__((nonnull)),436GLsizei drawcount);437WEBGL_APICALL void GL_APIENTRY glMultiDrawArraysWEBGL(GLenum mode,438const GLint* firsts __attribute__((nonnull)),439const GLsizei* counts __attribute__((nonnull)),440GLsizei drawcount);441WEBGL_APICALL void GL_APIENTRY glMultiDrawArraysInstancedWEBGL(GLenum mode,442const GLint* firsts __attribute__((nonnull)),443const GLsizei* counts __attribute__((nonnull)),444const GLsizei* instanceCounts __attribute__((nonnull)),445GLsizei drawcount);446WEBGL_APICALL void GL_APIENTRY glMultiDrawElementsWEBGL(GLenum mode,447const GLsizei* counts __attribute__((nonnull)),448GLenum type,449const GLvoid* const* offsets __attribute__((nonnull)),450GLsizei drawcount);451WEBGL_APICALL void GL_APIENTRY glMultiDrawElementsInstancedWEBGL(GLenum mode,452const GLsizei* counts __attribute__((nonnull)),453GLenum type,454const GLvoid* const* offsets __attribute__((nonnull)),455const GLsizei* instanceCounts __attribute__((nonnull)),456GLsizei drawcount);457#endif /* EMSCRIPTEN_GL_WEBGL_multi_draw */458459// 44. https://www.khronos.org/registry/webgl/extensions/EXT_texture_norm16/460#ifndef EMSCRIPTEN_GL_EXT_texture_norm16461#define EMSCRIPTEN_GL_EXT_texture_norm16 1462// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_texture_norm16");463#define GL_R16_EXT 0x822A464#define GL_RG16_EXT 0x822C465#define GL_RGB16_EXT 0x8054466#define GL_RGBA16_EXT 0x805B467#define GL_R16_SNORM_EXT 0x8F98468#define GL_RG16_SNORM_EXT 0x8F99469#define GL_RGB16_SNORM_EXT 0x8F9A470#define GL_RGBA16_SNORM_EXT 0x8F9B471// <no functions exposed>472#endif /* EMSCRIPTEN_GL_EXT_texture_norm16 */473474// EMSCRIPTEN_explicit_uniform_location475// https://github.com/emscripten-core/emscripten/blob/main/docs/EMSCRIPTEN_explicit_uniform_location.txt476#ifndef EMSCRIPTEN_explicit_uniform_location477#define EMSCRIPTEN_explicit_uniform_location 1478// To enable: link with -sGL_EXPLICIT_UNIFORM_LOCATION=1479#define GL_MAX_UNIFORM_LOCATIONS 0x826E480// <no functions exposed>481#endif482483// EMSCRIPTEN_explicit_uniform_binding484// https://github.com/emscripten-core/emscripten/blob/main/docs/EMSCRIPTEN_explicit_uniform_binding.txt485#ifndef EMSCRIPTEN_explicit_uniform_binding486#define EMSCRIPTEN_explicit_uniform_binding 1487// To enable: link with -sGL_EXPLICIT_UNIFORM_BINDING=1488// <no functions or defines exposed>489#endif490491// 50. https://registry.khronos.org/webgl/extensions/EXT_polygon_offset_clamp/492#ifndef EMSCRIPTEN_GL_EXT_polygon_offset_clamp493#define EMSCRIPTEN_GL_EXT_polygon_offset_clamp 1494// To enable: call495bool emscripten_webgl_enable_EXT_polygon_offset_clamp(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);496// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and497// call emscripten_webgl_enable_extension(ctx, "EXT_polygon_offset_clamp");498#define GL_POLYGON_OFFSET_CLAMP_EXT 0x8E1B499WEBGL_APICALL void GL_APIENTRY emscripten_glPolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp);500WEBGL_APICALL void GL_APIENTRY glPolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp);501#endif502503// 51. https://registry.khronos.org/webgl/extensions/EXT_clip_control/504#ifndef EMSCRIPTEN_GL_EXT_clip_control505#define EMSCRIPTEN_GL_EXT_clip_control 1506// To enable: call507bool emscripten_webgl_enable_EXT_clip_control(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);508// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and509// call emscripten_webgl_enable_extension(ctx, "EXT_clip_control");510#define GL_LOWER_LEFT_EXT 0x8CA1511#define GL_UPPER_LEFT_EXT 0x8CA2512#define GL_NEGATIVE_ONE_TO_ONE_EXT 0x935E513#define GL_ZERO_TO_ONE_EXT 0x935F514#define GL_CLIP_ORIGIN_EXT 0x935C515#define GL_CLIP_DEPTH_MODE_EXT 0x935D516WEBGL_APICALL void GL_APIENTRY emscripten_glClipControlEXT(GLenum origin, GLenum depth);517WEBGL_APICALL void GL_APIENTRY glClipControlEXT(GLenum origin, GLenum depth);518#endif519520// 52. https://registry.khronos.org/webgl/extensions/EXT_depth_clamp/521#ifndef EMSCRIPTEN_GL_EXT_depth_clamp522#define EMSCRIPTEN_GL_EXT_depth_clamp 1523// To enable: call emscripten_webgl_enable_extension(ctx, "EXT_depth_clamp");524#define GL_DEPTH_CLAMP_EXT 0x864F525// <no functions exposed>526#endif527528// 53. https://registry.khronos.org/webgl/extensions/WEBGL_polygon_mode/529#ifndef EMSCRIPTEN_GL_WEBGL_polygon_mode530#define EMSCRIPTEN_GL_WEBGL_polygon_mode 1531// To enable: call532bool emscripten_webgl_enable_WEBGL_polygon_mode(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context);533// or link with -sGL_SUPPORT_SIMPLE_ENABLE_EXTENSIONS=1 and534// call emscripten_webgl_enable_extension(ctx, "WEBGL_polygon_mode");535#define GL_POLYGON_MODE_WEBGL 0x0B40536#define GL_POLYGON_OFFSET_LINE_WEBGL 0x2A02537#define GL_LINE_WEBGL 0x1B01538#define GL_FILL_WEBGL 0x1B02539WEBGL_APICALL void GL_APIENTRY emscripten_glPolygonModeWEBGL(GLenum face, GLenum mode);540WEBGL_APICALL void GL_APIENTRY glPolygonModeWEBGL(GLenum face, GLenum mode);541#endif542543/* To add a new GL extension here, follow the template544545// <num>. <online URL to extension documentation>546#ifndef EMSCRIPTEN_GL_<extension_name>547#ifndef EMSCRIPTEN_GL_<extension_name> 1548// To enable: <enable_instructions>549<exposed defines>550<exposed emscripten_gl* function declarations>551<exposed gl* function declarations>552#endif553*/554555556