summaryrefslogtreecommitdiffstats
path: root/third_party/rust/khronos_api/api_webgl
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /third_party/rust/khronos_api/api_webgl
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/khronos_api/api_webgl')
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/ANGLE_instanced_arrays/extension.xml78
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_blend_minmax/extension.xml70
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_float/extension.xml114
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_half_float/extension.xml155
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query/extension.xml358
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query_webgl2/extension.xml243
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_float_blend/extension.xml53
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_frag_depth/extension.xml70
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_sRGB/extension.xml87
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_shader_texture_lod/extension.xml124
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_bptc/extension.xml110
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_rgtc/extension.xml126
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_filter_anisotropic/extension.xml52
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/KHR_parallel_shader_compile/extension.xml103
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_element_index_uint/extension.xml50
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_fbo_render_mipmap/extension.xml74
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_standard_derivatives/extension.xml62
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float/extension.xml91
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float_linear/extension.xml51
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float/extension.xml95
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float_linear/extension.xml52
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/OES_vertex_array_object/extension.xml138
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_color_buffer_float/extension.xml145
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_astc/extension.xml577
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc/extension.xml189
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc1/extension.xml91
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_pvrtc/extension.xml100
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc/extension.xml119
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/extension.xml113
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_renderer_info/extension.xml95
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_shaders/extension.xml79
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_depth_texture/extension.xml265
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_draw_buffers/extension.xml185
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_lose_context/extension.xml114
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_multiview/extension.xml285
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/WEBGL_security_sensitive_resources/extension.xml200
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_clip_cull_distance/extension.xml81
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_multi_draw_arrays/extension.xml102
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_blend_equation_advanced_coherent/extension.xml125
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_debug/extension.xml359
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_dynamic_texture/extension.xml1324
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_subarray_uploads/extension.xml91
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_multisample/extension.xml48
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_source_iframe/extension.xml113
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_video_texture/extension.xml139
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/EXT_texture_storage/extension.xml66
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/OES_depth24/extension.xml69
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_compressed_texture_atc/extension.xml112
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_debug_shader_precision/extension.xml106
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_draw_elements_no_range_check/extension.xml83
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_get_buffer_sub_data_async/extension.xml141
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_shared_resources/extension.xml381
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_subscribe_uniform/extension.xml198
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_texture_from_depth_video/extension.xml108
-rw-r--r--third_party/rust/khronos_api/api_webgl/extensions/template/extension.xml226
-rw-r--r--third_party/rust/khronos_api/api_webgl/specs/latest/1.0/webgl.idl760
-rw-r--r--third_party/rust/khronos_api/api_webgl/specs/latest/2.0/webgl2.idl604
57 files changed, 10149 insertions, 0 deletions
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/ANGLE_instanced_arrays/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/ANGLE_instanced_arrays/extension.xml
new file mode 100644
index 0000000000..4962e1fed2
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/ANGLE_instanced_arrays/extension.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+<ratified href="ANGLE_instanced_arrays/">
+ <name>ANGLE_instanced_arrays</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Contributors to ANGLE_instanced_arrays</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>19</number>
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0" />
+ </depends>
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/ANGLE/ANGLE_instanced_arrays.txt" name="ANGLE_instanced_arrays">
+ <addendum>
+ The implementation must validate the indices referenced by <code>drawArraysInstancedANGLE</code> and <code>drawElementsInstancedANGLE</code>
+ similarly to how indices referenced by <code>drawArrays</code> and <code>drawElements</code> are validated according to section
+ <a href="http://www.khronos.org/registry/webgl/specs/1.0/#ATTRIBS_AND_RANGE_CHECKING">Enabled Vertex Attributes and Range Checking</a> of the
+ WebGL specification.
+ </addendum>
+ </mirrors>
+ <p>
+ Although the extension contains ANGLE in the name it may be exposed by any implementation, whether or not the implementation uses the ANGLE library.
+ </p>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface ANGLE_instanced_arrays {
+ const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
+ void drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+ void drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);
+ void vertexAttribDivisorANGLE(GLuint index, GLuint divisor);
+};
+ </idl>
+ <issues>
+ <p>How does ANGLE_instanced_arrays interact with OES_vertex_array_object?</p>
+ <ul>
+ <li>
+ <p>RESOLVED: When the ANGLE_instanced_arrays and OES_vertex_array_object
+ extensions are both enabled, attribute divisors are tracked by the
+ vertex array objects like any other vertex array state.
+ </p>
+ </li>
+ </ul>
+ </issues>
+ <history>
+ <revision date="2012/03/06">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/01/26">
+ <change>Moved from proposal to draft.</change>
+ </revision>
+ <revision date="2013/03/11">
+ <change>Renumbered to 19 to fix misnumbering problem.</change>
+ </revision>
+ <revision date="2013/08/06">
+ <change>Moved to community approved.</change>
+ </revision>
+ <revision date="2013/08/22">
+ <change>Clarified non-ANGLE support.</change>
+ </revision>
+ <revision date="2014/03/13">
+ <change>Addendum about index validation.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2014/08/08">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2015/09/23">
+ <change>Clarified interaction with OES_vertex_array_object.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_blend_minmax/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_blend_minmax/extension.xml
new file mode 100644
index 0000000000..6d32712aa5
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_blend_minmax/extension.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ratified href="EXT_blend_minmax/">
+ <name>EXT_blend_minmax</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>25</number>
+
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0" />
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/blend_minmax.txt"
+ name="EXT_blend_minmax">
+ </mirrors>
+
+ <features>
+ <feature>
+ The <code>blendEquation</code> and <code>blendEquationSeparate</code>
+ entry points are extended to accept <code>MIN_EXT</code> and <code>MAX_EXT</code>
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_blend_minmax {
+ const GLenum MIN_EXT = 0x8007;
+ const GLenum MAX_EXT = 0x8008;
+};
+ </idl>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ var ext = gl.getExtension('EXT_blend_minmax');
+ gl.blendEquation(ext.MAX_EXT);
+ gl.getParameter(gl.BLEND_EQUATION) == ext.MAX_EXT;
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2012/12/12">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2014/02/12">
+ <change>Moved to draft.</change>
+ </revision>
+ <revision date="2014/05/12">
+ <change>Removed blendEquationEXT function and the BLEND_EQUATION_EXT and
+ FUNC_ADD_EXT enums, all of which are already have equivalents in WebGL.</change>
+ </revision>
+ <revision date="2014/06/27">
+ <change>Moved to community approved after discussion on public_webgl list.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2015/05/29">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_float/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_float/extension.xml
new file mode 100644
index 0000000000..594b3f906a
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_float/extension.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extension href="EXT_color_buffer_float/">
+ <name>EXT_color_buffer_float</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Mark Callow, HI Corporation</contributor>
+
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>31</number>
+
+ <depends>
+ <api version="2.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_color_buffer_float.txt"
+ name="EXT_color_buffer_float">
+ <addendum>
+ The sized internal format <code>RGB16F</code> is not color-renderable in this
+ extension. This is a difference in functionality compared to the <a
+ href="../EXT_color_buffer_half_float">EXT_color_buffer_half_float</a> extension.
+ </addendum>
+ </mirrors>
+
+ <features>
+ <feature>
+ <p>The following floating-point internal formats become <span
+ style="font-style: italic">color-renderable</span>: <code>R16F</code>,
+ <code>RG16F</code>, <code>RGBA16F</code>, <code>R32F</code>,
+ <code>RG32F</code>, <code>RGBA32F</code> and
+ <code>R11F_G11F_B10F</code>. A renderbuffer or a texture with a
+ color-renderable internal format can be used as a rendering target by
+ attaching it to a framebuffer object as a color attachment.</p>
+ </feature>
+
+ <feature>
+ <p>Renderbuffers with these internal formats can be created.</p>
+ </feature>
+
+ <feature>
+ <p>The format and type combination <code>RGBA</code> and
+ <code>FLOAT</code> becomes valid for reading from a floating-point
+ color buffer.</p>
+ </feature>
+ </features>
+
+ <p>Notes: <ul style="list-style-type: circle">
+ <li>Fragment shader outputs to buffers with these internal formats are
+ not clamped.</li>
+
+ <li>Colors specified with <code>clearColor</code> and
+ <code>blendColor</code> are not clamped when applied to buffers with
+ these internal formats.</li>
+
+ <li>The format and type combination <code>RGBA</code> and
+ <code>UNSIGNED_BYTE</code> cannot be used for reading from a
+ floating-point color buffer.</li>
+
+ <li>Multi-sample floating-point color renderbuffers may optionally be supported. Limitations
+ are defined in the <a
+ href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_color_buffer_float.txt">EXT_color_buffer_float</a>
+ extension.</li>
+
+ <li>The sized internal format <code>RGB16F</code> is not color-renderable in this
+ extension.</li>
+ </ul></p>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_color_buffer_float {
+}; // interface EXT_color_buffer_float
+</idl>
+
+ <history>
+ <revision date="2012/11/08">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+
+ <revision date="2014/10/29">
+ <change>Moved to draft status.</change>
+ </revision>
+
+ <revision date="2016/04/14">
+ <change>Moved to community approved status.</change>
+ </revision>
+
+ <revision date="2016/06/16">
+ <change>Added note about RGB16F not being color-renderable.</change>
+ </revision>
+
+ <revision date="2016/07/21">
+ <change>Allowed allocation of multi-sample floating-point color renderbuffers as optional functionality.</change>
+ <change>Changed XML tags to fix incorrect statement that there are no behavioral changes compared to the native extension.</change>
+ </revision>
+
+ <revision date="2016/08/03">
+ <change>Removed incorrect statement about framebuffer completeness and multi-sampled floating-point color renderbuffers.</change>
+ </revision>
+
+ <revision date="2017/04/19">
+ <change>Allowed these float formats for CopyTexImage2D.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_half_float/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_half_float/extension.xml
new file mode 100644
index 0000000000..4385cd6d04
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_color_buffer_half_float/extension.xml
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extension href="EXT_color_buffer_half_float/">
+ <name>EXT_color_buffer_half_float</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Mark Callow, HI Corporation</contributor>
+
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>14</number>
+
+ <depends>
+ <api version="1.0"/>
+
+ <ext name="OES_texture_half_float" require="true"/>
+
+ <subsumed version="2.0" by="EXT_color_buffer_float" />
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_color_buffer_half_float.txt"
+ name="EXT_color_buffer_half_float">
+ <addendum>
+ <p>All references to <code>R16F</code> and <code>RG16F</code> types
+ are ignored.</p>
+ </addendum>
+ <addendum>
+ <p>WebGL implementations supporting this extension are required to
+ support rendering to <code>RGBA16F</code> format.</p>
+ </addendum>
+ </mirrors>
+
+ <features>
+ <feature>
+ <p>The 16-bit floating-point types <code>RGB16F</code> and
+ <code>RGBA16F</code> become available as color-renderable formats.
+ Renderbuffers can be created in these formats. These and textures
+ created with <code>type = HALF_FLOAT_OES</code>, which will have one
+ of these internal formats, can be attached to framebuffer object color
+ attachments for rendering. Implementations supporting this extension are
+ required to support rendering to <code>RGBA16F</code> format.
+ Applications must check framebuffer completeness to determine if
+ <code>RGB16F</code> is supported.</p>
+ </feature>
+
+ <feature>
+ <p><span style="color: red">NOTE:</span> fragment shaders outputs
+ gl_FragColor and gl_FragData[0] will only be clamped and converted
+ when the color buffer is fixed-point and <code>blendColor()</code> and
+ <code>clearColor()</code> will no longer clamp their parameter values
+ on input. Clamping will be applied as necessary at draw time according
+ to the type of color buffer in use.</p>
+ </feature>
+
+ <feature>
+ <p>The format and type combination <code>RGBA</code> and
+ <code>FLOAT</code> becomes valid for reading from a floating-point
+ rendering buffer. Note: <code>RGBA</code> and
+ <code>UNSIGNED_BYTE</code> cannot be used for reading from a
+ floating-point rendering buffer.</p>
+ </feature>
+
+ <feature>
+ <p>The component types of framebuffer object attachments can be
+ queried.</p>
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_color_buffer_half_float {
+ const GLenum RGBA16F_EXT = 0x881A;
+ const GLenum RGB16F_EXT = 0x881B;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
+ const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
+}; // interface EXT_color_buffer_half_float
+ </idl>
+
+ <additions>
+ <p>In section 5.13.12 <cite>Reading back pixels</cite>, change the allowed
+ format and types table to:</p>
+
+ <dl class="methods">
+ <dd>
+ <table>
+ <tbody>
+ <tr>
+ <th>frame buffer type</th>
+ <th>
+ <code>format</code>
+ </th>
+ <th>
+ <code>type</code>
+ </th>
+ </tr>
+
+ <tr>
+ <td>normalized fixed-point</td>
+ <td>RGBA</td>
+ <td>UNSIGNED_BYTE</td>
+ </tr>
+
+ <tr>
+ <td>floating-point</td>
+ <td>RGBA</td>
+ <td>FLOAT</td>
+ </tr>
+ </tbody>
+ </table>
+ </dd>
+ </dl>
+
+ <p>Change the paragraph beginning "If <code>pixels</code> is null ..."
+ to</p><blockquote>If frame buffer type is not that indicated in the table for
+ the <code>format</code> and <code>type</code> combination, an
+ INVALID_OPERATON error is generated. If pixels is null
+ ...</blockquote>
+ </additions>
+
+ <history>
+ <revision date="2012/11/08">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2012/11/13">
+ <change>"Add reading-pixels-as-FLOAT feature to the Overview and related
+ changes to WebGL section 5.13.12.</change>
+ </revision>
+
+ <revision date="2012/11/26">
+ <change>Move to draft.</change>
+ </revision>
+
+ <revision date="2014/07/15">
+ <change>Removed webgl module. Added NoInterfaceObject extended attribute.</change>
+ </revision>
+
+ <revision date="2014/11/24">
+ <change>Move to community approved.</change>
+ </revision>
+
+ <revision date="2016/05/05">
+ <change>Subsumed in WebGL 2.0 by EXT_color_buffer_float.</change>
+ </revision>
+
+ <revision date="2017/09/14">
+ <change>Require RGBA16F to be color-renderable and RGB16F to be optionally color-renderable.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query/extension.xml
new file mode 100644
index 0000000000..6b630aa8e1
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query/extension.xml
@@ -0,0 +1,358 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extension href="EXT_disjoint_timer_query/">
+ <name>EXT_disjoint_timer_query</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Contributors to ARB_occlusion_query</contributor>
+ <contributor>Contributors to EXT_timer_query</contributor>
+ <contributor>Contributors to ARB_timer_query</contributor>
+ <contributor>Ben Vanik, Google Inc.</contributor>
+ <contributor>Daniel Koch, TransGaming Inc.</contributor>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>26</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_disjoint_timer_query.txt"
+ name="EXT_disjoint_timer_query">
+ <addendum>
+ Specifies that queries' results only become available at certain well-defined times.
+ </addendum>
+ </mirrors>
+
+ <features>
+ <feature>
+ This extension provides a query mechanism that can be used to determine
+ the amount of time it takes to fully complete a set of GL commands, and
+ without stalling the rendering pipeline. It uses the query object
+ mechanisms first introduced in the occlusion query extension, which allow
+ time intervals to be polled asynchronously by the application.
+ </feature>
+ <feature>
+ This version of the disjoint_timer_query extension is exposed
+ only on on WebGL 1.0 contexts. See the _webgl2 version of the
+ extension for how it is exposed on WebGL 2.0 contexts.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+typedef unsigned long long GLuint64EXT;
+
+[NoInterfaceObject]
+interface WebGLTimerQueryEXT : WebGLObject {
+};
+
+[NoInterfaceObject]
+interface EXT_disjoint_timer_query {
+ const GLenum QUERY_COUNTER_BITS_EXT = 0x8864;
+ const GLenum CURRENT_QUERY_EXT = 0x8865;
+ const GLenum QUERY_RESULT_EXT = 0x8866;
+ const GLenum QUERY_RESULT_AVAILABLE_EXT = 0x8867;
+ const GLenum TIME_ELAPSED_EXT = 0x88BF;
+ const GLenum TIMESTAMP_EXT = 0x8E28;
+ const GLenum GPU_DISJOINT_EXT = 0x8FBB;
+
+ WebGLTimerQueryEXT? createQueryEXT();
+ void deleteQueryEXT(WebGLTimerQueryEXT? query);
+ [WebGLHandlesContextLoss] boolean isQueryEXT(WebGLTimerQueryEXT? query);
+ void beginQueryEXT(GLenum target, WebGLTimerQueryEXT query);
+ void endQueryEXT(GLenum target);
+ void queryCounterEXT(WebGLTimerQueryEXT query, GLenum target);
+ any getQueryEXT(GLenum target, GLenum pname);
+ any getQueryObjectEXT(WebGLTimerQueryEXT query, GLenum pname);
+};
+ </idl>
+
+ <newfun>
+ <function name="createQueryEXT" type="WebGLTimerQueryEXT?">
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="deleteQueryEXT" type="void">
+ <param name="query" type="WebGLTimerQueryEXT?"/>
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="isQueryEXT" type="boolean">
+ <param name="query" type="WebGLTimerQueryEXT?"/>
+ Returns true if the passed WebGLTimerQueryEXT is valid and false otherwise. Returns false if
+ the query's <a
+ href="http://www.khronos.org/registry/webgl/specs/1.0.1/#webgl-object-invalidated-flag">invalidated
+ flag</a> is set.
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="beginQueryEXT" type="void">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="WebGLTimerQueryEXT?"/>
+ <code>target</code> accepts <code>TIME_ELAPSED_EXT</code>.
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="endQueryEXT" type="void">
+ <param name="target" type="GLenum"/>
+ <code>target</code> accepts <code>TIME_ELAPSED_EXT</code>.
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="queryCounterEXT" type="void">
+ <param name="query" type="WebGLTimerQueryEXT?"/>
+ <param name="target" type="GLenum"/>
+ <code>target</code> accepts <code>TIMESTAMP_EXT</code>.
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="getQueryEXT" type="any">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <code>target</code> and <code>pname</code> accept the following combinations of
+ parameters. The return type of this method depends on the parameter queried.
+ <br/>
+ <table width="30%">
+ <tr><th>target</th><th>pname</th><th>returned type</th></tr>
+ <tr><td>TIME_ELAPSED_EXT</td><td>CURRENT_QUERY</td><td>WebGLQuery?</td></tr>
+ <tr><td>TIMESTAMP_EXT</td><td>CURRENT_QUERY</td><td>null</td></tr>
+ <tr><td>TIME_ELAPSED_EXT</td><td>QUERY_COUNTER_BITS_EXT</td><td>GLint</td></tr>
+ <tr><td>TIMESTAMP_EXT</td><td>QUERY_COUNTER_BITS_EXT</td><td>GLint</td></tr>
+ </table>
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="getQueryObjectEXT" type="any">
+ <param name="query" type="WebGLTimerQueryEXT?"/>
+ <param name="pname" type="GLenum"/>
+ <code>pname</code> accepts <code>QUERY_RESULT_EXT</code> or <code>QUERY_RESULT_AVAILABLE_EXT</code>.
+ <br/>
+ The return type of this method depends on the parameter queried:
+ <table width="30%">
+ <tr><th>pname</th><th>returned type</th></tr>
+ <tr><td>QUERY_RESULT_EXT</td><td>GLuint64EXT</td></tr>
+ <tr><td>QUERY_RESULT_AVAILABLE_EXT</td><td>boolean</td></tr>
+ </table>
+ <br/>
+ In order to ensure consistent behavior across platforms, queries' results must only be made
+ available when the user agent's <a
+ href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#event-loops">event
+ loop</a> is not executing a task. In other words:
+ <ul>
+ <li> A query's result must not be made available until control has returned to the user
+ agent's main loop. </li>
+ <li> Repeatedly fetching a query's QUERY_RESULT_AVAILABLE_EXT parameter in a loop, without
+ returning control to the user agent, must always return the same value. </li>
+ </ul>
+
+ <div class="note">
+ A query's result may or may not be made available when control returns to the user
+ agent's event loop. It is not guaranteed that using a single setTimeout callback with a
+ delay of 0, or a single requestAnimationFrame callback, will allow sufficient time for
+ the WebGL implementation to supply the query's results.
+ </div>
+
+ <div class="note rationale">
+ This change compared to the original extension specification is enforced in order to prevent
+ applications from relying on being able to issue a query and fetch its result in the same
+ frame. In order to ensure best portability among devices and best performance among
+ implementations, applications must expect that queries' results will become available
+ asynchronously.
+ </div>
+ </function>
+ </newfun>
+
+ <newtok>
+ <function name="getParameter" type="any">
+ <param name="pname" type="GLenum"/>
+ <code>pname</code> accepts <code>TIMESTAMP_EXT</code> or <code>GPU_DISJOINT_EXT</code>.
+ <br/>
+
+ The return type depends on the parameter queried:
+ <table width="30%">
+ <tr><th>pname</th><th>returned type</th></tr>
+ <tr><td>TIMESTAMP_EXT</td><td>GLuint64EXT</td></tr>
+ <tr><td>GPU_DISJOINT_EXT</td><td>boolean</td></tr>
+ </table>
+ </function>
+ </newtok>
+
+ <issues>
+ <ol>
+ <li>
+ <p>
+ Can getQueryObjectEXT be exposed in its current form according to ECMAScript
+ semantics? ECMAScript's <a
+ href="http://wiki.ecmascript.org/doku.php?id=strawman:concurrency">de-facto concurrency
+ model</a> is "shared nothing" communicating event loops. Is it acceptable for sequential
+ calls to getQueryObjectEXT to return different answers? Note that Date.now() advances
+ during script execution, so this may be fine; but if concerns are raised, then the API may
+ need to be redesigned to use callbacks.
+ </p>
+ </li>
+ </ol>
+ </issues>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ // Example (1) -- uses beginQueryEXT/endQueryEXT.
+ var ext = gl.getExtension('EXT_disjoint_timer_query');
+ var query = ext.createQueryEXT();
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, query);
+
+ // Draw object
+ gl.drawElements(...);
+
+ ext.endQueryEXT(ext.TIME_ELAPSED_EXT);
+
+ // ...at some point in the future, after returning control to the browser and being called again:
+ var available = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_AVAILABLE_EXT);
+ var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
+
+ if (available &amp;&amp; !disjoint) {
+ // See how much time the rendering of the object took in nanoseconds.
+ var timeElapsed = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT);
+
+ // Do something useful with the time. Note that care should be
+ // taken to use all significant bits of the result, not just the
+ // least significant 32 bits.
+ adjustObjectLODBasedOnDrawTime(timeElapsed);
+ }
+
+ //----------------------------------------------------------------------
+
+ // Example (2) -- same as the example above, but uses queryCounterEXT instead.
+ var ext = gl.getExtension('EXT_disjoint_timer_query');
+ var startQuery = ext.createQueryEXT();
+ var endQuery = ext.createQueryEXT();
+ ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT);
+
+ // Draw object
+ gl.drawElements(...);
+
+ ext.queryCounterEXT(endQuery, ext.TIMESTAMP_EXT);
+
+ // ...at some point in the future, after returning control to the browser and being called again:
+ var available = ext.getQueryObjectEXT(endQuery, ext.QUERY_RESULT_AVAILABLE_EXT);
+ var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
+
+ if (available &amp;&amp; !disjoint) {
+ // See how much time the rendering of the object took in nanoseconds.
+ var timeStart = ext.getQueryObjectEXT(startQuery, ext.QUERY_RESULT_EXT);
+ var timeEnd = ext.getQueryObjectEXT(endQuery, ext.QUERY_RESULT_EXT);
+
+ // Do something useful with the time. Note that care should be
+ // taken to use all significant bits of the result, not just the
+ // least significant 32 bits.
+ adjustObjectLODBasedOnDrawTime(timeEnd - timeStart);
+ }
+
+ //----------------------------------------------------------------------
+
+ // Example (3) -- check the number of timestamp bits to determine how to best
+ // measure elapsed time.
+ var ext = gl.getExtension('EXT_disjoint_timer_query');
+ var timeElapsedQuery;
+ var startQuery;
+ var endQuery;
+
+ var useTimestamps = false;
+
+ if (ext.getQueryEXT(ext.TIMESTAMP_EXT, ext.QUERY_COUNTER_BITS_EXT) > 0) {
+ useTimestamps = true;
+ }
+
+ // Clear the disjoint state before starting to work with queries to increase
+ // the chances that the results will be valid.
+ gl.getParameter(ext.GPU_DISJOINT_EXT);
+
+ if (useTimestamps) {
+ startQuery = ext.createQueryEXT();
+ endQuery = ext.createQueryEXT();
+ ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT);
+ } else {
+ timeElapsedQuery = ext.createQueryEXT();
+ ext.beginQueryEXT(ext.TIME_ELAPSED_EXT, timeElapsedQuery);
+ }
+
+ // Draw object
+ gl.drawElements(...);
+
+ if (useTimestamps) {
+ ext.queryCounterEXT(endQuery, ext.TIMESTAMP_EXT);
+ } else {
+ ext.endQueryEXT(ext.TIME_ELAPSED_EXT);
+ }
+
+ // ...at some point in the future, after returning control to the browser and being called again:
+ var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
+ if (disjoint) {
+ // Have to redo all of the measurements.
+ } else {
+ var available;
+ if (useTimestamps) {
+ available = ext.getQueryObjectEXT(endQuery, ext.QUERY_RESULT_AVAILABLE_EXT);
+ } else {
+ available = ext.getQueryObjectEXT(timeElapsedQuery, ext.QUERY_RESULT_AVAILABLE_EXT);
+ }
+
+ if (available) {
+ var timeElapsed;
+ if (useTimestamps) {
+ // See how much time the rendering of the object took in nanoseconds.
+ var timeStart = ext.getQueryObjectEXT(startQuery, ext.QUERY_RESULT_EXT);
+ var timeEnd = ext.getQueryObjectEXT(endQuery, ext.QUERY_RESULT_EXT);
+ timeElapsed = timeEnd - timeStart;
+ } else {
+ timeElapsed = ext.getQueryObjectEXT(query, ext.QUERY_RESULT_EXT);
+ }
+
+ // Do something useful with the time. Note that care should be
+ // taken to use all significant bits of the result, not just the
+ // least significant 32 bits.
+ adjustObjectLODBasedOnDrawTime(timeElapsed);
+ }
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2013/04/02">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/04/03">
+ <change>Based on public_webgl discussion, specified that queries' results only become available at well-defined times.</change>
+ </revision>
+ <revision date="2014/02/12">
+ <change>Recast as EXT_disjoint_timer_query and harmonized with mirrored extension.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2015/10/05">
+ <change>Revised language regarding queries' availability based on feedback from Jeff Gilbert.</change>
+ </revision>
+ <revision date="2015/10/19">
+ <change>Promoted to community approved after discussion on public_webgl.</change>
+ </revision>
+ <revision date="2016/06/08">
+ <change>Added example choosing measurement technique based on number of timestamp bits.</change>
+ </revision>
+ <revision date="2016/09/30">
+ <change>Added clarifying note that this document only applies to WebGL 1.0. Minor reformatting and typo fixes.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query_webgl2/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query_webgl2/extension.xml
new file mode 100644
index 0000000000..188bcd4b62
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_disjoint_timer_query_webgl2/extension.xml
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extension href="EXT_disjoint_timer_query_webgl2/">
+ <name>EXT_disjoint_timer_query_webgl2</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Contributors to ARB_occlusion_query</contributor>
+ <contributor>Contributors to EXT_timer_query</contributor>
+ <contributor>Contributors to ARB_timer_query</contributor>
+ <contributor>Ben Vanik, Google Inc.</contributor>
+ <contributor>Daniel Koch, TransGaming Inc.</contributor>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>33</number>
+
+ <depends>
+ <api version="2.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_disjoint_timer_query.txt"
+ name="EXT_disjoint_timer_query">
+ <addendum>
+ Specifies that queries' results only become available at certain well-defined times.
+ </addendum>
+ </mirrors>
+
+ <features>
+ <feature>
+ This extension provides the same functionality as <a
+ href="../EXT_disjoint_timer_query/">EXT_disjoint_timer_query</a>. The IDL, description, and
+ extension name are specialized for WebGL 2.0, which incorporates query objects into the core
+ specification.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+typedef unsigned long long GLuint64EXT;
+
+[NoInterfaceObject]
+interface EXT_disjoint_timer_query_webgl2 {
+ const GLenum QUERY_COUNTER_BITS_EXT = 0x8864;
+ const GLenum TIME_ELAPSED_EXT = 0x88BF;
+ const GLenum TIMESTAMP_EXT = 0x8E28;
+ const GLenum GPU_DISJOINT_EXT = 0x8FBB;
+
+ void queryCounterEXT(WebGLQuery query, GLenum target);
+};
+ </idl>
+
+ <newtok>
+ <function name="beginQuery" type="">
+ <param name="target" type="GLenum"/>
+ <param name="query" type="WebGLQuery?"/>
+ <code>target</code> accepts <code>TIME_ELAPSED_EXT</code>.
+ </function>
+ </newtok>
+
+ <newtok>
+ <function name="endQuery" type="void">
+ <param name="target" type="GLenum"/>
+ <code>target</code> accepts <code>TIME_ELAPSED_EXT</code>.
+ </function>
+ </newtok>
+
+ <newfun>
+ <function name="queryCounterEXT" type="void">
+ <param name="query" type="WebGLQuery"/>
+ <param name="target" type="GLenum"/>
+ <code>target</code> accepts <code>TIMESTAMP_EXT</code>.
+ </function>
+ </newfun>
+
+ <newtok>
+ <function name="getQuery" type="any">
+ <param name="target" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ <code>target</code> and <code>pname</code> accept the following combinations of
+ parameters. The return type of this method now depends on the parameter queried.
+ <br/>
+ <table width="30%">
+ <tr><th>target</th><th>pname</th><th>returned type</th></tr>
+ <tr><td>TIME_ELAPSED_EXT</td><td>CURRENT_QUERY</td><td>WebGLQuery?</td></tr>
+ <tr><td>TIMESTAMP_EXT</td><td>CURRENT_QUERY</td><td>null</td></tr>
+ <tr><td>TIME_ELAPSED_EXT</td><td>QUERY_COUNTER_BITS_EXT</td><td>GLint</td></tr>
+ <tr><td>TIMESTAMP_EXT</td><td>QUERY_COUNTER_BITS_EXT</td><td>GLint</td></tr>
+ </table>
+ </function>
+ </newtok>
+
+ <newtok>
+ <function name="getParameter" type="any">
+ <param name="pname" type="GLenum"/>
+ <code>pname</code> accepts <code>TIMESTAMP_EXT</code> or <code>GPU_DISJOINT_EXT</code>.
+ <br/>
+
+ The return type depends on the parameter queried:
+ <table width="30%">
+ <tr><th>pname</th><th>returned type</th></tr>
+ <tr><td>TIMESTAMP_EXT</td><td>GLuint64EXT</td></tr>
+ <tr><td>GPU_DISJOINT_EXT</td><td>boolean</td></tr>
+ </table>
+ </function>
+ </newtok>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ // Example (1) -- uses beginQuery/endQuery.
+ var ext = gl.getExtension('EXT_disjoint_timer_query_webgl2');
+ var query = gl.createQuery();
+ gl.beginQuery(ext.TIME_ELAPSED_EXT, query);
+
+ // Draw object
+ gl.drawElements(...);
+
+ gl.endQuery(ext.TIME_ELAPSED_EXT);
+
+ // ...at some point in the future, after returning control to the browser and being called again:
+ var available = gl.getQueryParameter(query, gl.QUERY_RESULT_AVAILABLE);
+ var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
+
+ if (available &amp;&amp; !disjoint) {
+ // See how much time the rendering of the object took in nanoseconds.
+ var timeElapsed = gl.getQueryParameter(query, gl.QUERY_RESULT);
+
+ // Do something useful with the time. Note that care should be
+ // taken to use all significant bits of the result, not just the
+ // least significant 32 bits.
+ adjustObjectLODBasedOnDrawTime(timeElapsed);
+ }
+
+ //----------------------------------------------------------------------
+
+ // Example (2) -- same as the example above, but uses queryCounterEXT instead.
+ var ext = gl.getExtension('EXT_disjoint_timer_query_webgl2');
+ var startQuery = gl.createQuery();
+ var endQuery = gl.createQuery();
+ ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT);
+
+ // Draw object
+ gl.drawElements(...);
+
+ ext.queryCounterEXT(endQuery, ext.TIMESTAMP_EXT);
+
+ // ...at some point in the future, after returning control to the browser and being called again:
+ var available = gl.getQueryParameter(endQuery, gl.QUERY_RESULT_AVAILABLE);
+ var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
+
+ if (available &amp;&amp; !disjoint) {
+ // See how much time the rendering of the object took in nanoseconds.
+ var timeStart = gl.getQueryParameter(startQuery, gl.QUERY_RESULT);
+ var timeEnd = gl.getQueryParameter(endQuery, gl.QUERY_RESULT);
+
+ // Do something useful with the time. Note that care should be
+ // taken to use all significant bits of the result, not just the
+ // least significant 32 bits.
+ adjustObjectLODBasedOnDrawTime(timeEnd - timeStart);
+ }
+
+ //----------------------------------------------------------------------
+
+ // Example (3) -- check the number of timestamp bits to determine how to best
+ // measure elapsed time.
+ var ext = gl.getExtension('EXT_disjoint_timer_query_webgl2');
+ var timeElapsedQuery;
+ var startQuery;
+ var endQuery;
+
+ var useTimestamps = false;
+
+ if (gl.getQuery(ext.TIMESTAMP_EXT, ext.QUERY_COUNTER_BITS_EXT) > 0) {
+ useTimestamps = true;
+ }
+
+ // Clear the disjoint state before starting to work with queries to increase
+ // the chances that the results will be valid.
+ gl.getParameter(ext.GPU_DISJOINT_EXT);
+
+ if (useTimestamps) {
+ startQuery = gl.createQuery();
+ endQuery = gl.createQuery();
+ ext.queryCounterEXT(startQuery, ext.TIMESTAMP_EXT);
+ } else {
+ timeElapsedQuery = gl.createQuery();
+ gl.beginQuery(ext.TIME_ELAPSED_EXT, timeElapsedQuery);
+ }
+
+ // Draw object
+ gl.drawElements(...);
+
+ if (useTimestamps) {
+ ext.queryCounterEXT(endQuery, ext.TIMESTAMP_EXT);
+ } else {
+ gl.endQuery(ext.TIME_ELAPSED_EXT);
+ }
+
+ // ...at some point in the future, after returning control to the browser and being called again:
+ var disjoint = gl.getParameter(ext.GPU_DISJOINT_EXT);
+ if (disjoint) {
+ // Have to redo all of the measurements.
+ } else {
+ var available;
+ if (useTimestamps) {
+ available = gl.getQueryParameter(endQuery, gl.QUERY_RESULT_AVAILABLE);
+ } else {
+ available = gl.getQueryParameter(timeElapsedQuery, gl.QUERY_RESULT_AVAILABLE);
+ }
+
+ if (available) {
+ var timeElapsed;
+ if (useTimestamps) {
+ // See how much time the rendering of the object took in nanoseconds.
+ var timeStart = gl.getQueryParameter(startQuery, gl.QUERY_RESULT);
+ var timeEnd = gl.getQueryParameter(endQuery, gl.QUERY_RESULT);
+ timeElapsed = timeEnd - timeStart;
+ } else {
+ timeElapsed = gl.getQueryParameter(query, gl.QUERY_RESULT);
+ }
+
+ // Do something useful with the time. Note that care should be
+ // taken to use all significant bits of the result, not just the
+ // least significant 32 bits.
+ adjustObjectLODBasedOnDrawTime(timeElapsed);
+ }
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2016/09/30">
+ <change>Split WebGL 2.0 specification of this extension into its own file
+ for better comprehensibility.</change>
+ </revision>
+ <revision date="2016/10/11">
+ <change>Fixed errors in sample code pointed out by @juj.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_float_blend/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_float_blend/extension.xml
new file mode 100644
index 0000000000..2836759eab
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_float_blend/extension.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<draft href="EXT_float_blend/">
+ <name>EXT_float_blend</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Mark Callow</contributor>
+
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>35</number>
+
+ <depends>
+ <api version="2.0"/>
+ <ext name="EXT_color_buffer_float" require="true"/>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_float_blend.txt"
+ name="EXT_float_blend"/>
+
+ <features>
+ <feature>
+ <p>An <code>INVALID_OPERATION</code> error will no longer be raised by
+ <code>drawArrays</code> or <code>drawElements</code> when blending is
+ enabled and the draw buffer has 32-bit floating-point components. Note
+ that in order to create such a draw buffer the
+ <a href="http://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_float">
+ EXT_color_buffer_float</a> extension must be enabled.</p>
+ </feature>
+ </features>
+
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_float_blend {
+}; // interface EXT_float_blend
+</idl>
+
+ <history>
+ <revision date="2015/04/13">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2017/01/03">
+ <change>Promoted to draft status after discussion on public_webgl.</change>
+ </revision>
+ </history>
+</draft>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_frag_depth/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_frag_depth/extension.xml
new file mode 100644
index 0000000000..08006fb4f1
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_frag_depth/extension.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ratified href="EXT_frag_depth/">
+ <name>EXT_frag_depth</name>
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>16</number>
+
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0">
+ <glsl version="300 es"/>
+ </core>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_frag_depth.txt"
+ name="EXT_frag_depth">
+ </mirrors>
+
+ <features>
+ <feature>
+ Adds the ability to set the depth value of a fragment from
+ within the fragment shader with the built-in output variable gl_FragDepthEXT.
+ </feature>
+ <glsl extname="GL_EXT_frag_depth">
+ <stage type="fragment"/>
+ <output name="gl_FragDepthEXT" type="float" />
+ </glsl>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+ [NoInterfaceObject]
+ interface EXT_frag_depth {
+ };
+ </idl>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ void main(){
+ gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);
+ gl_FragDepthEXT = 0.5;
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2012/11/22">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2012/12/17">
+ <change>Moved to draft.</change>
+ </revision>
+ <revision date="2014/05/13">
+ <change>Moved to community approved.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2015/05/29">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_sRGB/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_sRGB/extension.xml
new file mode 100644
index 0000000000..b08cfe6983
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_sRGB/extension.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extension href="EXT_sRGB/">
+ <name>EXT_sRGB</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>17</number>
+
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0">
+ <addendum>Additional format restrictions apply for CopyTexImage2D</addendum>
+ </core>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_sRGB.txt"
+ name="EXT_sRGB">
+ </mirrors>
+
+ <features>
+ <feature>
+ Adds the sRGB support to textures and framebuffer objects.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+ [NoInterfaceObject]
+ interface EXT_sRGB {
+ const GLenum SRGB_EXT = 0x8C40;
+ const GLenum SRGB_ALPHA_EXT = 0x8C42;
+ const GLenum SRGB8_ALPHA8_EXT = 0x8C43;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
+ };
+ </idl>
+
+ <newtok>
+ <function name="texImage2D">
+ <param name="format" type="GLenum"/>
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>format</code> and <code>internalformat</code> parameters: <code>SRGB_EXT</code> and <code>SRGB_ALPHA_EXT</code>
+ </function>
+ <function name="texSubImage2D">
+ <param name="format" type="GLenum"/>
+ Accepted by the <code>format</code> parameter: <code>SRGB_EXT</code> and <code>SRGB_ALPHA_EXT</code>
+ </function>
+ <function name="renderbufferStorage">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter: <code>SRGB_ALPHA8_EXT</code>
+ </function>
+ <function name="getFramebufferAttachmentParameter">
+ <param name="pname" type="GLenum"/>
+ Accepted by the <code>pname</code> parameter: FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT
+ </function>
+ </newtok>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ var ext = gl.getExtension('EXT_sRGB');
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ texImage2D(gl.TEXTURE_2D, 0, ext.SRGB_EXT, 256, 256, 0, ext.SRGB_EXT, gl.UNSIGNED_BYTE, data);
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2012/12/16">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/01/26">
+ <change>Moved from proposal to draft</change>
+ </revision>
+ <revision date="2014/05/13">
+ <change>Moved from draft to community approved</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_shader_texture_lod/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_shader_texture_lod/extension.xml
new file mode 100644
index 0000000000..7cf8467d41
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_shader_texture_lod/extension.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ratified href="EXT_shader_texture_lod/">
+ <name>EXT_shader_texture_lod</name>
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Vladimir Vukicevic (vladimir 'at' mozilla.com)</contributor>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>27</number>
+
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0">
+ <glsl version="300 es"/>
+ </core>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_shader_texture_lod.txt"
+ name="EXT_shader_texture_lod">
+ </mirrors>
+
+ <features>
+ <feature>
+ This extension adds additional texture functions to the
+ OpenGL ES Shading Language which provide the shader writer
+ with explicit control of LOD.
+ </feature>
+ <glsl extname="GL_EXT_shader_texture_lod">
+ <stage type="fragment"/>
+ <function name="texture2DLodEXT" type="vec4">
+ <param name="sampler" type="sampler2D" />
+ <param name="coord" type="vec2" />
+ <param name="lod" type="float" />
+ </function>
+ <function name="texture2DProjLodEXT" type="vec4">
+ <param name="sampler" type="sampler2D" />
+ <param name="coord" type="vec3" />
+ <param name="lod" type="float" />
+ </function>
+ <function name="texture2DProjLodEXT" type="vec4">
+ <param name="sampler" type="sampler2D" />
+ <param name="coord" type="vec4" />
+ <param name="lod" type="float" />
+ </function>
+ <function name="textureCubeLodEXT" type="vec4">
+ <param name="sampler" type="samplerCube" />
+ <param name="coord" type="vec3" />
+ <param name="lod" type="float" />
+ </function>
+ <function name="texture2DGradEXT" type="vec4">
+ <param name="sampler" type="sampler2D" />
+ <param name="P" type="vec2" />
+ <param name="dPdx" type="vec2" />
+ <param name="dPdy" type="vec2" />
+ </function>
+ <function name="texture2DProjGradEXT" type="vec4">
+ <param name="sampler" type="sampler2D" />
+ <param name="P" type="vec3" />
+ <param name="dPdx" type="vec2" />
+ <param name="dPdy" type="vec2" />
+ </function>
+ <function name="texture2DProjGradEXT" type="vec4">
+ <param name="sampler" type="sampler2D" />
+ <param name="P" type="vec4" />
+ <param name="dPdx" type="vec2" />
+ <param name="dPdy" type="vec2" />
+ </function>
+ <function name="textureCubeGradEXT" type="vec4">
+ <param name="sampler" type="samplerCube" />
+ <param name="P" type="vec3" />
+ <param name="dPdx" type="vec3" />
+ <param name="dPdy" type="vec3" />
+ </function>
+ </glsl>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+ [NoInterfaceObject]
+ interface EXT_shader_texture_lod {
+ };
+ </idl>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ #extension GL_EXT_shader_texture_lod : enable
+ #extension GL_OES_standard_derivatives : enable
+
+ uniform sampler2D myTexture;
+ varying vec2 texcoord;
+
+ void main(){
+ // avoids artifacts when wrapping texture coordinates
+ gl_FragColor = texture2DGradEXT(myTexture, mod(texcoord, vec2(0.1, 0.5)), dFdx(texcoord), dFdy(texcoord));
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2014/02/10">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2014/02/18">
+ <change>Moved to draft.</change>
+ </revision>
+ <revision date="2014/06/27">
+ <change>Moved to community approved after discussion on public_webgl list.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2014/11/07">
+ <change>Corrected extension name to include GL_ prefix.</change>
+ </revision>
+ <revision date="2015/05/29">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_bptc/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_bptc/extension.xml
new file mode 100644
index 0000000000..c08e98b760
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_bptc/extension.xml
@@ -0,0 +1,110 @@
+<?xml version="1.0"?>
+
+<draft href="EXT_texture_compression_bptc/">
+ <name>EXT_texture_compression_bptc</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Olli Etuaho, NVIDIA</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>38</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture format defined in the
+ <a href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_texture_compression_bptc.txt">
+ EXT_texture_compression_bptc</a> OpenGL ES extension to WebGL. Consult that extension
+ specification for behavioral definitions, including error behaviors.
+ </p>
+ <p>
+ Sampling from textures in the COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT format performs a color space
+ conversion as specified for SRGB textures in the
+ <a href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_sRGB.txt">EXT_sRGB</a> OpenGL ES
+ extension.
+ </p>
+ <features>
+ <feature>
+ Compression format <code>COMPRESSED_RGBA_BPTC_UNORM_EXT</code>,
+ <code>COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT</code>,
+ <code>COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT</code>,
+ and <code>COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT</code> may be passed to
+ the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points.
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the formats from this specification.
+ </feature>
+ <feature>
+ <p>
+ If the <code>internalformat</code> is one of the BPTC internal formats from this specification,
+ the <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ ceil(width / 4) * ceil(height / 4) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_texture_compression_bptc {
+ const GLenum COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8E8C;
+ const GLenum COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 0x8E8D;
+ const GLenum COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 0x8E8E;
+ const GLenum COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 0x8E8F;
+};
+ </idl>
+
+ <newtok>
+ <function name="compressedTexImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_RGBA_BPTC_UNORM_EXT</code>,
+ <code>COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT</code>,
+ <code>COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT</code>,
+ <code>COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT</code>
+ <br/>
+ </function>
+
+ <function name="compressedTexSubImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_RGBA_BPTC_UNORM_EXT</code>,
+ <code>COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT</code>,
+ <code>COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT</code>,
+ <code>COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT</code>
+ <br/>
+ </function>
+ </newtok>
+
+ <errors>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and
+ <code>compressedTexSubImage2D</code> if the <code>internalformat</code> parameter is one of the BPTC
+ internal formats from this extension and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ ceil(width / 4) * ceil(height / 4) * 16
+ </code></blockquote>
+ </error>
+ </errors>
+
+ <history>
+ <revision date="2018/09/14">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2018/09/18">
+ <change>Moved to draft status.</change>
+ </revision>
+ <revision date="2018/09/26">
+ <change>Retarget against EXT_texture_compression_bptc instead of ARB_texture_compression_bptc</change>
+ <change>Rename to EXT_texture_compression_bptc from WEBGL_compressed_texture_bptc</change>
+ </revision>
+ </history>
+</draft>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_rgtc/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_rgtc/extension.xml
new file mode 100644
index 0000000000..02617fc6fa
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_compression_rgtc/extension.xml
@@ -0,0 +1,126 @@
+<?xml version="1.0"?>
+
+<draft href="EXT_texture_compression_rgtc/">
+ <name>EXT_texture_compression_rgtc</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Olli Etuaho, NVIDIA</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>39</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture format defined in the
+ <a href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_texture_compression_rgtc.txt">
+ EXT_texture_compression_rgtc</a> OpenGL extension to WebGL. Consult that extension
+ specification for behavioral definitions, including error behaviors.
+ </p>
+ <p>
+ Updates of partial tiles detailed in the "Implementation Note" section of the
+ EXT_texture_compression_rgtc specification must be supported in an implementation of this
+ WebGL extension.
+ </p>
+ <features>
+ <feature>
+ Compression formats <code>COMPRESSED_RED_RGTC1_EXT</code>,
+ <code>COMPRESSED_SIGNED_RED_RGTC1_EXT</code>,
+ <code>COMPRESSED_RED_GREEN_RGTC2_EXT</code>,
+ and <code>COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT</code> may be passed to
+ the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points.
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the formats from this specification.
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RED_RGTC1_EXT</dt>
+ <dt>COMPRESSED_SIGNED_RED_RGTC1_EXT</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be equal to the following number of bytes:</p>
+ <blockquote><code>
+ ceil(width / 4) * ceil(height / 4) * 8
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ <dt>COMPRESSED_RED_GREEN_RGTC2_EXT</dt>
+ <dt>COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be equal to the following number of bytes:</p>
+ <blockquote><code>
+ ceil(width / 4) * ceil(height / 4) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_texture_compression_rgtc {
+ const GLenum COMPRESSED_RED_RGTC1_EXT = 0x8DBB;
+ const GLenum COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC;
+ const GLenum COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD;
+ const GLenum COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE;
+};
+ </idl>
+
+ <newtok>
+ <function name="compressedTexImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_RED_RGTC1_EXT</code>,
+ <code>COMPRESSED_SIGNED_RED_RGTC1_EXT</code>,
+ <code>COMPRESSED_RED_GREEN_RGTC2_EXT</code>,
+ <code>COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT</code>
+ <br/>
+ </function>
+
+ <function name="compressedTexSubImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_RED_RGTC1_EXT</code>,
+ <code>COMPRESSED_SIGNED_RED_RGTC1_EXT</code>,
+ <code>COMPRESSED_RED_GREEN_RGTC2_EXT</code>,
+ <code>COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT</code>
+ <br/>
+ </function>
+ </newtok>
+
+ <errors>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and
+ <code>compressedTexSubImage2D</code> if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RED_RGTC1_EXT</code> or <code>COMPRESSED_SIGNED_RED_RGTC1_EXT</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ ceil(width / 4) * ceil(height / 4) * 8
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and
+ <code>compressedTexSubImage2D</code> if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RED_GREEN_RGTC2_EXT</code> or <code>COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ ceil(width / 4) * ceil(height / 4) * 16
+ </code></blockquote>
+ </error>
+ </errors>
+
+ <history>
+ <revision date="2018/09/26">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2018/09/26">
+ <change>Rename to EXT_texture_compression_rgtc from WEBGL_compressed_texture_rgtc</change>
+ </revision>
+ </history>
+</draft>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_filter_anisotropic/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_filter_anisotropic/extension.xml
new file mode 100644
index 0000000000..d4e12b9c4f
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/EXT_texture_filter_anisotropic/extension.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+
+<ratified href="EXT_texture_filter_anisotropic/">
+ <name>EXT_texture_filter_anisotropic</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ <contributor>Florian B&#246;sch (pyalot 'at' gmail.com)</contributor>
+ </contributors>
+ <number>11</number>
+ <depends>
+ <api version="1.0" />
+ </depends>
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/texture_filter_anisotropic.txt" name="EXT_texture_filter_anisotropic"/>
+ <features>
+ <feature>
+ The <code>getTexParameter</code>, <code>texParameterf</code> and <code>texParameteri</code> entry points'
+ parameter <code>pname</code> accepts the value <code>TEXTURE_MAX_ANISOTROPY_EXT</code>
+ </feature>
+ <feature>
+ The <code>getParameter</code> entry point parameter <code>pname</code> accepts the value <code>MAX_TEXTURE_MAX_ANISOTROPY_EXT</code>, returning a value of type <code>float</code>.
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_texture_filter_anisotropic {
+ const GLenum TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE;
+ const GLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
+};
+ </idl>
+ <history>
+ <revision date="2012/01/27">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2012/02/24">
+ <change>Added the EXT suffix to the enumerants and aliases to the extension name</change>
+ </revision>
+ <revision date="2012/07/19">
+ <change>Moved from draft to community approved status</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/KHR_parallel_shader_compile/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/KHR_parallel_shader_compile/extension.xml
new file mode 100644
index 0000000000..ca057858a7
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/KHR_parallel_shader_compile/extension.xml
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi:set sw=2 ts=4: -->
+<?xml-stylesheet href="../../extension.xsl" type="text/xsl"?>
+<draft href="KHR_parallel_shader_compile/">
+ <name>KHR_parallel_shader_compile</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Jie Chen, (jie.a.chen 'at' intel.com)</contributor>
+ <contributor>Geoff Lang, (geofflang 'at' google.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>37</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_parallel_shader_compile.txt"
+ name="KHR_parallel_shader_compile">
+ </mirrors>
+
+ <features>
+ <feature>
+ Shader compilation and program linking may be performed in a separate CPU thread. This extension provides a mechanism for the application to provide a hint to limit the number of threads it wants to be used to compile shaders, as well as a query to determine if the compilation process is complete.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+ [NoInterfaceObject]
+ interface KHR_parallel_shader_compile {
+ const GLenum MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0;
+ const GLenum COMPLETION_STATUS_KHR = 0x91B1;
+
+ void maxShaderCompilerThreadsKHR(GLuint count);
+ };
+ </idl>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ var canvas = document.createElement("canvas");
+ var gl = canvas.getContext("webgl");
+ var ext = gl.getExtension('KHR_parallel_shader_compile');
+ if (ext) {
+ // Just for demo of API usage. Generally it's not needed unless you really
+ // want to override the implementation-specific maximum.
+ var threads = gl.getParameter(ext.MAX_SHADER_COMPILER_THREADS_KHR);
+ ext.maxShaderCompilerThreadsKHR(Math.max(2, threads));
+ }
+
+ var vSource = "attribute vec2 position; void main() { gl_Position = vec4(position, 0, 1); }";
+ var fSource = "precision mediump float; void main() { gl_FragColor = vec4(1,0,0,1); }";
+
+ var vShader = gl.createShader(gl.VERTEX_SHADER);
+ gl.shaderSource(vShader, vSource);
+ gl.compileShader(vShader);
+
+ var fShader = gl.createShader(gl.FRAGMENT_SHADER);
+ gl.shaderSource(fShader, fSource);
+ gl.compileShader(fShader);
+
+ var program = gl.createProgram();
+ gl.attachShader(program, vShader);
+ gl.attachShader(program, fShader);
+ gl.linkProgram(program);
+
+ function checkToUseProgram() {
+ if (gl.getProgramParameter(program, gl.LINK_STATUS) == true) {
+ gl.useProgram(program);
+ } else {
+ // error check.
+ }
+ }
+
+ if (ext) {
+ function checkCompletion() {
+ if (gl.getProgramParameter(program, ext.COMPLETION_STATUS_KHR) == true) {
+ checkToUseProgram();
+ } else {
+ requestAnimationFrame(checkCompletion);
+ }
+ }
+ requestAnimationFrame(checkCompletion);
+ } else {
+ checkToUseProgram();
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2018/08/07">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2018/09/14">
+ <change>Moved to draft status.</change>
+ </revision>
+ </history>
+</draft>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_element_index_uint/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_element_index_uint/extension.xml
new file mode 100644
index 0000000000..22e0370414
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_element_index_uint/extension.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+
+<ratified href="OES_element_index_uint/">
+ <name>OES_element_index_uint</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ <contributor>Florian B&#246;sch (pyalot 'at' gmail.com)</contributor>
+ </contributors>
+ <number>10</number>
+ <depends>
+ <api version="1.0" />
+ <core version="2.0" />
+ </depends>
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_element_index_uint.txt" name="OES_element_index_uint"/>
+ <features>
+ <feature>
+ The <code>drawElements</code> entry point parameter <code>type</code> accepts the value <code>UNSIGNED_INT</code>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_element_index_uint {
+};
+ </idl>
+ <history>
+ <revision date="2012/01/24">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2012/01/27">
+ <change>Removed the bufferData requirement as this is not checked by webgl</change>
+ </revision>
+ <revision date="2012/02/24">
+ <change>Removed the enumerants from the IDL which are contained in the context and added aliases to the extension name</change>
+ </revision>
+ <revision date="2012/10/16">
+ <change>Based on feedback on public_webgl, moved from draft to community approved, and removed aliases.</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_fbo_render_mipmap/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_fbo_render_mipmap/extension.xml
new file mode 100644
index 0000000000..621b915efc
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_fbo_render_mipmap/extension.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<draft href="OES_fbo_render_mipmap/">
+ <name>OES_fbo_render_mipmap</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>28</number>
+
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0" />
+ </depends>
+
+ <overview>
+ <mirrors href="https://www.khronos.org/registry/gles/extensions/OES/OES_fbo_render_mipmap.txt"
+ name="OES_fbo_render_mipmap">
+ </mirrors>
+
+ <features>
+ <feature>
+ Any level of a texture can be attached to a framebuffer object.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_fbo_render_mipmap {
+};
+ </idl>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ var extension = gl.getExtension('OES_fbo_render_mipmap');
+ if(extension !=== null){
+ var texture = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ var fbos = [];
+
+ for(var level=0; level&lt;7; level++){
+ var size = 128/Math.pow(2, level);
+ gl.texImage2D(gl.TEXTURE_2D, level, gl.RGBA, size, size, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, level);
+ fbos.push(fbo);
+
+ var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ console.assert(fboStatus == gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is not complete');
+ }
+
+ gl.bindTexture(gl.TEXTURE_2D, null);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+
+ console.assert(gl.getError() == gl.NO_ERROR, 'A GL error occured');
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2015/01/26">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2015/01/31">
+ <change>Moved to draft.</change>
+ </revision>
+ </history>
+</draft>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_standard_derivatives/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_standard_derivatives/extension.xml
new file mode 100644
index 0000000000..ebfb89ee40
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_standard_derivatives/extension.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+
+<ratified href="OES_standard_derivatives/">
+ <name>OES_standard_derivatives</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>4</number>
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0">
+ <glsl version="300 es"/>
+ </core>
+ </depends>
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_standard_derivatives.txt" name="OES_standard_derivatives" />
+ <features>
+ <feature>
+ The <code>hint</code> entry point accepts <code>FRAGMENT_SHADER_DERIVATIVE_HINT_OES</code>
+ as a target and the <code>getParameter</code> entry point accepts it as a pname.
+ </feature>
+ <glsl extname="GL_OES_standard_derivatives">
+ <stage type="fragment"/>
+ <function name="dFdx" type="genType">
+ <param type="genType" />
+ </function>
+ <function name="dFdy" type="genType">
+ <param type="genType" />
+ </function>
+ <function name="fwidth" type="genType">
+ <param type="genType" />
+ </function>
+ </glsl>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_standard_derivatives {
+ const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
+};
+ </idl>
+ <history>
+ <revision date="2010/01/13">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2011/12/07">
+ <change>Added <code>genType</code> argument and return type to function declarations.</change>
+ </revision>
+ <revision date="2012/01/03">
+ <change>Removed webgl module per changes to Web IDL spec.</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float/extension.xml
new file mode 100644
index 0000000000..aa87af975d
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float/extension.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ratified href="OES_texture_float/">
+ <name>OES_texture_float</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>1</number>
+
+ <depends>
+ <api version="1.0"/>
+ <removed version="2.0" />
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"
+ name="OES_texture_float">
+ <addendum>Optional support for <code>FLOAT</code> textures as FBO
+ attachments.</addendum>
+ </mirrors>
+
+ <features>
+ <feature> The <code>texImage2D</code> and <code>texSubImage2D</code>
+ entry points taking <code>ArrayBufferView</code> are extended to accept
+ <code>Float32Array</code> with the pixel type <code>FLOAT</code>.
+ </feature>
+
+ <feature> The <code>texImage2D</code> and <code>texSubImage2D</code>
+ entry points taking <code>ImageData</code>,
+ <code>HTMLImageElement</code>, <code>HTMLCanvasElement</code> and
+ <code>HTMLVideoElement</code> are extended to accept the pixel type
+ <code>FLOAT</code>. </feature>
+
+ <feature>Upon activation of this extension, implementations supporting
+ <a href="../WEBGL_color_buffer_float/">WEBGL_color_buffer_float</a>
+ shall implicitly enable it. This requirement maintains the historical
+ behavior prior to the differentiation of float renderability from float
+ textures, so as to not break existing content.</feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_texture_float { }; </idl>
+
+ <history>
+ <revision date="2010/11/29">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2010/12/13">
+ <change>Extended to support pixel type FLOAT for texImage2D and
+ texSubImage2D entry points taking ImageData, HTMLImageElement,
+ HTMLCanvasElement and HTMLVideoElement. </change>
+ </revision>
+
+ <revision date="2011/09/12">
+ <change>Added optional ability to use a FLOAT type texture as an FBO's
+ color attachment. </change>
+ </revision>
+
+ <revision date="2012/01/03">
+ <change>Removed webgl module per changes to Web IDL spec.</change>
+ </revision>
+
+ <revision date="2012/12/04">
+ <change>Specify that implementations supporting FLOAT color attachments
+ implicitly enable WEBGL_color_buffer_float.</change>
+ </revision>
+
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+
+ <revision date="2014/09/11">
+ <change>Corrected link to WEBGL_color_buffer_float.</change>
+ </revision>
+
+ <revision date="2017/09/14">
+ <change>Clarify behaviors regarding WEBGL_color_buffer_float.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float_linear/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float_linear/extension.xml
new file mode 100644
index 0000000000..62e9409466
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_float_linear/extension.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ratified href="OES_texture_float_linear/">
+ <name>OES_texture_float_linear</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>20</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt"
+ name="OES_texture_float_linear">
+ </mirrors>
+
+ <features>
+ Expands upon the OES_texture_float extension by allowing support for
+ LINEAR magnification filter and LINEAR, NEAREST_MIPMAP_LINEAR,
+ LINEAR_MIPMAP_NEAREST and LINEAR_MIPMAP_NEAREST minification filters.
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_texture_float_linear { };</idl>
+
+ <history>
+ <revision date="2013/02/20">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/03/11">
+ <change>Moved to draft status after discussion on public_webgl.</change>
+ </revision>
+ <revision date="2013/08/06">
+ <change>Moved to community approved.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2014/08/08">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float/extension.xml
new file mode 100644
index 0000000000..27902073d5
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float/extension.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ratified href="OES_texture_half_float/">
+ <name>OES_texture_half_float</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>2</number>
+
+ <depends>
+ <api version="1.0"/>
+ <removed version="2.0" />
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"
+ name="OES_texture_half_float">
+ <addendum>Optional support for <code>HALF_FLOAT</code> textures as FBO
+ attachments.</addendum>
+ </mirrors>
+
+ <features>
+ <feature> The <code>texImage2D</code> and <code>texSubImage2D</code>
+ entry points taking <code>ArrayBufferView</code> are extended to accept
+ <code>Uint16Array</code> with the pixel type <code>HALF_FLOAT_OES</code>.
+ </feature>
+
+ <feature> The <code>texImage2D</code> and <code>texSubImage2D</code>
+ entry points taking <code>ImageData</code>,
+ <code>HTMLImageElement</code>, <code>HTMLCanvasElement</code> and
+ <code>HTMLVideoElement</code> are extended to accept the pixel type
+ <code>HALF_FLOAT_OES</code>. </feature>
+
+ <feature>Upon activation of this extension, implementations supporting
+ <a href="../EXT_color_buffer_half_float/">EXT_color_buffer_half_float</a>
+ shall implicitly enable it. This requirement maintains the historical
+ behavior prior to the differentiation of float renderability from float
+ textures, so as to not break existing content.</feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_texture_half_float {
+ const GLenum HALF_FLOAT_OES = 0x8D61;
+};
+</idl>
+
+ <history>
+ <revision date="2010/11/29">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2011/09/12">
+ <change> Added similar text about <code>texImage2D</code> and
+ <code>texSubImage2D</code> as in OES_texture_float spec. </change>
+
+ <change> Added optional ability to use a HALF_FLOAT_OES type texture as
+ an FBO's color attachment. </change>
+ </revision>
+
+ <revision date="2012/01/03">
+ <change>Removed webgl module per changes to Web IDL spec.</change>
+ </revision>
+
+ <revision date="2012/12/04">
+ <change>Specify that implementations supporting HALF_FLOAT_OES color
+ attachments implicitly enable EXT_color_buffer_half_float.</change>
+ </revision>
+
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+
+ <revision date="2014/02/12">
+ <change>Allow texture uploads of half-floats via Uint16Arrays.</change>
+ </revision>
+
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+
+ <revision date="2014/09/11">
+ <change>Corrected link to EXT_color_buffer_half_float.</change>
+ </revision>
+
+ <revision date="2017/09/14">
+ <change>Clarify behaviors regarding EXT_color_buffer_half_float.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float_linear/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float_linear/extension.xml
new file mode 100644
index 0000000000..a17276c87b
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_texture_half_float_linear/extension.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ratified href="OES_texture_half_float_linear/">
+ <name>OES_texture_half_float_linear</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>21</number>
+
+ <depends>
+ <api version="1.0"/>
+ <removed version="2.0" />
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float_linear.txt"
+ name="OES_texture_half_float_linear">
+ </mirrors>
+
+ <features>
+ Expands upon the OES_texture_half_float extension by allowing support for
+ LINEAR magnification filter and LINEAR, NEAREST_MIPMAP_LINEAR,
+ LINEAR_MIPMAP_NEAREST and LINEAR_MIPMAP_NEAREST minification filters.
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_texture_half_float_linear { };</idl>
+
+ <history>
+ <revision date="2013/02/20">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/03/11">
+ <change>Moved to draft status after discussion on public_webgl.</change>
+ </revision>
+ <revision date="2013/08/06">
+ <change>Moved to community approved.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2014/08/08">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/OES_vertex_array_object/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/OES_vertex_array_object/extension.xml
new file mode 100644
index 0000000000..3e1c53f9aa
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/OES_vertex_array_object/extension.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0"?>
+
+<ratified href="OES_vertex_array_object/">
+ <name>OES_vertex_array_object</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>5</number>
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0" />
+ </depends>
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_vertex_array_object.txt" name="OES_vertex_array_object" />
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WebGLVertexArrayObjectOES : WebGLObject {
+};
+
+[NoInterfaceObject]
+interface OES_vertex_array_object {
+ const GLenum VERTEX_ARRAY_BINDING_OES = 0x85B5;
+
+ WebGLVertexArrayObjectOES? createVertexArrayOES();
+ void deleteVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject);
+ [WebGLHandlesContextLoss] GLboolean isVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject);
+ void bindVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject);
+};
+ </idl>
+
+ <newfun>
+ <function name="createVertexArrayOES" type="WebGLVertexArrayObjectOES?">
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="deleteVertexArrayOES" type="void">
+ <param name="arrayObject" type="WebGLVertexArrayObjectOES?"/>
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="isVertexArrayOES" type="GLboolean">
+ <param name="arrayObject" type="WebGLVertexArrayObjectOES?"/>
+ Returns false if the vertex array object's <a
+ href="../../specs/1.0/#webgl-object-invalidated-flag">invalidated
+ flag</a> is set.
+ </function>
+ </newfun>
+
+ <newfun>
+ <function name="bindVertexArrayOES" type="void">
+ <param name="arrayObject" type="WebGLVertexArrayObjectOES?"/>
+ </function>
+ </newfun>
+
+ <issues>
+ <p>The OES_vertex_array_object spec does not make it clear
+ what happens to buffers that are deleted when they are referenced
+ by vertex array objects. It is inferred that all buffers are
+ reference counted.
+ </p>
+ <p>Before OES_vertex_array_object there was no way to use a deleted
+ buffer in a single context as the spec states it would be unbound
+ from all bind points. After OES_vertex_array_object it is now
+ possible to use deleted buffers.
+ </p>
+ <p>Furthermore, the OpenGL ES 2.0 spec specifies that using a
+ deleted buffer has undefined results including possibly
+ corrupt rendering and generating GL errors. Undefined behavior
+ is unacceptable for WebGL.
+ </p>
+ <ul>
+ <li>
+ <p>RESOLVED: Buffers should be reference counted when attached to
+ a vertex array object. This is consistent with the OpenGL ES 3.0
+ spec's implementation of Vertex Array Objects and matches the
+ behavior of other WebGL objects, such as textures that are attached
+ to framebuffers.
+ </p>
+ <p>This will require that most implementations do not call
+ glDeleteBuffer when the user calls deleteBuffer on the WebGL context.
+ Instead the implementation must wait for all references to be released
+ before calling glDeleteBuffer to prevent undefined behavior.
+ </p>
+ <p>If a buffer object is deleted while it is attached to the currently
+ bound vertex array object, then it is as if BindBuffer had been called,
+ with a buffer of 0, for each target to which this buffer was attached
+ in the currently bound vertex array object. In other words, this buffer
+ is first detached from all attachment points in the currently bound
+ vertex array object. Note that the buffer is specifically not detached
+ from any other vertex array object. Detaching the buffer from any other
+ vertex array objects is the responsibility of the application.
+ </p>
+ </li>
+ </ul>
+ </issues>
+ <history>
+ <revision date="2011/01/27">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2011/11/12">
+ <change>Demotion to draft.</change>
+ </revision>
+ <revision date="2011/12/06">
+ <change>Added vendor-specific name strings for draft extension per discussion on WebGL mailing list.</change>
+ </revision>
+ <revision date="2011/12/07">
+ <change>Renamed "Name Strings" section to "Alias Name Strings".</change>
+ <change>Sorted Revision History in ascending order.</change>
+ </revision>
+ <revision date="2012/01/03">
+ <change>Removed webgl module per changes to Web IDL spec.</change>
+ </revision>
+ <revision date="2012/09/24">
+ <change>Added resolution to deleted buffer issue</change>
+ </revision>
+ <revision date="2012/10/16">
+ <change>Based on feedback on public_webgl, moved from draft to community approved, and removed aliases.</change>
+ </revision>
+ <revision date="2013/05/08">
+ <change>Made WebGLVertexArrayObjectOES return values and arguments nullable on feedback from Benoit Jacob.</change>
+ </revision>
+ <revision date="2013/05/14">
+ <change>Based on pull request from J Kenneth King, added WebGLHandlesContextLoss extended attribute to isVertexArrayOES and added markup for new functions.</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute to extension and WebGLVertexArrayObjectOES interface.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_color_buffer_float/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_color_buffer_float/extension.xml
new file mode 100644
index 0000000000..d4ac50ae6a
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_color_buffer_float/extension.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extension href="WEBGL_color_buffer_float/">
+ <name>WEBGL_color_buffer_float</name>
+
+ <contact><a href="https://www.khronos.org/webgl/public-mailing-list">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Mark Callow, HI Corporation</contributor>
+
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>15</number>
+
+ <depends>
+ <api version="1.0"/>
+
+ <ext name="EXT_color_buffer_half_float"/>
+
+ <ext name="OES_texture_float" require="true"/>
+
+ <subsumed version="2.0" by="EXT_color_buffer_float" />
+ </depends>
+
+ <overview>
+ <p>Adds support for rendering to 32-bit floating-point color buffers.</p>
+
+ <features>
+ <feature>
+ <p>The 32-bit floating-point type <code>RGBA32F</code> becomes available
+ as a color-renderable format. Renderbuffers can be created in this
+ format. These and textures created with <code>format = RGBA</code> and
+ <code>type = FLOAT</code> as specified in <a
+ href="http://www.khronos.org/registry/webgl/extensions/OES_texture_float/">OES_texture_float</a>,
+ can be attached to framebuffer object color attachments for rendering.
+ </p>
+ </feature>
+
+ <feature>
+ <p>The 32-bit floating-point type <code>RGB32F</code> may also optionally
+ become available as a color-renderable format. These and textures created
+ with <code>format = RGB</code> and <code>type = FLOAT</code> as specified in
+ <a href="http://www.khronos.org/registry/webgl/extensions/OES_texture_float/">OES_texture_float</a>,
+ can be attached to framebuffer object color attachments for rendering.
+ Applications must check framebuffer completeness to determine if an
+ implementation actually supports this format.
+ </p>
+ </feature>
+
+ <feature>
+ <p><span style="color: red">NOTE:</span> fragment shaders outputs
+ gl_FragColor and gl_FragData[0] will only be clamped and converted
+ when the color buffer is fixed-point and <code>blendColor()</code> and
+ <code>clearColor()</code> will no longer clamp their parameter values
+ on input. Clamping will be applied as necessary at draw time according
+ to the type of color buffer in use.</p>
+ </feature>
+
+ <feature>
+ <p>The format and type combination <code>RGBA</code> and
+ <code>FLOAT</code> becomes valid for reading from a floating-point
+ rendering buffer. Note: <code>RGBA</code> and
+ <code>UNSIGNED_BYTE</code> cannot be used for reading from a
+ floating-point rendering buffer.</p>
+ </feature>
+
+ <feature>
+ <p>The component types of framebuffer object attachments can be
+ queried.</p>
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_color_buffer_float {
+ const GLenum RGBA32F_EXT = 0x8814;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
+ const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
+}; // interface WEBGL_color_buffer_float
+ </idl>
+
+ <newtok>
+ <function name="renderbufferStorage" type="void"><param name="target"
+ type="GLenum"/><param name="internalformat" type="GLenum"/><param
+ name="width" type="GLsizei"/><param name="height"
+ type="GLsizei"/><code>RGBA32F_EXT</code> is accepted as the
+ <code>internalformat</code> parameter of
+ <code>renderbufferStorage()</code>.</function>
+ </newtok>
+
+ <additions>
+ <p>The new tokens and the behavioral changes for floating-point color
+ buffers specified in <a
+ href="http://www.khronos.org/registry/webgl/extensions/EXT_color_buffer_half_float/">EXT_color_buffer_half_float</a>
+ are incorporated into WebGL except for the <code>RGB16F</code> and
+ <code>RGBA16F</code> types. References to <code>RGB16F</code> are ignored,
+ and references to <code>RGBA16F</code> are replaced by references to
+ <code>RGBA32F</code>.</p>
+ </additions>
+
+ <history>
+ <revision date="2012/11/08">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2012/11/12">
+ <change>Don't mirror EXT_color_buffer_half_float. Mirror has a different
+ meaning from what is done here.</change>
+ </revision>
+
+ <revision date="2012/11/13">
+ <change>Add reading-pixels-as-FLOAT feature to the Overview.</change>
+ </revision>
+
+ <revision date="2012/11/26">
+ <change>Move to draft.</change>
+ </revision>
+
+ <revision date="2014/07/15">
+ <change>Removed webgl module. Added NoInterfaceObject extended attribute.</change>
+ </revision>
+
+ <revision date="2014/09/11">
+ <change>Fixed the name of the interface from EXT_color_buffer_float to WEBGL_color_buffer_float.</change>
+ </revision>
+
+ <revision date="2014/11/24">
+ <change>Removed the support for RGB32F, since it is not natively supported on all platforms where WebGL is implemented.</change>
+ </revision>
+
+ <revision date="2014/11/24">
+ <change>Move to community approved.</change>
+ </revision>
+
+ <revision date="2016/05/05">
+ <change>Subsumed in WebGL 2.0 by EXT_color_buffer_float.</change>
+ </revision>
+
+ <revision date="2017/09/14">
+ <change>Add optional RGB renderability.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_astc/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_astc/extension.xml
new file mode 100644
index 0000000000..255e57b07b
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_astc/extension.xml
@@ -0,0 +1,577 @@
+<?xml version="1.0"?>
+
+<extension href="WEBGL_compressed_texture_astc/">
+ <name>WEBGL_compressed_texture_astc</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Christophe Riccio, Unity</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>30</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture format defined in the
+ <a href="https://www.opengl.org/registry/specs/KHR/texture_compression_astc_hdr.txt">
+ KHR_texture_compression_astc_hdr</a> OpenGL ES extension to WebGL. Consult that extension
+ specification for behavioral definitions, including error behaviors.
+ </p>
+ <p>
+ ASTC textures may be encoded using either high or low dynamic range, corresponding to an "HDR
+ profile" and "LDR profile". The compression format is designed to be extended, and for new
+ profiles to be added in the future. For this reason, enabling the WebGL extension enables all
+ of the profiles supported by the implementation. The supported profiles may be queried by
+ calling <code>getSupportedProfiles</code> against the extension object.
+ </p>
+ <features>
+ <feature>
+ Compression format <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code>,
+ and <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code> may be passed to
+ the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points.
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the format from this specification.
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_4x4_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_5x4_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 4) / 5) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_5x5_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 4) / 5) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_6x5_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 5) / 6) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_6x6_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 5) / 6) * floor((height + 5) / 6) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_8x5_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 7) / 8) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_8x6_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 7) / 8) * floor((height + 5) / 6) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_8x8_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 7) / 8) * floor((height + 7) / 8) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_10x5_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_10x6_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 5) / 6) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_10x8_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 7) / 8) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_10x10_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 9) / 10) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_12x10_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 11) / 12) * floor((height + 9) / 10) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGBA_ASTC_12x12_KHR</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</dt>
+ <dd>
+ <p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:
+ </p>
+ <blockquote><code>
+ floor((width + 11) / 12) * floor((height + 11) / 12) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_compressed_texture_astc {
+ /* Compressed Texture Format */
+ const GLenum COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
+ const GLenum COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1;
+ const GLenum COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2;
+ const GLenum COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3;
+ const GLenum COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4;
+ const GLenum COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5;
+ const GLenum COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6;
+ const GLenum COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7;
+ const GLenum COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8;
+ const GLenum COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9;
+ const GLenum COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA;
+ const GLenum COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB;
+ const GLenum COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC;
+ const GLenum COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD;
+
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD;
+
+ // Profile query support.
+ sequence&lt;DOMString&gt; getSupportedProfiles();
+};
+ </idl>
+
+ <newfun>
+ <function name="getSupportedProfiles" type="sequence&lt;DOMString&gt;">
+ Returns the names of the ASTC profiles supported by the implementation. As of this writing,
+ valid return values will include "ldr", corresponding to the
+ GL_KHR_texture_compression_astc_ldr extension string; and "hdr", corresponding to the
+ GL_KHR_texture_compression_astc_hdr extension string. More profiles may be added in the
+ future.
+ </function>
+ <div class="note">
+ The intent of the <code>getSupportedProfiles</code> function is to allow easy reconstruction
+ of the underlying OpenGL or OpenGL ES extension strings for environments like Emscripten, by
+ prepending the string <code>GL_KHR_texture_compression_astc_</code> to the returned profile
+ names.
+ </div>
+ </newfun>
+
+ <newtok>
+ <function name="compressedTexImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code>
+ <br/>
+ </function>
+
+ <function name="compressedTexSubImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code>,
+ <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code>,
+ <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code>
+ <br/>
+ </function>
+ </newtok>
+
+ <errors>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_4x4_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_5x4_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 4) / 5) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_5x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 4) / 5) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_6x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 5) / 6) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_6x6_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 5) / 6) * floor((height + 5) / 6) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_8x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 7) / 8) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_8x6_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 7) / 8) * floor((height + 5) / 6) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_8x8_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 7) / 8) * floor((height + 7) / 8) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_10x5_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 4) / 5) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_10x6_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 5) / 6) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_10x8_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 7) / 8) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_10x10_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 9) / 10) * floor((height + 9) / 10) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_12x10_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 11) / 12) * floor((height + 9) / 10) * 16
+ </code></blockquote>
+ </error>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code>
+ if the <code>internalformat</code> parameter is
+ <code>COMPRESSED_RGBA_ASTC_12x12_KHR</code> or <code>COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR</code>
+ and the byteLength of the ArrayBufferView is not:
+ <blockquote><code>
+ floor((width + 11) / 12) * floor((height + 11) / 12) * 16
+ </code></blockquote>
+ </error>
+ </errors>
+
+ <history>
+ <revision date="2015/03/10">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2015/08/07">
+ <change>Added profile string support. Renamed constants back to _KHR.</change>
+ </revision>
+ <revision date="2015/08/10">
+ <change>Clarified intent of getSupportedProfiles. Stressed that OpenGL ES extension defines the behavior.</change>
+ </revision>
+ <revision date="2015/08/10">
+ <change>Moved to draft status.</change>
+ </revision>
+ <revision date="2016/12/12">
+ <change>Moved to community approved after discussion on public_webgl list.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc/extension.xml
new file mode 100644
index 0000000000..c6ad533974
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc/extension.xml
@@ -0,0 +1,189 @@
+<?xml version="1.0"?>
+
+<extension href="WEBGL_compressed_texture_etc/">
+ <name>WEBGL_compressed_texture_etc</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Jeff Gilbert, Mozilla</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>29</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture formats defined as core in the
+ <a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.4.pdf">
+ OpenGL ES 3.0</a> spec to WebGL. These include the ETC2 and EAC formats, where
+ ETC2 is a superset of ETC1. ETC1 textures can be loaded using the ETC2 token
+ value. All of these formats are in the ETC family.
+ </p>
+ <p>
+ Browsers should not advertise this extension when the WebGL implementation, or
+ graphics driver, supports these formats by decompressing them.
+ </p>
+ <features>
+ <feature>
+ Compression formats <code>COMPRESSED_R11_EAC</code>,
+ <code>COMPRESSED_SIGNED_R11_EAC</code>,
+ <code>COMPRESSED_RG11_EAC</code>,
+ <code>COMPRESSED_SIGNED_RG11_EAC</code>,
+ <code>COMPRESSED_RGB8_ETC2</code>,
+ <code>COMPRESSED_SRGB8_ETC2</code>,
+ <code>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
+ <code>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
+ <code>COMPRESSED_RGBA8_ETC2_EAC</code>,
+ and <code>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</code> may be passed to the
+ <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points. In
+ WebGL 2.0, they may also be passed to the <code>compressedTexImage3D</code> and
+ <code>compressedTexSubImage3D</code> entry points with the <code>TEXTURE_2D_ARRAY</code>
+ target.
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the formats from this specification.
+ </feature>
+ <feature>
+ For all of the formats, <code>validatedSize</code> (defined for each specific format
+ below) is validated in the following ways:
+ <ul>
+ <li>
+ <b>WebGL 1.0 and 2.0</b>: if the variant of <code>compressedTexImage*D</code> or
+ <code>compressedTexSubImage*D</code> taking <code>ArrayBufferView pixels</code> is
+ called, then the <code>byteLength</code> of the view must be equal to
+ <code>validatedSize</code>, or an INVALID_VALUE error is generated.
+ </li>
+ <li>
+ <b>WebGL 2.0</b>: if the variant of <code>compressedTexImage*D</code> or
+ <code>compressedTexSubImage*D</code> taking <code>GLintptr offset</code> is called,
+ and <code>offset + validatedSize</code> is greater than the size of the bound
+ <code>PIXEL_UNPACK_BUFFER</code>, an <code>INVALID_OPERATION</code> error is
+ generated.
+ </li>
+ </ul>
+ <dl>
+ <dt>COMPRESSED_R11_EAC</dt>
+ <dt>COMPRESSED_SIGNED_R11_EAC</dt>
+ <dt>COMPRESSED_RGB8_ETC2</dt>
+ <dt>COMPRESSED_SRGB8_ETC2</dt>
+ <dt>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</dt>
+ <dt>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</dt>
+ <dd><p><code>validatedSize</code> is computed in the following way:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 8
+ </code></blockquote>
+ </dd>
+ </dl>
+ <dl>
+ <dt>COMPRESSED_RG11_EAC</dt>
+ <dt>COMPRESSED_SIGNED_RG11_EAC</dt>
+ <dt>COMPRESSED_RGBA8_ETC2_EAC</dt>
+ <dt>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</dt>
+ <dd><p><code>validatedSize</code> is computed in the following way:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_compressed_texture_etc {
+ /* Compressed Texture Formats */
+ const GLenum COMPRESSED_R11_EAC = 0x9270;
+ const GLenum COMPRESSED_SIGNED_R11_EAC = 0x9271;
+ const GLenum COMPRESSED_RG11_EAC = 0x9272;
+ const GLenum COMPRESSED_SIGNED_RG11_EAC = 0x9273;
+ const GLenum COMPRESSED_RGB8_ETC2 = 0x9274;
+ const GLenum COMPRESSED_SRGB8_ETC2 = 0x9275;
+ const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
+ const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
+ const GLenum COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
+ const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
+};
+ </idl>
+
+ <newtok>
+ <function name="compressedTexImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_R11_EAC</code>,
+ <code>COMPRESSED_SIGNED_R11_EAC</code>,
+ <code>COMPRESSED_RG11_EAC</code>,
+ <code>COMPRESSED_SIGNED_RG11_EAC</code>,
+ <code>COMPRESSED_RGB8_ETC2</code>,
+ <code>COMPRESSED_SRGB8_ETC2</code>,
+ <code>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
+ <code>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
+ <code>COMPRESSED_RGBA8_ETC2_EAC</code> or
+ <code>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</code>
+ <br/>
+ </function>
+
+ <function name="compressedTexSubImage2D">
+ <param name="internalformat" type="GLenum"/>
+ Accepted by the <code>internalformat</code> parameter:
+ <code>COMPRESSED_R11_EAC</code>,
+ <code>COMPRESSED_SIGNED_R11_EAC</code>,
+ <code>COMPRESSED_RG11_EAC</code>,
+ <code>COMPRESSED_SIGNED_RG11_EAC</code>,
+ <code>COMPRESSED_RGB8_ETC2</code>,
+ <code>COMPRESSED_SRGB8_ETC2</code>,
+ <code>COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
+ <code>COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2</code>,
+ <code>COMPRESSED_RGBA8_ETC2_EAC</code> or
+ <code>COMPRESSED_SRGB8_ALPHA8_ETC2_EAC</code>
+ <br/>
+ </function>
+ </newtok>
+
+ <errors>
+ <error enum="INVALID_VALUE">
+ The error <code>INVALID_VALUE</code> is generated by <code>compressedTexImage2D</code>,
+ <code>compressedTexSubImage2D</code>, <code>compressedTexImage3D</code>, and
+ <code>compressedTexSubImage3D</code> if the variant taking <code>ArrayBufferView pixels</code>
+ is called and the size restrictions above are not met.
+ </error>
+ <error enum="INVALID_OPERATION">
+ The error <code>INVALID_OPERATION</code> is generated by <code>compressedTexImage2D</code>,
+ <code>compressedTexSubImage2D</code>, <code>compressedTexImage3D</code>, and
+ <code>compressedTexSubImage3D</code> if the variant taking <code>GLintptr offset</code> is
+ called and the size restrictions above are not met.
+ </error>
+ </errors>
+ <history>
+ <revision date="2013/12/9">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2014/12/12">
+ <change>COMPRESSED_RGB_ETC2 should be COMPRESSED_RGB8_ETC2.</change>
+ <change>Remove unnecessary language.</change>
+ </revision>
+ <revision date="2015/01/31">
+ <change>Moved to draft.</change>
+ <change>Added issue questions.</change>
+ <change>Formalized the newtok and error codes.</change>
+ </revision>
+ <revision date="2016/09/16">
+ <change>Renamed to WEBGL_compressed_texture_es3_0.</change>
+ </revision>
+ <revision date="2016/09/21">
+ <change>Clarifications to the supported formats on suggestion from Mark Callow.</change>
+ </revision>
+ <revision date="2016/09/30">
+ <change>Addressed issues regarding 3D entry points, description of interation with WebGL 2.0,
+ and generation of INVALID_OPERATION and INVALID_VALUE errors. Added note that browsers should
+ not advertise this extension if these compressed texture formats are decompressed. Renamed to
+ WEBGL_compressed_texture_etc after further discussion. Promoted to community
+ approved.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc1/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc1/extension.xml
new file mode 100644
index 0000000000..2ffc7549b0
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_etc1/extension.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0"?>
+
+<extension href="WEBGL_compressed_texture_etc1/">
+ <name>WEBGL_compressed_texture_etc1</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>24</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture format defined in the
+ <a href="http://www.khronos.org/registry/gles/extensions/OES/OES_compressed_ETC1_RGB8_texture.txt">
+ OES_compressed_ETC1_RGB8_texture</a> OpenGL ES extension to WebGL.
+ </p>
+ <features>
+ <feature>
+ Compression format <code>COMPRESSED_RGB_ETC1_WEBGL</code> may be passed to
+ the <code>compressedTexImage2D</code> entry point.
+
+ This format correspond to the format defined in the OES_compressed_ETC1_RGB8_texture OpenGL ES
+ extension. Although the enum name is changed, the numeric value is the same. The correspondence
+ is given by this table:
+ <table>
+ <tr>
+ <th>WebGL format enum</th>
+ <th>OpenGL format enum</th>
+ <th>Numeric value</th>
+ </tr>
+ <tr>
+ <td>COMPRESSED_RGB_ETC1_WEBGL</td>
+ <td>ETC1_RGB8_OES</td>
+ <td>0x8D64</td>
+ </tr>
+ </table>
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the format from this specification.
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGB_ETC1_WEBGL</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code> must be equal to the following number of bytes:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 8
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_compressed_texture_etc1 {
+ /* Compressed Texture Format */
+ const GLenum COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
+};
+ </idl>
+ <history>
+ <revision date="2012/02/23">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/07/03">
+ <change>Clarified that length of ArrayBufferView is actually byteLength.</change>
+ </revision>
+ <revision date="2013/11/27">
+ <change>Moved to draft status.</change>
+ </revision>
+ <revision date="2013/12/03">
+ <change>Assigned extension number 24 to WEBGL_compressed_texture_etc1 extension.</change>
+ </revision>
+ <revision date="2014/03/07">
+ <change>Remove ability to use the format with compressedTexSubImage2D, as per the GLES extension spec.</change>
+ </revision>
+ <revision date="2014/06/27">
+ <change>Moved to community approved after discussion on public_webgl list.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_pvrtc/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_pvrtc/extension.xml
new file mode 100644
index 0000000000..b67d1881af
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_pvrtc/extension.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0"?>
+
+<extension href="WEBGL_compressed_texture_pvrtc/">
+ <name>WEBGL_compressed_texture_pvrtc</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>13</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture formats defined in the
+ <a href="http://www.khronos.org/registry/gles/extensions/IMG/IMG_texture_compression_pvrtc.txt">
+ IMG_texture_compression_pvrtc</a> OpenGL extension to WebGL.
+ </p>
+ <features>
+ <feature>
+ Compression formats <code>COMPRESSED_RGB_PVRTC_4BPPV1_IMG</code>,
+ <code>COMPRESSED_RGB_PVRTC_2BPPV1_IMG</code>, <code>COMPRESSED_RGBA_PVRTC_4BPPV1_IMG</code>, and
+ <code>COMPRESSED_RGBA_PVRTC_2BPPV1_IMG</code> may be passed to
+ the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points.
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the 4 formats from this specification.
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions apply to all of the formats described
+ by this extension:
+ </p>
+
+ <p>In <code>compressedTexImage2D</code>, the <code>width</code> and <code>height</code>
+ parameters must be powers of two. Otherwise, an INVALID_VALUE error is generated.
+ </p>
+
+ <p>
+ In <code>compressedTexSubImage2D</code>, the <code>width</code> and <code>height</code>
+ parameters must be equal to the current values of the existing texture image, and the
+ <code>xoffset</code> and <code>yoffset</code> parameters must be zero.
+ Otherwise, an INVALID_VALUE error is generated.
+ </p>
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must also be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGB_PVRTC_4BPPV1_IMG</dt>
+ <dt>COMPRESSED_RGBA_PVRTC_4BPPV1_IMG</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ either <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:</p>
+ <blockquote><code>
+ max(width, 8) * max(height, 8) / 2
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+
+ <dt>COMPRESSED_RGB_PVRTC_2BPPV1_IMG</dt>
+ <dt>COMPRESSED_RGBA_PVRTC_2BPPV1_IMG</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ either <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must be
+ equal to the following number of bytes:</p>
+ <blockquote><code>
+ max(width, 16) * max(height, 8) / 4
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_compressed_texture_pvrtc {
+ /* Compressed Texture Formats */
+ const GLenum COMPRESSED_RGB_PVRTC_4BPPV1_IMG = 0x8C00;
+ const GLenum COMPRESSED_RGB_PVRTC_2BPPV1_IMG = 0x8C01;
+ const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
+ const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
+};
+ </idl>
+ <history>
+ <revision date="2012/08/07">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/07/03">
+ <change>Clarified that length of ArrayBufferView is actually byteLength.</change>
+ </revision>
+ <revision date="2014/06/27">
+ <change>Moved to community approved after discussion on public_webgl list.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc/extension.xml
new file mode 100644
index 0000000000..579531a174
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc/extension.xml
@@ -0,0 +1,119 @@
+<?xml version="1.0"?>
+
+<ratified href="WEBGL_compressed_texture_s3tc/">
+ <name>WEBGL_compressed_texture_s3tc</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>8</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture formats defined in the
+ <a href="http://www.opengl.org/registry/specs/EXT/texture_compression_s3tc.txt">
+ EXT_texture_compression_s3tc</a> OpenGL extension to WebGL.
+ </p>
+ <features>
+ <feature>
+ Compression formats <code>COMPRESSED_RGB_S3TC_DXT1_EXT</code>,
+ <code>COMPRESSED_RGBA_S3TC_DXT1_EXT</code>, <code>COMPRESSED_RGBA_S3TC_DXT3_EXT</code>, and
+ <code>COMPRESSED_RGBA_S3TC_DXT5_EXT</code> may be passed to
+ the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points.
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the 4 formats from this specification.
+ </feature>
+ <feature>
+ <p>The following format specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGB_S3TC_DXT1_EXT</dt>
+ <dt>COMPRESSED_RGBA_S3TC_DXT1_EXT</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ either <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code>
+ must match the following equation:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 8
+ </code></blockquote>
+ <p>
+ If it is not an <code>INVALID_VALUE</code> error is generated.
+ </p>
+ <p>When <code>level</code> equals zero <code>width</code> and <code>height</code>
+ must be a multiple of 4. When <code>level</code> is greater than 0 <code>width</code>
+ and <code>height</code> must be 0, 1, 2 or a multiple of 4.</p>
+ <p>
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ <p>
+ For <code>compressedTexSubImage2D</code> <code>xoffset</code> and
+ <code>yoffset</code> must be a multiple of 4 and
+ <code>width</code> must be a multiple of 4 or equal to the original
+ width of the <code>level</code>. <code>height</code> must be a multiple of 4 or
+ equal to the original height of the <code>level</code>.
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ </dd>
+
+ <dt>COMPRESSED_RGBA_S3TC_DXT3_EXT</dt>
+ <dt>COMPRESSED_RGBA_S3TC_DXT5_EXT</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ either <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must
+ match the following equation:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ <p>
+ If it is not an <code>INVALID_VALUE</code> error is generated.
+ </p>
+ <p>When <code>level</code> equals zero <code>width</code> and <code>height</code>
+ must be a multiple of 4. When <code>level</code> is greater than 0 <code>width</code>
+ and <code>height</code> must be 0, 1, 2 or a multiple of 4.</p>
+ <p>
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ <p>
+ For <code>compressedTexSubImage2D</code> <code>xoffset</code> and
+ <code>yoffset</code> must be a multiple of 4 and
+ <code>width</code> must be a multiple of 4 or equal to the original
+ width of the <code>level</code>. <code>height</code> must be a multiple of 4 or
+ equal to the original height of the <code>level</code>.
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_compressed_texture_s3tc {
+ /* Compressed Texture Formats */
+ const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0;
+ const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
+ const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
+ const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
+};
+ </idl>
+ <history>
+ <revision date="2012/01/25">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/01/26">
+ <change>Moved from draft to community approved status</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2013/07/03">
+ <change>Clarified that length of ArrayBufferView is actually byteLength.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/extension.xml
new file mode 100644
index 0000000000..2e824cc6c6
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_compressed_texture_s3tc_srgb/extension.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0"?>
+
+<extension href="WEBGL_compressed_texture_s3tc_srgb/">
+ <name>WEBGL_compressed_texture_s3tc_srgb</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>32</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the sRGB compressed texture formats defined in the
+ <a href="https://www.opengl.org/registry/specs/EXT/texture_sRGB.txt">
+ EXT_texture_sRGB</a> OpenGL extension to WebGL.
+ </p>
+ <features>
+ <feature>
+ Compression formats <code>COMPRESSED_SRGB_S3TC_DXT1_EXT</code>,
+ <code>COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT</code>, <code>COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT</code>, and
+ <code>COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT</code> may be passed to
+ the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points.
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the 4 formats from this specification.
+ </feature>
+ <feature>
+ <p>The following format specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_SRGB_S3TC_DXT1_EXT</dt>
+ <dt>COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ either <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code>
+ must match the following equation:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 8
+ </code></blockquote>
+ <p>
+ If it is not an <code>INVALID_VALUE</code> error is generated.
+ </p>
+ <p>When <code>level</code> equals zero <code>width</code> and <code>height</code>
+ must be a multiple of 4. When <code>level</code> is greater than 0 <code>width</code>
+ and <code>height</code> must be 0, 1, 2 or a multiple of 4.</p>
+ <p>
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ <p>
+ For <code>compressedTexSubImage2D</code> <code>xoffset</code> and
+ <code>yoffset</code> must be a multiple of 4 and
+ <code>width</code> must be a multiple of 4 or equal to the original
+ width of the <code>level</code>. <code>height</code> must be a multiple of 4 or
+ equal to the original height of the <code>level</code>.
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ </dd>
+
+ <dt>COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT</dt>
+ <dt>COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ either <code>compressedTexImage2D</code> or <code>compressedTexSubImage2D</code> must
+ match the following equation:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ <p>
+ If it is not an <code>INVALID_VALUE</code> error is generated.
+ </p>
+ <p>When <code>level</code> equals zero <code>width</code> and <code>height</code>
+ must be a multiple of 4. When <code>level</code> is greater than 0 <code>width</code>
+ and <code>height</code> must be 0, 1, 2 or a multiple of 4.</p>
+ <p>
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ <p>
+ For <code>compressedTexSubImage2D</code> <code>xoffset</code> and
+ <code>yoffset</code> must be a multiple of 4 and
+ <code>width</code> must be a multiple of 4 or equal to the original
+ width of the <code>level</code>. <code>height</code> must be a multiple of 4 or
+ equal to the original height of the <code>level</code>.
+ If they are not an <code>INVALID_OPERATION</code> error is generated.
+ </p>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_compressed_texture_s3tc_srgb {
+ /* Compressed Texture Formats */
+ const GLenum COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C;
+ const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D;
+ const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E;
+ const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F;
+};
+ </idl>
+ <history>
+ <revision date="2016/06/10">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2016/07/21">
+ <change>Moved to draft after discussion in working group, and study of possible dependencies.</change>
+ </revision>
+ <revision date="2017/05/31">
+ <change>Moved to community approved after Mozilla voiced support.</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_renderer_info/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_renderer_info/extension.xml
new file mode 100644
index 0000000000..59e60ac02d
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_renderer_info/extension.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0"?>
+
+<ratified href="WEBGL_debug_renderer_info/">
+ <name>WEBGL_debug_renderer_info</name>
+ <contact><a href="mailto:zmo@chromium.org">zmo@chromium.org</a></contact>
+ <contributors>
+ <contributor>Members of the <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a></contributor>
+ </contributors>
+ <number>6</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>WebGL implementations might mask the <code>RENDERER</code> and <code>VENDOR</code> strings of the underlying graphics driver for privacy reasons. This extension exposes new tokens to query this information in a guaranteed manner for debugging purposes.</p>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_debug_renderer_info {
+
+ const GLenum UNMASKED_VENDOR_WEBGL = 0x9245;
+ const GLenum UNMASKED_RENDERER_WEBGL = 0x9246;
+
+};
+ </idl>
+ <newtok>
+ <function name="getParameter" type="any">
+ <param name="pname" type="GLenum"/>
+ Two new enums <code>UNMASKED_VENDOR_WEBGL</code> and <code>UNMASKED_RENDERER_WEBGL</code> are accepted by <code>pname</code> parameter in <code>getParameter()</code>.
+ <table class="foo">
+ <tr><th>pname</th><th>returned type</th></tr>
+ <tr><td>UNMASKED_VENDOR_WEBGL</td><td>DOMString</td></tr>
+ <tr><td>UNMASKED_RENDERER_WEBGL</td><td>DOMString</td></tr>
+ </table>
+ <br />
+ The following pname arguments return a string describing some aspect of the underlying graphics driver.
+ <table class="foo">
+ <tr><td>UNMASKED_VENDOR_WEBGL</td><td>Return the VENDOR string of the underlying graphics driver.</td></tr>
+ <tr><td>UNMASKED_RENDERER_WEBGL</td><td>Return the RENDERER string of the underlying graphics driver.</td></tr>
+ </table>
+ </function>
+ </newtok>
+ <issues>
+ <p>
+ 1) What enum values should be used for UNMASKED_VENDOR_WEBGL and UNMASKED_RENDERER_WEBGL?</p>
+ <ul>
+ <li> RESOLVED: The first draft used temporary enum values. They have been replaced with enums allocated from the WEBGL range of GL enums.</li>
+ </ul>
+ <p>
+ 2) Should this extension be made available on ordinary web pages?</p>
+ <ul>
+ <li> Earlier versions of this extension noted the following concerns:
+ <ol>
+ <li> Identifying the precise graphics card in the user's computer may yield certain personally-identifiable information to the web page; for example, if the user has a unique graphics card. </li>
+ <li> Identifying the precise graphics card to JavaScript might encourage developers to target their WebGL applications to run only on a particular type of graphics card. This is similar to the User-Agent "sniffing" or "spoofing" problem which has historically been pervasive and problematic on the web. </li>
+ </ol>
+
+ User agents (web browsers) should carefully consider whether or not to expose this extension in non-privileged settings due to these concerns. </li>
+
+ <li> On the other hand, benefits of exposing this information to general web pages include:
+
+ <ol>
+ <li> The WebGL application can tune its rendering techniques based on previously observed performance characteristics on the same graphics card. </li>
+ <li> The WebGL application can gather useful information for debugging; for example, if it is running slowly, it can gather data for reproducing and fixing the problem. </li>
+ </ol>
+
+ </li>
+ </ul>
+ </issues>
+ <history>
+ <revision date="2011/10/03">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2011/10/12">
+ <change>Assigned enums; assigned webgl extension number.</change>
+ </revision>
+ <revision date="2011/10/18">
+ <change>Clarify the meaning of "privileged".</change>
+ </revision>
+ <revision date="2011/12/07">
+ <change>Fixed mistake where extension still indicated draft status.</change>
+ </revision>
+ <revision date="2012/01/03">
+ <change>Removed webgl module per changes to Web IDL spec.</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2014/01/28">
+ <change>Added issue on privacy and user agent sniffing considerations, replacing security section.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_shaders/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_shaders/extension.xml
new file mode 100644
index 0000000000..1b5f5d3be6
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_debug_shaders/extension.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+
+<ratified href="WEBGL_debug_shaders/">
+ <name>WEBGL_debug_shaders</name>
+ <contact><a href="mailto:zmo@chromium.org">zmo@chromium.org</a></contact>
+ <contributors>
+ <contributor>Members of the <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a></contributor>
+ </contributors>
+ <number>7</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ WebGL uses the GLSL ES 2.0 spec on all platforms, and translates these shaders to the host platform's native language (HLSL, GLSL, and even GLSL ES). For debugging purpose, it is useful to be able to examine the shader after translation. This extension exposes a new function <code>getTranslatedShaderSource</code> for such purposes.
+ </p>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_debug_shaders {
+
+ DOMString getTranslatedShaderSource(WebGLShader shader);
+
+};
+ </idl>
+ <newfun>
+ <function name="getTranslatedShaderSource" type="DOMString">
+ <param name="shader" type="WebGLShader" />
+ If no source has been defined, <code>compileShader()</code> has not been called, or the translation has failed for <code>shader</code>, an empty string is returned; otherwise, return the translated source.
+ </function>
+ </newfun>
+ <issues>
+ <p>
+ 1) Should this extension be made available on ordinary web pages?</p>
+ <ul>
+ <li> Earlier versions of this extension noted the following concerns:
+ <ol>
+ <li> The precise pattern of how the original shader is translated may yield personally-identifiable information to the web page about the kind of graphics card in the user's computer. </li>
+ </ol>
+
+ User agents (web browsers) should carefully consider whether or not to expose this extension in non-privileged settings due to these concerns. </li>
+
+ <li> On the other hand, benefits of exposing this information to general web pages include:
+
+ <ol>
+ <li> Tools for WebGL developers can provide more detailed information about how the input shader is translated to run on the graphics card, potentially helping the developers make their applications run faster. </li>
+ </ol>
+
+ </li>
+ </ul>
+ </issues>
+ <history>
+ <revision date="2011/10/03">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2011/10/14">
+ <change>Assigned WebGL extension number.</change>
+ </revision>
+ <revision date="2011/10/18">
+ <change>Clarify the meaning of "privileged".</change>
+ </revision>
+ <revision date="2011/12/07">
+ <change>Fixed mistake where extension still indicated draft status.</change>
+ <change>Renamed "New Functions and Methods" section to "New Functions".</change>
+ </revision>
+ <revision date="2012/01/03">
+ <change>Removed webgl module per changes to Web IDL spec.</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2014/01/28">
+ <change>Added issue on privacy considerations, replacing security section.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_depth_texture/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_depth_texture/extension.xml
new file mode 100644
index 0000000000..f23dca9e5c
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_depth_texture/extension.xml
@@ -0,0 +1,265 @@
+<?xml version="1.0"?>
+
+<ratified href="WEBGL_depth_texture/">
+ <name>WEBGL_depth_texture</name>
+ <aliases>
+ <alias>WEBKIT_WEBGL_depth_texture</alias>
+ <alias>MOZ_WEBGL_depth_texture</alias>
+ </aliases>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ <contributor>Florian B&#246;sch (pyalot 'at' gmail.com)</contributor>
+ </contributors>
+ <number>9</number>
+ <depends>
+ <api version="1.0"/>
+ <removed version="2.0" />
+ </depends>
+ <overview>
+ <p>This extension exposes the
+ <a href="http://angleproject.googlecode.com/svn/trunk/extensions/ANGLE_depth_texture.txt">ANGLE_depth_texture</a>
+ functionality to WebGL. ANGLE_depth_texture provides a subset of the
+ functionality from the OpenGL ES 2.0 extensions
+ <a href="http://www.khronos.org/registry/gles/extensions/OES/OES_depth_texture.txt">OES_depth_texture</a>
+ and
+ <a href="http://www.khronos.org/registry/gles/extensions/OES/OES_packed_depth_stencil.txt">OES_packed_depth_stencil</a>, with certain restrictions added for portability reasons. Specifically:</p>
+
+ <ul>
+ <li> ANGLE_depth_texture provides both depth and depth/stencil textures. </li>
+ <li> ANGLE_depth_texture does not provide the <code>DEPTH24_STENCIL8_OES</code> renderbuffer internal format from the OES_packed_depth_stencil extension. The core WebGL specification already supports allocation of depth/stencil renderbuffers. </li>
+ <li> ANGLE_depth_texture does not support loading image data via the TexImage or TexSubImage commands. Depth and depth/stencil textures created via this extension can only have their contents specified by rendering to them. </li>
+ </ul>
+
+ <p>Consult the Errors section below for specific restrictions.
+ </p>
+
+ <features>
+ <feature>
+ The <code>texImage2D</code> entry point is extended to accept the
+ <code>format</code> parameter <code>DEPTH_COMPONENT</code> and
+ <code>DEPTH_STENCIL</code>
+ </feature>
+ <feature>
+ The <code>texImage2D</code> entry point is extended to accept the
+ <code>internalFormat</code> parameter <code>DEPTH_COMPONENT</code>
+ and <code>DEPTH_STENCIL</code>
+ </feature>
+ <feature>
+ The <code>texImage2D</code> entry point is extended to accept
+ the <code>type</code> parameter <code>UNSIGNED_SHORT</code>,
+ <code>UNSIGNED_INT</code>, and
+ <code>UNSIGNED_INT_24_8_WEBGL</code>
+ </feature>
+ <feature>
+ The <code>framebufferTexture2D</code> entry point is extended to
+ accept the <code>target</code> parameter
+ <code>DEPTH_ATTACHMENT</code> and
+ <code>DEPTH_STENCIL_ATTACHMENT</code>
+ </feature>
+ <feature>
+ The <code>texImage2D</code> entry point is extended to accept
+ <code>ArrayBufferView</code> of type <code>Uint16Array</code> and
+ <code>Uint32Array</code>
+ </feature>
+ <feature>
+ <p>
+ The WebGL-specific constraints about <a href="http://www.khronos.org/registry/webgl/specs/1.0/#FBO_ATTACHMENTS">Framebuffer Object Attachments</a> are extended:</p>
+
+ <ul>
+ <li> A texture attached to an FBO's <code>DEPTH_ATTACHMENT</code> attachment point must be allocated with the <code>DEPTH_COMPONENT</code> internal format. </li>
+ <li> A texture attached to the <code>DEPTH_STENCIL_ATTACHMENT</code> attachment point must be allocated with the <code>DEPTH_STENCIL</code> internal format. </li>
+ </ul>
+
+ <p>
+ In the WebGL API, it is an error to concurrently attach either
+ renderbuffers or textures to the following combinations of
+ attachment points:</p>
+
+ <ul>
+ <li> <code>DEPTH_ATTACHMENT</code> + <code>DEPTH_STENCIL_ATTACHMENT</code> </li>
+ <li> <code>STENCIL_ATTACHMENT</code> + <code>DEPTH_STENCIL_ATTACHMENT</code> </li>
+ <li> <code>DEPTH_ATTACHMENT</code> + <code>STENCIL_ATTACHMENT</code> </li>
+ </ul>
+
+ <p>
+ See the section
+ <a href="http://www.khronos.org/registry/webgl/specs/1.0/#FBO_ATTACHMENTS">Framebuffer Object Attachments</a>
+ in the WebGL specification for the behavior if these
+ constraints are violated.
+ </p>
+ </feature>
+ <feature>
+ <p>
+ As per the OpenGL ES spec, there is no guarantee that the OpenGL ES implementation
+ will use the texture type to determine how to store the depth texture internally.
+ It may choose to downsample the 32-bit depth values to 16-bit or even 24-bit.
+ When a depth or depth/stencil texture is attached to a framebuffer object, calls to getParameter
+ with the DEPTH_BITS and STENCIL_BITS enums return the following:
+ <table>
+ <tr>
+ <th>Texture Type</th>
+ <th>DEPTH_BITS (GLint)</th>
+ <th>STENCIL_BITS (GLint)</th>
+ </tr>
+ <tr>
+ <td>UNSIGNED_SHORT</td>
+ <td>>= 16</td>
+ <td>0</td>
+ </tr>
+ <tr>
+ <td>UNSIGNED_INT</td>
+ <td>>= 16</td>
+ <td>0</td>
+ </tr>
+ <tr>
+ <td>UNSIGNED_INT_24_8_WEBGL</td>
+ <td>>= 24</td>
+ <td>>= 8</td>
+ </tr>
+ </table>
+ </p>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_depth_texture {
+ const GLenum UNSIGNED_INT_24_8_WEBGL = 0x84FA;
+};
+ </idl>
+ <errors>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by
+ <code>texImage2D</code> if the <code>format</code> parameter is
+ <code>DEPTH_COMPONENT</code> or <code>DEPTH_STENCIL</code> and the
+ <code>target</code> is
+ <code>TEXTURE_CUBE_MAP_{POSITIVE,NEGATIVE}_{X,Y,Z}</code>.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by
+ <code>texImage2D</code> if <code>format</code> and
+ <code>internalformat</code> are <code>DEPTH_COMPONENT</code> and
+ <code>type</code> is not <code>UNSIGNED_SHORT</code> or
+ <code>UNSIGNED_INT</code>.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by
+ <code>texImage2D</code> if <code>format</code> and
+ <code>internalformat</code> are not <code>DEPTH_COMPONENT</code>
+ and <code>type</code> is <code>UNSIGNED_SHORT</code> or
+ <code>UNSIGNED_INT</code>.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by
+ <code>texImage2D</code> if <code>format</code> and
+ <code>internalformat</code> are <code>DEPTH_STENCIL</code> and
+ <code>type</code> is not <code>UNSIGNED_INT_24_8_WEBGL</code>.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by
+ <code>texImage2D</code> if <code>format</code> and
+ <code>internalformat</code> are not <code>DEPTH_STENCIL</code> and
+ <code>type</code> is <code>UNSIGNED_INT_24_8_WEBGL</code>.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated in the following situations:
+ <ul>
+ <li>
+ <code>texImage2D</code> is called with <code>format</code> and
+ <code>internalformat</code> of <code>DEPTH_COMPONENT</code> or
+ <code>DEPTH_STENCIL</code> and
+ <ul>
+ <li> <code>target</code> is not TEXTURE_2D, </li>
+ <li> <code>data</code> is not NULL, or </li>
+ <li> <code>level</code> is not zero. </li>
+ </ul>
+ </li>
+ <li>
+ <code>texSubImage2D</code> is called with <code>format</code> of
+ <code>DEPTH_COMPONENT</code> or <code>DEPTH_STENCIL</code>.
+ </li>
+ <li>
+ <code>copyTexImage2D</code> is called with an
+ <code>internalformat</code> that has a base internal format of
+ <code>DEPTH_COMPONENT</code> or <code>DEPTH_STENCIL</code>.
+ </li>
+ <li>
+ <code>copyTexSubImage2D</code> is called with a target texture
+ that has a base internal format of <code>DEPTH_COMPONENT</code>
+ or <code>DEPTH_STENCIL</code>.
+ </li>
+ <li>
+ <code>generateMipmap</code> is called on a texture that has a
+ base internal format of <code>DEPTH_COMPONENT</code> or
+ <code>DEPTH_STENCIL</code>.
+ </li>
+ </ul>
+ </error>
+ </errors>
+ <issues>
+ <p>
+ As per the ANGLE_depth_texture specification, when a depth
+ texture is sampled, the value is stored into the RED channel.
+ The contents of the GREEN, BLUE and ALPHA channels are
+ implementation dependent. It is therefore recommended to use
+ only the <code>r</code> component of variables in GLSL shaders
+ that are used to reference depth textures.
+ </p>
+ </issues>
+ <history>
+ <revision date="2012/01/23">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2012/01/25">
+ <change>Added provisions to exclude cube depth textures.</change>
+ </revision>
+ <revision date="2012/02/06">
+ <change>Changed referenced WebGL API version from 2.0 to 1.0</change>
+ </revision>
+ <revision date="2012/02/24">
+ <change>Removed the enumerants from the IDL which are contained in the context and added aliases to the extension name</change>
+ </revision>
+ <revision date="2012/03/01">
+ <change>
+ Renamed with OES prefix and removed the addendum due to expected harmonization between OES_depth_texture and ARB_depth_texture
+ (depth cube maps).
+ </change>
+ </revision>
+ <revision date="2012/06/04">
+ <change>
+ Renamed to WEBGL prefix, and changed to reference ANGLE_depth_texture, because of
+ limitations preventing the current ANGLE library from loading of image data to depth
+ textures. Incorporated errors from ANGLE_depth_texure extension specification.
+ </change>
+ </revision>
+ <revision date="2012/06/20">
+ <change>
+ Incorporated depth/stencil support and UNSIGNED_INT_24_8_WEBGL enum after discussion on
+ public_webgl mailing list, including supported behavior and additional error behavior.
+ Extended rules in Section 6.5 ("Framebuffer Object Attachments") to handle texture
+ attachments.
+ </change>
+ </revision>
+ <revision date="2012/06/27">
+ <change>
+ Updated references to texSubImage2D. Added
+ DEPTH_STENCIL_ATTACHMENT to framebufferTexture2D.
+ </change>
+ </revision>
+ <revision date="2013/01/26">
+ <change>Moved from draft to community approved status</change>
+ </revision>
+ <revision date="2013/02/28">
+ <change>Updated to track ANGLE_depth_texture, indicating that only red channel is guaranteed.</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_draw_buffers/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_draw_buffers/extension.xml
new file mode 100644
index 0000000000..106ebce4fb
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_draw_buffers/extension.xml
@@ -0,0 +1,185 @@
+<?xml version="1.0"?>
+
+<ratified href="WEBGL_draw_buffers/">
+ <name>WEBGL_draw_buffers</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>18</number>
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0">
+ <glsl version="300 es"/>
+ </core>
+ </depends>
+ <overview>
+ <mirrors href="https://www.khronos.org/registry/gles/extensions/EXT/EXT_draw_buffers.txt" name="EXT_draw_buffers">
+ <addendum>
+ The implementation must support a minimum of 4 color attachments.
+ </addendum>
+ <addendum>
+ The value of the <code>MAX_COLOR_ATTACHMENTS_WEBGL</code> parameter must be greater than or
+ equal to that of the <code>MAX_DRAW_BUFFERS_WEBGL</code> parameter.
+ </addendum>
+ <addendum>
+ If:
+ <ul>
+ <li> A framebuffer's color attachments are all textures allocated with format <code>RGBA</code>
+ and type <code>UNSIGNED_BYTE</code>, and </li>
+ <li> The framebuffer has either:
+ <ul>
+ <li> No depth or stencil attachment </li>
+ <li> A valid <code>DEPTH</code> or <code>DEPTH_STENCIL</code> attachment </li>
+ </ul></li>
+ </ul>
+ Then a call to <code>checkFramebufferStatus</code> against this framebuffer must not return
+ <code>FRAMEBUFFER_UNSUPPORTED</code>. (In other words, the implementation must support the
+ use of <code>RGBA/UNSIGNED_BYTE</code> textures as color attachments, plus either a
+ <code>DEPTH</code> or <code>DEPTH_STENCIL</code> attachment.)
+ </addendum>
+ <addendum>
+ Attaching <code>n</code> consecutive color attachments starting at COLOR_ATTACHMENT0_WEBGL,
+ where <code>n</code> is between 1 and <code>MAX_DRAW_BUFFERS_WEBGL</code>, must not return
+ <code>FRAMEBUFFER_UNSUPPORTED</code> from a call to <code>checkFramebufferStatus</code>. In
+ other words, if <code>MAX_DRAW_BUFFERS_WEBGL</code> is 4, then the implementation is
+ required to support the following combinations of color attachments:
+
+ <ul>
+ <li> <code>COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE</code></li>
+ <li> <code>COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE</code><br/>
+ <code>COLOR_ATTACHMENT1_WEBGL = RGBA/UNSIGNED_BYTE</code><br/></li>
+ <li> <code>COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE</code><br/>
+ <code>COLOR_ATTACHMENT1_WEBGL = RGBA/UNSIGNED_BYTE</code><br/>
+ <code>COLOR_ATTACHMENT2_WEBGL = RGBA/UNSIGNED_BYTE</code><br/></li>
+ <li> <code>COLOR_ATTACHMENT0_WEBGL = RGBA/UNSIGNED_BYTE</code><br/>
+ <code>COLOR_ATTACHMENT1_WEBGL = RGBA/UNSIGNED_BYTE</code><br/>
+ <code>COLOR_ATTACHMENT2_WEBGL = RGBA/UNSIGNED_BYTE</code><br/>
+ <code>COLOR_ATTACHMENT3_WEBGL = RGBA/UNSIGNED_BYTE</code><br/></li>
+ </ul>
+ </addendum>
+ <addendum>
+ Although the extension name is prefixed with WEBGL the extension must be enabled with the
+ <code>#extension GL_EXT_draw_buffers</code> directive, as shown in the sample code, to use
+ the extension in a shader.
+
+ Likewise the shading language preprocessor <code>#define GL_EXT_draw_buffers</code>, will be defined to 1 if the extension is supported.
+ </addendum>
+ <addendum>
+ The value of <code>gl_MaxDrawBuffers</code> must match <code>MAX_DRAW_BUFFERS_WEBGL</code> from the API if the extension is enabled in a WebGL context; otherwise, the value must be 1. Whether or not the extension is enabled with the <code>#extension GL_EXT_draw_buffers</code> directive in a shader does not affect the value of <code>gl_MaxDrawBuffers</code>. The value of <code>gl_MaxDrawBuffers</code> is a constant in the shader, and is guaranteed to be frozen at program link time. It is implementation-dependent whether it is frozen at shader compile time. (A consequence is that if a program is linked, and later the WEBGL_draw_buffers extension is enabled, the value of <code>gl_MaxDrawBuffers</code> seen by that program will still be 1.)
+ </addendum>
+ <addendum>
+ If the WEBGL_draw_buffers extension is enabled, but the fragment shader does not contain the <code>#extension GL_EXT_draw_buffers</code> directive to enable it, then writes to <code>gl_FragColor</code> are only written to <code>COLOR_ATTACHMENT0_WEBGL</code>, and not broadcast to all color attachments. In this scenario, other color attachments are guaranteed to remain untouched.
+ </addendum>
+ <addendum>
+ If a fragment shader writes to neither <code>gl_FragColor</code> nor <code>gl_FragData</code>, the values of
+ the fragment colors following shader execution are untouched.
+
+ If a fragment shader contains the <code>#extension GL_EXT_draw_buffers</code> directive, all
+ <code>gl_FragData</code> variables (from <code>gl_FragData[0]</code> to <code>gl_FragData[MAX_DRAW_BUFFERS_WEBGL - 1]</code>)
+ default to zero if no values are written to them during a shader execution.
+ </addendum>
+ <addendum>
+ If an image is attached to more than one color attachment point in a framebuffer, <code>checkFramebufferStatus</code>
+ returns <code>FRAMEBUFFER_UNSUPPORTED</code>. An image can be an individual mip level, or a face of cube map.
+ </addendum>
+ </mirrors>
+ <features>
+ <feature>
+ Adds support for multiple color buffers and color outputs from fragment shaders.
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_draw_buffers {
+ const GLenum COLOR_ATTACHMENT0_WEBGL = 0x8CE0;
+ const GLenum COLOR_ATTACHMENT1_WEBGL = 0x8CE1;
+ const GLenum COLOR_ATTACHMENT2_WEBGL = 0x8CE2;
+ const GLenum COLOR_ATTACHMENT3_WEBGL = 0x8CE3;
+ const GLenum COLOR_ATTACHMENT4_WEBGL = 0x8CE4;
+ const GLenum COLOR_ATTACHMENT5_WEBGL = 0x8CE5;
+ const GLenum COLOR_ATTACHMENT6_WEBGL = 0x8CE6;
+ const GLenum COLOR_ATTACHMENT7_WEBGL = 0x8CE7;
+ const GLenum COLOR_ATTACHMENT8_WEBGL = 0x8CE8;
+ const GLenum COLOR_ATTACHMENT9_WEBGL = 0x8CE9;
+ const GLenum COLOR_ATTACHMENT10_WEBGL = 0x8CEA;
+ const GLenum COLOR_ATTACHMENT11_WEBGL = 0x8CEB;
+ const GLenum COLOR_ATTACHMENT12_WEBGL = 0x8CEC;
+ const GLenum COLOR_ATTACHMENT13_WEBGL = 0x8CED;
+ const GLenum COLOR_ATTACHMENT14_WEBGL = 0x8CEE;
+ const GLenum COLOR_ATTACHMENT15_WEBGL = 0x8CEF;
+
+ const GLenum DRAW_BUFFER0_WEBGL = 0x8825;
+ const GLenum DRAW_BUFFER1_WEBGL = 0x8826;
+ const GLenum DRAW_BUFFER2_WEBGL = 0x8827;
+ const GLenum DRAW_BUFFER3_WEBGL = 0x8828;
+ const GLenum DRAW_BUFFER4_WEBGL = 0x8829;
+ const GLenum DRAW_BUFFER5_WEBGL = 0x882A;
+ const GLenum DRAW_BUFFER6_WEBGL = 0x882B;
+ const GLenum DRAW_BUFFER7_WEBGL = 0x882C;
+ const GLenum DRAW_BUFFER8_WEBGL = 0x882D;
+ const GLenum DRAW_BUFFER9_WEBGL = 0x882E;
+ const GLenum DRAW_BUFFER10_WEBGL = 0x882F;
+ const GLenum DRAW_BUFFER11_WEBGL = 0x8830;
+ const GLenum DRAW_BUFFER12_WEBGL = 0x8831;
+ const GLenum DRAW_BUFFER13_WEBGL = 0x8832;
+ const GLenum DRAW_BUFFER14_WEBGL = 0x8833;
+ const GLenum DRAW_BUFFER15_WEBGL = 0x8834;
+
+ const GLenum MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF;
+ const GLenum MAX_DRAW_BUFFERS_WEBGL = 0x8824;
+
+ void drawBuffersWEBGL(sequence&lt;GLenum&gt; buffers);
+};
+ </idl>
+ <samplecode xml:space="preserve">
+ <pre>
+ #extension GL_EXT_draw_buffers : require
+ precision mediump float;
+ void main() {
+ gl_FragData[0] = vec4(1.0, 0.0, 0.0, 1.0);
+ gl_FragData[1] = vec4(0.0, 1.0, 0.0, 1.0);
+ gl_FragData[2] = vec4(0.0, 0.0, 1.0, 1.0);
+ gl_FragData[3] = vec4(1.0, 1.0, 1.0, 1.0);
+ }
+ </pre>
+ </samplecode>
+ <history>
+ <revision date="2012/10/16">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2012/11/05">
+ <change>Corrected typo in drawBuffersWEBGL. Changed referenced spec version to 1.0 to fix broken link.</change>
+ </revision>
+ <revision date="2013/02/02">
+ <change>Renamed to EXT_draw_buffers per plan of OpenGL ES working group. Moved to draft status. Assigned number.</change>
+ </revision>
+ <revision date="2013/03/05">
+ <change>Renamed to WEBGL_draw_buffers per discussion on public_webgl list. Added guarantees to make it easier for developers to use the extension.</change>
+ </revision>
+ <revision date="2013/06/07">
+ <change>Clarified naming of shader directives.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2014/08/08">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2016/06/28">
+ <change>Revised behavior of gl_MaxDrawBuffers and gl_FragColor broadcasting, to avoid significant performance impact for WebGL 1.0 implementations running on top of the desktop OpenGL API.</change>
+ </revision>
+ <revision date="2016/07/08">
+ <change>Removed undefined behaviors.</change>
+ </revision>
+ <revision date="2016/07/11">
+ <change>Revised user-defined variable behavior to default to zero.</change>
+ </revision>
+ <revision date="2016/07/23">
+ <change>Revised behavior of the same image is attached to more than one color attachment point.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_lose_context/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_lose_context/extension.xml
new file mode 100644
index 0000000000..8c7d0f1636
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_lose_context/extension.xml
@@ -0,0 +1,114 @@
+<?xml version="1.0"?>
+
+<ratified href="WEBGL_lose_context/">
+ <name>WEBGL_lose_context</name>
+ <aliases>
+ <alias>WEBKIT_WEBGL_lose_context</alias>
+ <alias>MOZ_WEBGL_lose_context</alias>
+ </aliases>
+ <contact><a href="mailto:enne@chromium.org">enne@chromium.org</a></contact>
+ <contributors>
+ <contributor>Members of the <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a></contributor>
+ <contributor>Glenn Maynard</contributor>
+ </contributors>
+ <number>3</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>This extension exposes new functions which simulate losing and restoring the WebGL context, even on platforms where the context can never be lost. Consult the WebGL specification for documentation about the <code>webglcontextlost</code> and <code>webglcontextrestored</code> events.</p>
+ <p>When this extension is enabled:
+ <ul>
+ <li><code>loseContext</code> and <code>restoreContext</code> are allowed to generate INVALID_OPERATION errors even when the context is lost.</li>
+ </ul>
+ </p>
+ <p>
+ Note that this extension is <strong>not</strong> disconnected from the WebGLRenderingContext if that
+ object loses its context as described in "The Context Lost Event" of the WebGL specification, either
+ through use of this API or via actual circumstances such as a system failure.
+ </p>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_lose_context {
+ void loseContext();
+ void restoreContext();
+};
+ </idl>
+ <newfun>
+ <function name="loseContext" type="void">
+ <p>When this function is called and the context is not lost, simulate
+ losing the context so as to trigger the steps described in the WebGL
+ spec for handling context lost. The context will remain in the lost
+ state according to the WebGL specification until
+ <code>restoreContext()</code> is called. If the context is already
+ lost when this function is called, generate an
+ <code>INVALID_OPERATION</code> error.</p>
+
+ <p>Implementations should destroy the underlying graphics context and
+ all graphics resources when this method is called. This is the
+ recommended mechanism for applications to programmatically halt their
+ use of the WebGL API.</p>
+
+ </function>
+ <function name="restoreContext" type="void">
+ When this function is called while the context is lost, and the conditions
+ defined by the WebGL specification for restoring the context are
+ met, simulate the context being restored so as to trigger the steps
+ described in the WebGL spec for handling the context being restored.
+ If the context is already restored when this function is called, or if
+ the conditions in the WebGL specification for restoring the
+ context are not satisfied, or if the context was not lost via <code>loseContext()</code>,
+ generate an <code>INVALID_OPERATION</code> error.
+ </function>
+ </newfun>
+ <history>
+ <revision date="2011/01/11">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2011/04/14">
+ <change>Added explicit restoreContext() method based on discussion on public_webgl list, to enable testing of scenario where context stays lost for a period of time.</change>
+ </revision>
+ <revision date="2011/11/08">
+ <change>Renamed from WEBKIT_lose_context to WEBGL_EXT_lose_context</change>
+ </revision>
+ <revision date="2011/11/11">
+ <change>Changed to make it clear this extension should follow the WebGL spec for the steps involved in handling losing and restoring the context rather than just fire events.</change>
+ </revision>
+ <revision date="2011/12/06">
+ <change>Added vendor-specific name strings for draft extension per discussion on WebGL mailing list</change>
+ <change>Renamed from WEBGL_EXT_lose_context to WEBGL_lose_context</change>
+ </revision>
+ <revision date="2011/12/07">
+ <change>Renamed "Name Strings" section to "Alias Name Strings".</change>
+ </revision>
+ <revision date="2012/01/03">
+ <change>Removed webgl module per changes to Web IDL spec.</change>
+ </revision>
+ <revision date="2013/01/26">
+ <change>Moved from draft to community approved status</change>
+ </revision>
+ <revision date="2013/05/15">
+ <change>Ratified by Khronos Board of Promoters.</change>
+ </revision>
+ <revision date="2013/06/05">
+ <change>Clarified error generation that conflicted with WebGL spec.</change>
+ </revision>
+ <revision date="2013/08/02">
+ <change>
+ Indicated that this extension is not disconnected from the WebGLRenderingContext
+ when that object loses its drawing buffer (i.e. when it performs the steps
+ outlined in "The Context Lost Event" of the WebGL specification).</change>
+ </revision>
+ <revision date="2014/05/08">
+ <change>Added INVALID_OPERATION for restoreContext() without loseContext()</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2017/02/03">
+ <change>Per discussion in working group, document that this extension
+ should destroy the underlying context and all graphics resources.</change>
+ </revision>
+ </history>
+</ratified>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_multiview/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_multiview/extension.xml
new file mode 100644
index 0000000000..fb22e01b60
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_multiview/extension.xml
@@ -0,0 +1,285 @@
+<?xml version="1.0"?>
+
+<draft href="WEBGL_multiview/">
+ <name>WEBGL_multiview</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Olli Etuaho, NVIDIA</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>36</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <mirrors href="https://www.opengl.org/registry/specs/OVR/multiview.txt" name="OVR_multiview">
+ <addendum>
+ Calling <code>framebufferTextureMultiviewWEBGL</code> with a non-null <code>texture</code> parameter that does not identify a 2D array texture generates an <code>INVALID_OPERATION</code> error.
+ </addendum>
+ <addendum>
+ The values of <code>baseViewIndex</code> and <code>numViews</code> can result in an error only if the <code>texture</code> parameter is non-null.
+ </addendum>
+ <addendum>
+ If <code>baseViewIndex</code> is not the same for all framebuffer attachment points where the value of <code>FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code> is not <code>NONE</code> the framebuffer is considered incomplete. Calling <code>getFramebufferStatus</code> for a framebuffer in this state returns <code>FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR</code>. Other rules for framebuffer completeness from the OVR_multiview specification also apply.
+ </addendum>
+ <addendum>
+ Other web APIs may expose <i>opaque multiview framebuffers</i>. Opaque multiview framebuffers are <code>WebGLFramebuffer</code> objects that act as if they have multi-view attachments, but their attachments are not exposed as textures or renderbuffers and can not be changed. Opaque multiview framebuffers may have any combination of color, depth and stencil attachments.
+ </addendum>
+ <addendum>
+ Calling <code>framebufferRenderbuffer</code>, <code>framebufferTexture2D</code>, <code>framebufferTextureLayer</code>, <code>framebufferTextureMultiviewWEBGL</code>, or any other call that could change framebuffer attachments with an opaque multiview framebuffer bound to <code>target</code> generates an <code>INVALID_OPERATION</code> error.
+ </addendum>
+ <addendum>
+ If an opaque framebuffer is bound to <code>target</code> when calling <code>getFramebufferAttachmentParameter</code>, then <code>attachment</code> must be <code>BACK</code>, <code>DEPTH</code>, or <code>STENCIL</code>.
+ </addendum>
+ <addendum>
+ If an opaque framebuffer is bound to <code>target</code> when calling <code>getFramebufferAttachmentParameter</code>, then <code>pname</code> must not be <code>FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code>.
+ </addendum>
+ <addendum>
+ Querying <code>FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR</code> on an opaque multiview framebuffer attachment point that has attachments must return the number of views in the opaque multiview framebuffer.
+ </addendum>
+ <addendum>
+ Querying <code>FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR</code> on an opaque multiview framebuffer must return 0.
+ </addendum>
+ <addendum>
+ Querying <code>FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</code> on an opaque multiview framebuffer must return <code>FRAMEBUFFER_DEFAULT</code>.
+ </addendum>
+ <addendum>
+ The number of views in an opaque multiview framebuffer may be greater than the maximum number of texture array views (the value of <code>MAX_VIEWS_OVR</code>).
+ </addendum>
+ <addendum>
+ Passing an opaque multiview framebuffer to <code>deleteFramebuffer</code> generates an <code>INVALID_OPERATION</code> error.
+ </addendum>
+ <addendum>
+ Although the extension name is prefixed with WEBGL the extension must be enabled with the
+ <code>#extension GL_OVR_multiview</code> directive, as shown in the sample code, to use
+ the extension in a shader.
+
+ Likewise the shading language preprocessor <code>#define GL_OVR_multiview</code>, will be defined to 1 if the extension is supported.
+ </addendum>
+ <addendum>
+ This extension relaxes the restriction in OVR_multiview that only <code>gl_Position</code> can depend on ViewID in the vertex shader. With this change, view-dependent outputs like reflection vectors and similar are allowed.
+ </addendum>
+ <addendum>
+ When the number of views specified in the active program is one, <code>gl_ViewID_OVR</code> will always evaluate to zero.
+ </addendum>
+ <addendum>
+ When a shader written in OpenGL ES shading language version 1.00 enables or requires <code>GL_OVR_multiview</code> with an extension directive, <code>layout</code> is treated as a keyword rather than an identifier, and using a layout qualifier to specify <code>num_views</code> is allowed. Other uses of layout qualifiers are not allowed in OpenGL ES shading language 1.00.
+ </addendum>
+ <addendum>
+ In OpenGL ES shading language version 1.00 <code>gl_ViewID_OVR</code> has the type <code>int</code> as opposed to <code>uint</code>.
+ </addendum>
+ <addendum>
+ When a timer query is active and the number of views in the current draw framebuffer is greater than one, attempting to draw or calling <code>clear</code> generates an <code>INVALID_OPERATION</code> error.
+ </addendum>
+ <addendum>
+ When the number of views in the current draw framebuffer is greater than one and the active program does not declare a number of views, attempting to draw generates an <code>INVALID_OPERATION</code> error.
+ </addendum>
+ </mirrors>
+ <features>
+ <feature>
+ Adds support for rendering into multiple views simultaneously. This is supported for opaque multiview framebuffers starting from WebGL 1.0, and 2D texture arrays starting from WebGL 2.0.
+ </feature>
+ <feature>
+ When a shader enables, requires, or warns <code>GL_OVR_multiview</code> with an extension directive:
+ <ul>
+ <li><code>gl_ViewID_OVR</code> is a built-in input of the type uint.</li>
+ </ul>
+ </feature>
+ <feature>
+ The GLSL macro <code>GL_OVR_multiview</code> is defined as 1.
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_multiview {
+ const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630;
+ const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632;
+ const GLenum MAX_VIEWS_OVR = 0x9631;
+ const GLenum FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633;
+
+ void framebufferTextureMultiviewWEBGL(GLenum target, GLenum attachment, WebGLTexture? texture, GLint level, GLint baseViewIndex, GLsizei numViews);
+};
+ </idl>
+ <newfun>
+ <function name="framebufferTextureMultiviewWEBGL" type="void">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="texture" type="GLuint"/>
+ <param name="level" type="GLint"/>
+ <param name="baseViewIndex" type="GLint"/>
+ <param name="numViews" type="GLsizei"/>
+ </function>
+ </newfun>
+ <newtok>
+ <function name="getParameter" type="any">
+ <param name="pname" type="GLenum"/>
+ Calling with the <code>pname</code> set to <code>MAX_VIEWS_OVR</code> returns the maximum number of views. The implementation must support at least 2 views.
+ <br/>
+
+ The return type depends on the parameter queried:
+ <table width="30%">
+ <tr><th>pname</th><th>returned type</th></tr>
+ <tr><td>MAX_VIEWS_OVR</td><td>GLint</td></tr>
+ </table>
+ </function>
+ </newtok>
+ <newtok>
+ <function name="getFramebufferAttachmentParameter" type="any">
+ <param name="target" type="GLenum"/>
+ <param name="attachment" type="GLenum"/>
+ <param name="pname" type="GLenum"/>
+ Calling with the <code>pname</code> parameter set to <code>FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR</code> returns the number of views of the framebuffer object attachment.
+ Calling with the <code>pname</code> parameter set to <code>FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR</code> returns the base view index of the framebuffer object attachment.
+ <br/>
+
+ The return type depends on the parameter queried:
+ <table width="30%">
+ <tr><th>pname</th><th>returned type</th></tr>
+ <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR</td><td>GLsizei</td></tr>
+ <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR</td><td>GLint</td></tr>
+ </table>
+ </function>
+ </newtok>
+ <errors>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by calling <code>framebufferTextureMultiviewWEBGL</code> with a <code>texture</code> parameter that does not identify a 2D array texture.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by calling <code>framebufferRenderbuffer</code>, <code>framebufferTexture2D</code>, <code>framebufferTextureLayer</code>, or <code>framebufferTextureMultiviewWEBGL</code> with a <code>target</code> parameter that identifies an opaque multiview framebuffer.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by calling <code>deleteFramebuffer</code> with a <code>buffer</code> parameter that identifies an opaque multiview framebuffer.
+ </error>
+ <error>
+ The error <code>INVALID_ENUM</code> is generated by calling <code>getFramebufferAttachmentParameter</code> with an <code>attachment</code> parameter other than <code>BACK</code>, <code>DEPTH</code> or <code>STENCIL</code> when the <code>target</code> parameter identifies an opaque multiview framebuffer.
+ </error>
+ <error>
+ The error <code>INVALID_ENUM</code> is generated by calling <code>getFramebufferAttachmentParameter</code> with the <code>pname</code> parameter set to <code>FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</code> when the <code>target</code> parameter identifies an opaque multiview framebuffer.
+ </error>
+ <error>
+ The error <code>INVALID_VALUE</code> is generated by calling <code>framebufferTextureMultiviewWEBGL</code> with a non-null <code>texture</code> in the following cases:
+ <ul>
+ <li>if <code>numViews</code> is less than one</li>
+ <li>if <code>numViews</code> is more than <code>MAX_VIEWS_OVR</code></li>
+ <li>with the parameters set so that <code>baseViewIndex</code> + <code>numViews</code> is larger than the value of <code>MAX_ARRAY_TEXTURE_LAYERS</code></li>
+ <li>if <code>baseViewIndex</code> is negative</li>
+ </ul>
+ </error>
+ <error>
+ The error <code>INVALID_FRAMEBUFFER_OPERATION</code> is generated by commands that read from the framebuffer such as <code>BlitFramebuffer</code>, <code>ReadPixels</code>, <code>CopyTexImage*</code>, and <code>CopyTexSubImage*</code>, if the number of views in the current read framebuffer is greater than one.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by attempting to draw if the active program declares a number of views and the number of views in the draw framebuffer does not match the number of views declared in the active program.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by attempting to draw if the number of views in the current draw framebuffer is greater than one and the active program does not declare a number of views.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by attempting to draw if the number of views in the current draw framebuffer is greater than one and transform feedback is active.
+ </error>
+ <error>
+ The error <code>INVALID_OPERATION</code> is generated by attempting to draw or calling <code>clear</code> if the number of views in the current draw framebuffer is greater than one and a timer query is active.
+ </error>
+ </errors>
+ <samplecode xml:space="preserve">
+ <pre>
+ var gl = document.createElement('canvas').getContext('webgl2');
+ var ext = gl.getExtension('WEBGL_multiview');
+ var fb = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, fb);
+ var colorTex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, colorTex);
+ gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.RGBA8, 512, 512, 2);
+ ext.framebufferTextureMultiviewWEBGL(gl.DRAW_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, colorTex, 0, 0, 2);
+ var depthStencilTex = gl.createTexture();
+ gl.bindTexture(gl.TEXTURE_2D_ARRAY, depthStencilTex);
+ gl.texStorage3D(gl.TEXTURE_2D_ARRAY, 1, gl.DEPTH32F_STENCIL8, 512, 512, 2);
+ ext.framebufferTextureMultiviewWEBGL(gl.DRAW_FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, depthStencilTex, 0, 0, 2);
+ gl.drawElements(...); // draw will be broadcasted to the layers of colorTex and depthStencilTex.
+ </pre>
+ </samplecode>
+ <samplecode xml:space="preserve">
+ <pre>
+ var gl = document.createElement('canvas').getContext('webgl');
+ var ext = gl.getExtension('WEBGL_multiview');
+ // ... obtain opaque multiview framebuffer "fb" from another web API here ...
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
+ gl.drawElements(...); // draw will be broadcasted to the views of the opaque multiview framebuffer.
+ // You can not call framebufferTextureMultiviewWEBGL to change the attachments of "fb", only draw to it.
+ </pre>
+ </samplecode>
+ <samplecode xml:space="preserve">
+ <pre>
+ #version 300 es
+ #extension GL_OVR_multiview : require
+ precision mediump float;
+ layout (num_views = 2) in;
+ in vec4 inPos;
+ uniform mat4 u_viewMatrix0;
+ uniform mat4 u_viewMatrix1;
+ void main() {
+ if (gl_ViewID_OVR == 0u) {
+ gl_Position = u_viewMatrix0 * inPos;
+ } else {
+ gl_Position = u_viewMatrix1 * inPos;
+ }
+ }
+ </pre>
+ </samplecode>
+ <history>
+ <revision date="2016/11/11">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2016/11/25">
+ <change>Specified what happens when the number of views doesn't match or if the number of views is one.</change>
+ </revision>
+ ´
+ <revision date="2016/12/21">
+ <change>Specified what happens on invalid num_views declarations and if assignment to gl_Position.x is inside a larger expression.</change>
+ </revision>
+
+ <revision date="2017/01/12">
+ <change>Filled in getFramebufferAttachmentParameter and extension macro specs, formatted the documentation better, and added a simple API usage example.</change>
+ </revision>
+
+ <revision date="2017/03/10">
+ <change>Removed the core spec changes and made the specification follow the OVR_multiview specification more closely.</change>
+ </revision>
+
+ <revision date="2017/05/19">
+ <change>Introduced the concept of an opaque multiview framebuffer and fixed example code.</change>
+ </revision>
+
+ <revision date="2017/05/23">
+ <change>Made the extension compatible with WebGL 1.0 and fixed example shader code.</change>
+ </revision>
+
+ <revision date="2017/07/21">
+ <change>Specified some errors to be generated at draw time and made the extension compatible with emscripten.</change>
+ </revision>
+
+ <revision date="2017/08/08">
+ <change>Rolled back shader restrictions.</change>
+ </revision>
+
+ <revision date="2017/08/17">
+ <change>Required a multiview program to draw to a multiview framebuffer.</change>
+ </revision>
+
+ <revision date="2017/10/26">
+ <change>Took changes in the native OVR_multiview specification into account, added a more elaborate example including a depth/stencil texture, and an explicit mention that texture arrays are only supported in WebGL 2.0.</change>
+ </revision>
+
+ <revision date="2018/01/03">
+ <change>Moved to draft status.</change>
+ </revision>
+
+ <revision date="2018/07/26">
+ <change>Fixed off-by-one issue in validating baseViewIndex + numViews.</change>
+ </revision>
+ </history>
+</draft>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_security_sensitive_resources/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_security_sensitive_resources/extension.xml
new file mode 100644
index 0000000000..de81d178d3
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/WEBGL_security_sensitive_resources/extension.xml
@@ -0,0 +1,200 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<draft href="WEBGL_security_sensitive_resources/">
+
+ <name>WEBGL_security_sensitive_resources</name>
+
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+
+ <contributors>
+ <contributor>Max Vujovic (mvujovic 'at' adobe.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>23</number>
+
+ <depends>
+ <api version="1.0"/>
+ <ext name="EXT_frag_depth"/>
+ <ext name="WEBGL_draw_buffers"/>
+ <ext name="WEBGL_shared_resources"/>
+ </depends>
+
+ <overview>
+ <p>In the <a href="../../../specs/1.0/">WebGL API 1.0</a> specification, section <a href="../../../specs/1.0/#4.2">4.2 Origin Restrictions</a> restricts the following sources for texture upload:</p>
+ <p>
+ <ul>
+ <li>An image or video element whose origin is not the same as the origin of the <code>Document</code> that contains the <code>WebGLRenderingContext</code>'s canvas element.</li>
+ <li>A canvas element whose <i>origin-clean</i> flag is set to false.</li>
+ </ul>
+ </p>
+ <p>This extension allows these sources for texture uploads, with some restrictions regarding their uploading and use.</p>
+
+ <div class="nonnormative">
+ <p>Motivation:</p>
+ <p>This extension enables the processing of cross-origin resources in WebGL. Additionally, it defines a foundation of concepts that can be used in future extensions to process other types of security sensitive content, including arbitrary HTML content.</p>
+ <p>For an example of security sensitive content, consider the rendering of an HTML link. The color of the link can indicate its visited or unvisited state. Third parties must not be able to access or infer this information.</p>
+ <p>Specifically, third parties must not be able read the pixel data of security sensitive content through WebGL or other APIs. Additionally, third parties must not be able to divulge or approximate the pixel data of security sensitive content by timing WebGL operations.</p>
+ <p>Prior to this extension, WebGL restricted the upload of security sensitive content as a texture for graphical processing. This extension enables the uploading and processing of security sensitive content, with some restrictions. Note that this extension imposes no restrictions on the processing of regular, non-security sensitive content.</p>
+ <p>To secure a user’s privacy, a WebGL implementation must not leak information about the contents of security sensitive textures through the execution time of its commands. To achieve this, no part of the underlying graphics pipeline may vary in execution time based on the contents of a security sensitive texture. For example, primitive assembly and depth testing must not vary based on the contents of a security sensitive texture.</p>
+ <p>The vertex shading and fragment shading stages of the graphics pipeline require particular restrictions to keep their execution time independent of the contents of security sensitive textures. Specifically, the contents of a security sensitive texture must only appear in constant-time GLSL operations. A constant-time GLSL operation is an operation whose execution time does not vary based on the values of its operands. This extension will describe how a WebGL implementation can enforce this requirement.</p>
+ <p>Additionally, this extension attempts to identify non-constant-time GLSL operations. All other GLSL operations are assumed to be constant time in both the WebGL implementation and the underlying GPU implementation. If this assumption is false on a particular implementation, then this extension must be disabled for that implementation. In the future, GPU vendors may be able to provide a mechanism to guarantee that the assumed GLSL operations are in fact constant-time.</p>
+ </div>
+
+ <h3>Definitions</h3>
+ <p>This extension relies on the definition of several constructs in GLSL. These constructs are determined statically, after preprocessing.</p>
+
+ <h4>Regular Sampler Variables and Secure Sampler Variables</h4>
+ <p><code>S</code> is a regular sampler if an expression dependent on <code>S</code> appears in one or more of the following constructs:</p>
+ <p>
+ <ul>
+ <li><code>if</code> statement condition</li>
+ <li>selection operator (<code>?</code>) condition</li>
+ <li>loop condition</li>
+ <li>logical and operator (<code>&amp;&amp;</code>)</li>
+ <li>logical or operator (<code>||</code>)</li>
+ <li><code>coord</code>, <code>bias</code>, or <code>lod</code> argument in a texture lookup function call</li>
+ <li>assignment to <code>gl_Position</code></li>
+ <li>assignment to <code>gl_FragDepth</code></li>
+ </ul>
+ </p>
+ <p>Otherwise, <code>S</code> is a secure sampler.</p>
+
+ <h4>Sampler-Dependent Expressions</h4>
+ <p>An expression is dependent on the sampler <code>S</code> if:</p>
+ <p>
+ <ul>
+ <li>It contains a texture lookup function call with <code>S</code> as the <code>sampler</code> argument.</li>
+ <li>It contains an expression that is dependent on the sampler <code>S</code>.</li>
+ <li>It contains a variable that is dependent on the sampler <code>S</code>.</li>
+ </ul>
+ </p>
+
+ <h4>Sampler-Dependent Variables</h4>
+ <p>A variable is dependent on the sampler <code>S</code> if:</p>
+ <p>
+ <ul>
+ <li>It is assigned to an expression dependent on the sampler <code>S</code>. (e.g. If <code>a = b</code> and <code>b</code> is dependent on sampler <code>S</code>, then <code>a</code> is dependent on sampler <code>S</code>.)</li>
+ <li>It is addressed using a sampler-dependent expression in an assignment. (e.g. If <code>a[b] = c</code> and <code>b</code> is dependent on the sampler <code>S</code>, then <code>a</code> is dependent on sampler <code>S</code>.)</li>
+ <li>It is a fragment shader varying and the corresponding vertex shader varying is dependent on the sampler <code>S</code>.</li>
+ </ul>
+ </p>
+
+ <div class="nonnormative">
+ A WebGL implementation can create a dependency graph in its GLSL compiler to implement these GLSL constructs. One closely related implementation is described in a <a href="http://code.google.com/p/mvujovic/wiki/ShaderControlFlowAnalysis">wiki page</a>.
+ </div>
+
+ <h3>Features</h3>
+ <features>
+ <feature>The <code>WebGLRenderingContext</code>'s canvas's <i>origin-clean</i> flag is set to false if the context is created with a <code>WebGLContextAttributes</code> dictionary with <code>securitySensitiveDrawingBuffer</code> set to true.</feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_security_sensitive_resources {
+ WebGLFramebuffer? createSecuritySensitiveFramebuffer();
+ WebGLTexture? createSecuritySensitiveTexture();
+};
+
+dictionary WebGLContextAttributes {
+ GLboolean securitySensitiveDrawingBuffer = false;
+};
+ </idl>
+
+ <newfun>
+ <function name="createSecuritySensitiveFramebuffer" type="WebGLFramebuffer?">Behaves like <code>createFramebuffer</code>, except framebuffers created with this function are referred to as security sensitive framebuffers. Framebuffers created with <code>createFramebuffer</code> are referred to as regular framebuffers.</function>
+ <function name="createSecuritySensitiveTexture" type="WebGLTexture?">Behaves like <code>createTexture</code>, except textures created with this function are known as security sensitive textures. Textures created with <code>createTexture</code> are known as regular textures.</function>
+ </newfun>
+
+ <errors>
+ <error>
+ <div class="nonnormative">
+ <p>In summary, an author cannot:</p>
+ <ul>
+ <li>draw a security sensitive resource into a regular resource,</li>
+ <li>copy from a security sensitive resource into a regular resource,</li>
+ <li>read a security sensitive resource using <code>readPixels</code>,</li>
+ <li>use a security sensitive resource for depth testing or stencil testing,</li>
+ <li>share security sensitive resources with a context that cannot recognize them as security sensitive,</li>
+ <li>use a security sensitive resource to influence geometry, since this can affect the depth buffer.</li>
+ </ul>
+ </div>
+ <p>The error <code>INVALID_OPERATION</code> is generated in the following situations:</p>
+ <ul>
+ <li><code>drawArrays</code> or <code>drawElements</code> is called and a security sensitive texture is bound to a regular sampler.</li>
+ <li>
+ <p><code>drawArrays</code> or <code>drawElements</code> is called and:</p>
+ <ul>
+ <li>a security sensitive texture is bound to a secure sampler,</li>
+ <li>a color output variable <code>gl_FragColor</code> or <code>gl_FragData[i]</code> is dependent on the secure sampler,</li>
+ <li>
+ <p>the output variable writes to either:</p>
+ <ul>
+ <li>a regular texture,</li>
+ <li>a regular renderbuffer,</li>
+ <li>the default framebuffer with <code>securitySensitiveDrawingBuffer</code> set to false in the <code>WebGLContextAttributes</code> dictionary used to create the context.</li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+ <li>
+ <p><code>copyTexImage2D</code> or <code>copyTexSubImage2D</code> is called and:</p>
+ <ul>
+ <li>the default framebuffer is bound,</li>
+ <li><code>securitySensitiveDrawingBuffer</code> was set to true in the <code>WebGLContextAttributes</code> dictionary used to create the context.</li>
+ <li>a regular texture is bound as the destination.</li>
+ </ul>
+ </li>
+ <li>
+ <p><code>copyTexImage2D</code> or <code>copyTexSubImage2D</code> is called and:</p>
+ <ul>
+ <li>a security sensitive renderbuffer is selected as the source,</li>
+ <li>a regular texture is bound as the destination.</li>
+ </ul>
+ </li>
+ <li>
+ <p><code>readPixels</code> is called and:</p>
+ <ul>
+ <li>the default framebuffer is bound,</li>
+ <li><code>securitySensitiveDrawingBuffer</code> was set to true in the <code>WebGLContextAttributes</code> dictionary used to create the context.</li>
+ </ul>
+ </li>
+ <li><code>readPixels</code> is called and a security sensitive renderbuffer is selected as the source.</li>
+ <li>
+ <p><code>framebufferRenderbuffer</code> is called and:</p>
+ <ul>
+ <li><code>attachment</code> is <code>DEPTH_ATTACHMENT</code>, <code>STENCIL_ATTACHMENT</code>, or <code>DEPTH_STENCIL_ATTACHMENT</code>,</li>
+ <li><code>renderbuffer</code> is a security sensitive renderbuffer.</li>
+ </ul>
+ </li>
+ <li>
+ <p><code>acquireSharedResource</code> is called and:</p>
+ <ul>
+ <li><code>resource</code> is a security sensitive texture or a security sensitive renderbuffer,</li>
+ <li>the context acquiring the resource does not have this extension enabled.</li>
+ </ul>
+ </li>
+ </ul>
+ </error>
+ </errors>
+
+ <issues>
+ <ul>
+ <li>
+ <div>Q: Why not mark textures and renderbuffers as security sensitive automatically in the WebGL implementation instead of exposing <code>createSecuritySensitive*</code> to the API consumer?</div>
+ <div>A: This approach could make it difficult for API consumers to determine what operation caused a resource to become security sensitive because a related error could occur much later.</div>
+ </li>
+ </ul>
+ </issues>
+
+ <history>
+ <revision date="2013/09/13">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ </history>
+</draft>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_clip_cull_distance/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_clip_cull_distance/extension.xml
new file mode 100644
index 0000000000..5fc51d3796
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_clip_cull_distance/extension.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi:set sw=2 ts=4: -->
+<?xml-stylesheet href="../../extension.xsl" type="text/xsl"?>
+<proposal href="proposals/EXT_clip_cull_distance/">
+ <name>EXT_clip_cull_distance</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>XYZ</number>
+
+ <depends>
+ <api version="2.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="https://www.khronos.org/registry/gles/extensions/EXT/EXT_clip_cull_distance.txt"
+ name="EXT_clip_cull_distance">
+ </mirrors>
+
+ <features>
+ <feature>
+ Adds support for hardware clip planes and cull distances to OpenGL ES.
+ </feature>
+ <glsl extname="GL_EXT_clip_cull_distance">
+ <stage type="vertex"/>
+ <output name="gl_ClipDistance" type="highp float" suffix="[]"/>
+ <output name="gl_CullDistance" type="highp float" suffix="[]"/>
+ <stage type="fragment"/>
+ <input name="gl_ClipDistance" type="highp float" suffix="[]"/>
+ <input name="gl_CullDistance" type="highp float" suffix="[]"/>
+ </glsl>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+ [NoInterfaceObject]
+ interface EXT_clip_cull_distance {
+ const GLenum MAX_CLIP_DISTANCES_EXT = 0x0D32;
+ const GLenum MAX_CULL_DISTANCES_EXT = 0x82F9;
+ const GLenum MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT = 0x82FA;
+
+ const GLenum CLIP_DISTANCE0_EXT = 0x3000;
+ const GLenum CLIP_DISTANCE1_EXT = 0x3001;
+ const GLenum CLIP_DISTANCE2_EXT = 0x3002;
+ const GLenum CLIP_DISTANCE3_EXT = 0x3003;
+ const GLenum CLIP_DISTANCE4_EXT = 0x3004;
+ const GLenum CLIP_DISTANCE5_EXT = 0x3005;
+ const GLenum CLIP_DISTANCE6_EXT = 0x3006;
+ const GLenum CLIP_DISTANCE7_EXT = 0x3007;
+ };
+ </idl>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ #extension GL_EXT_clip_cull_distance : enable
+
+ // Vertex shader
+ out highp float gl_ClipDistance[2];
+ out highp float gl_CullDistance[2];
+
+ void main(){
+ // Compute the clip and cull distances for this vertex
+ gl_ClipDistance[0] = ...;
+ gl_CullDistance[0] = ...;
+ gl_ClipDistance[1] = ...;
+ gl_CullDistance[1] = ...;
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2016/08/22">
+ <change>Initial revision.</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_multi_draw_arrays/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_multi_draw_arrays/extension.xml
new file mode 100644
index 0000000000..b520e8d781
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/EXT_multi_draw_arrays/extension.xml
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<proposal href="proposals/EXT_multi_draw_arrays/">
+ <name>EXT_multi_draw_arrays</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Contributors to the EXT_multi_draw_arrays specification</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_multi_draw_arrays.txt"
+ name="EXT_multi_draw_arrays">
+ </mirrors>
+
+ <div class="nonnormative">
+ <p>This extension exposes the EXT_multi_draw_arrays functionality to WebGL.</p>
+
+ <p>CAD vendors rendering large models comprised of many individual parts face scalability issues issuing large numbers of draw calls from WebGL. This extension reduces draw call overhead by allowing better batching.</p>
+ </div>
+
+ <features>
+ <feature>The <code>multiDrawArraysEXT</code> and <code>multiDrawElementsEXT</code> entry points are added. These provide a counterpoint to instanced rendering and are more flexible for certain scenarios.</feature>
+
+ <feature>The <code>offset</code> arguments to <code>multiDrawArraysEXT</code> and <code>multiDrawElementsEXT</code> choose the starting offset into their respective typed arrays or sequences. This primarily avoids allocation of temporary typed array views.</feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface EXT_multi_draw_arrays {
+ void multiDrawArraysEXT(GLenum mode,
+ (Int32Array or sequence&lt;GLint&gt;) firstsList, GLuint firstsOffset,
+ (Int32Array or sequence&lt;GLsizei&gt;) countsList, GLuint countsOffset,
+ GLsizei drawcount);
+ void multiDrawElementsEXT(GLenum mode,
+ (Int32Array or sequence&lt;GLint&gt;) countsList, GLuint countsOffset,
+ GLenum type,
+ (Int32Array or sequence&lt;GLsizei&gt;) offsetsList, GLuint offsetsOffset,
+ GLsizei drawcount);
+};
+ </idl>
+
+ <security>
+ The multi-draw APIs are subject to all of the same rules regarding <a href="https://www.khronos.org/registry/webgl/specs/latest/1.0/#4.5">out-of-range array accesses</a> as the core WebGL APIs.
+ </security>
+
+ <ipstatus/>
+
+ <additions/>
+
+ <!-- Additions to the WebGL Specification -->
+
+ <errors/>
+
+ <newstate/>
+
+ <newimplstate/>
+
+ <!-- New Implementation-Dependent State -->
+
+ <samplecode xml:space="preserve">
+
+ <pre>
+var ext = gl.getExtension("EXT_multi_draw_arrays");
+{
+ // multiDrawArrays variant.
+ let firsts = new Int32Array(...);
+ let counts = new Int32Array(...);
+ ext.multiDrawArraysEXT(gl.TRIANGLES, firsts, 0, counts, 0, firsts.length);
+}
+
+{
+ // multiDrawElements variant.
+ // Assumes that the indices which have been previously uploaded to the
+ // ELEMENT_ARRAY_BUFFER are to be treated as UNSIGNED_SHORT.
+ let counts = new Int32Array(...);
+ let offsets = new Int32Array(...);
+ ext.multiDrawElementsEXT(gl.TRIANGLES, counts, 0, gl.UNSIGNED_SHORT, offsets, 0,
+ counts.length);
+}
+ </pre>
+ </samplecode>
+
+ <tests/>
+
+ <issues/>
+
+ <history>
+ <revision date="2018/09/25">
+ <change>Initial version.</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_blend_equation_advanced_coherent/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_blend_equation_advanced_coherent/extension.xml
new file mode 100644
index 0000000000..b08bb8f553
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_blend_equation_advanced_coherent/extension.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<proposal href="proposals/WEBGL_blend_equation_advanced_coherent/">
+ <name>WEBGL_blend_equation_advanced_coherent</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Ashley Gullen (ashley at scirra dot com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="https://www.opengl.org/registry/specs/KHR/blend_equation_advanced.txt"
+ name="KHR_blend_equation_advanced_coherent">
+ </mirrors>
+
+ <div class="nonnormative">
+ <p>This extension exposes the KHR_blend_equation_advanced_coherent functionality to WebGL.</p>
+
+ <p>CanvasRenderingContext2D provides a series of common blend functions with globalComposeOperation, such as "multiply" and "screen". KHR_blend_equation_advanced_coherent provides, with the exception of "xor", exactly the same list of blend functions for WebGL, as detailed below:</p>
+
+ <ul>
+ <li>"multiply": MULTIPLY_KHR</li>
+ <li>"screen": SCREEN_KHR</li>
+ <li>"overlay": OVERLAY_KHR</li>
+ <li>"darken": DARKEN_KHR</li>
+ <li>"lighten": LIGHTEN_KHR</li>
+ <li>"color-dodge": COLORDODGE_KHR</li>
+ <li>"color-burn": COLORBURN_KHR</li>
+ <li>"hard-light": HARDLIGHT_KHR</li>
+ <li>"soft-light": SOFTLIGHT_KHR</li>
+ <li>"difference": DIFFERENCE_KHR</li>
+ <li>"exclusion": EXCLUSION_KHR</li>
+ <li>"hue": HSL_HUE_KHR</li>
+ <li>"saturation": HSL_SATURATION_KHR</li>
+ <li>"color": HSL_COLOR_KHR</li>
+ <li>"luminosity": HSL_LUMINOSITY_KHR</li>
+ </ul>
+
+ <p>These effects are useful for high-quality artistic blends. They can be implemented using shaders and rendering via an intermediate texture. However this has a high performance overhead both in draw calls and GPU bandwidth. Advanced blend modes allow a much simpler, high-performance way of implementing these blends. Using shaders rendering to an intermediate texture can be used as a fallback if this extension is not supported.</p>
+
+ <p>Note only the coherent variant of this extension is exposed in order to eliminate the possibility of undefined behavior in KHR_blend_equation_advanced. This also simplifies the extension and removes the need to insert blend barriers during rendering.</p>
+ </div>
+
+ <features>
+ <feature>The <code>blendEquation</code> entry point is extended to accept the enums in the IDL below</feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_blend_equation_advanced_coherent {
+ const GLenum MULTIPLY = 0x9294;
+ const GLenum SCREEN = 0x9295;
+ const GLenum OVERLAY = 0x9296;
+ const GLenum DARKEN = 0x9297;
+ const GLenum LIGHTEN = 0x9298;
+ const GLenum COLORDODGE = 0x9299;
+ const GLenum COLORBURN = 0x929A;
+ const GLenum HARDLIGHT = 0x929B;
+ const GLenum SOFTLIGHT = 0x929C;
+ const GLenum DIFFERENCE = 0x929E;
+ const GLenum EXCLUSION = 0x92A0;
+ const GLenum HSL_HUE = 0x92AD;
+ const GLenum HSL_SATURATION = 0x92AE;
+ const GLenum HSL_COLOR = 0x92AF;
+ const GLenum HSL_LUMINOSITY = 0x92B0;
+};
+ </idl>
+
+ <security/>
+
+ <ipstatus/>
+
+ <additions/>
+
+ <!-- Additions to the WebGL Specification -->
+
+ <errors/>
+
+ <newstate/>
+
+ <newimplstate/>
+
+ <!-- New Implementation-Dependent State -->
+
+ <samplecode xml:space="preserve">
+
+ <pre>
+var ext = gl.getExtension("WEBGL_blend_equation_advanced_coherent");
+gl.blendEquation(ext.MULTIPLY);
+gl.getParameter(gl.BLEND_EQUATION) == ext.MULTIPLY;
+ </pre>
+ </samplecode>
+
+ <tests/>
+
+ <issues/>
+
+ <history>
+
+ <revision date="2018/09/13">
+ <change>Forked from WEBGL_blend_equation_advanced to specify only the coherent variant</change>
+ </revision>
+
+ <revision date="2018/08/23">
+ <change>Converted to extension XML format</change>
+ </revision>
+
+ <revision date="2018/08/21">
+ <change>Revised description</change>
+ </revision>
+
+ <revision date="2015/05/26">
+ <change>Original draft as a TXT file</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_debug/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_debug/extension.xml
new file mode 100644
index 0000000000..3daa9e0c70
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_debug/extension.xml
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<proposal href="proposals/WEBGL_debug/">
+ <name>WEBGL_debug</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Emmanuel Gil Peyrot, Collabora Ltd.</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview id="overview">
+ <p>
+ This extension allows the GL to notify applications when various events
+ occur that may be useful during application development, debugging and
+ profiling.
+ </p>
+
+ <mirrors href="https://www.opengl.org/registry/specs/KHR/debug.txt"
+ name="KHR_debug">
+ <addendum>
+ References to debug contexts are deleted.
+ </addendum>
+
+ <addendum>
+ References to the debug message log and callback are deleted, replaced
+ with DOM events.
+ </addendum>
+
+ <addendum>
+ The <code>ObjectPtrLabel</code> and <code>GetObjectPtrLabel</code>
+ functions are replaced with <code>ObjectLabel</code> and
+ <code>GetObjectLabel</code>.
+ </addendum>
+
+ <addendum>
+ The <code>count</code> and <code>ids</code> arguments of
+ <code>DebugMessageControl</code> are replaced with a
+ <code>sequence&lt;GLuint&gt; ids</code> argument.
+ </addendum>
+
+ <addendum>
+ The <code>length</code> and <code>buf</code> arguments of
+ <code>DebugMessageInsert</code> and <code>PushDebugGroup</code> are
+ replaced with a <code>DOMString message</code> argument.
+ </addendum>
+
+ <addendum>
+ The <code>identifier</code> and <code>name</code> arguments of
+ <code>ObjectLabel</code> and <code>GetObjectLabel</code> are replaced
+ with a <code>WebGLObject object</code> argument.
+ </addendum>
+
+ <addendum>
+ The <code>length</code> and <code>label</code> arguments of
+ <code>ObjectLabel</code> are replaced with a <code>DOMString
+ label</code> argument.
+ </addendum>
+
+ <addendum>
+ The <code>bufSize</code>, <code>length</code> and <code>label</code>
+ arguments of <code>GetObjectLabel</code> are replaced with a
+ <code>DOMString</code> return type.
+ </addendum>
+
+ <addendum>
+ As per the usual WebGL binding rules, functions don’t keep the KHR
+ suffix they have in the GLES version, but tokens do.
+ </addendum>
+ </mirrors>
+
+ <features>
+ <feature>
+ The <code>WEBGL_debug</code> extension object is a DOM
+ <code>EventTarget</code>, obeying the rules of the <a
+ href="http://www.w3.org/TR/DOM-Level-3-Events/">DOM Level 3 Events</a>,
+ with a new <code>WebGLDebugMessage</code> event that gets fired
+ whenever the driver, browser or application emits a debug message.
+ </feature>
+
+ <feature>
+ <code>debugMessageInsertKHR</code> is exposed to allow the application
+ to insert debug messages into the WebGL stream.
+ </feature>
+
+ <feature>
+ <code>objectLabelKHR</code> and <code>getObjectLabelKHR</code> are
+ exposed, to assign a label to a <code>WebGLObject</code> and retrieve
+ it.
+ </feature>
+
+ <feature>
+ <code>pushDebugGroupKHR</code> and <code>popDebugGroupKHR</code> make
+ it possible to group a list of WebGL calls together.
+ </feature>
+
+ <feature>
+ <code>debugMessageControlKHR</code> allows the application to enable
+ and disable the debug messages which emit a
+ <code>WebGLDebugMessage</code> event. This state is part of the debug
+ group they are part of, and gets poped on
+ <code>popDebugGroupKHR</code>.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve"><![CDATA[
+[NoInterfaceObject]
+interface WEBGL_debug : EventTarget {
+ const GLenum MAX_DEBUG_MESSAGE_LENGTH_KHR = 0x9143;
+ const GLenum MAX_DEBUG_GROUP_STACK_DEPTH_KHR = 0x826C;
+ const GLenum DEBUG_GROUP_STACK_DEPTH_KHR = 0x826D;
+ const GLenum MAX_LABEL_LENGTH_KHR = 0x82E8;
+
+ const GLenum DEBUG_SOURCE_API_KHR = 0x8246;
+ const GLenum DEBUG_SOURCE_WINDOW_SYSTEM_KHR = 0x8247;
+ const GLenum DEBUG_SOURCE_SHADER_COMPILER_KHR = 0x8248;
+ const GLenum DEBUG_SOURCE_THIRD_PARTY_KHR = 0x8249;
+ const GLenum DEBUG_SOURCE_APPLICATION_KHR = 0x824A;
+ const GLenum DEBUG_SOURCE_OTHER_KHR = 0x824B;
+
+ const GLenum DEBUG_TYPE_ERROR_KHR = 0x824C;
+ const GLenum DEBUG_TYPE_DEPRECATED_BEHAVIOR_KHR = 0x824D;
+ const GLenum DEBUG_TYPE_UNDEFINED_BEHAVIOR_KHR = 0x824E;
+ const GLenum DEBUG_TYPE_PORTABILITY_KHR = 0x824F;
+ const GLenum DEBUG_TYPE_PERFORMANCE_KHR = 0x8250;
+ const GLenum DEBUG_TYPE_OTHER_KHR = 0x8251;
+ const GLenum DEBUG_TYPE_MARKER_KHR = 0x8268;
+
+ const GLenum DEBUG_TYPE_PUSH_GROUP_KHR = 0x8269;
+ const GLenum DEBUG_TYPE_POP_GROUP_KHR = 0x826A;
+
+ const GLenum DEBUG_SEVERITY_HIGH_KHR = 0x9146;
+ const GLenum DEBUG_SEVERITY_MEDIUM_KHR = 0x9147;
+ const GLenum DEBUG_SEVERITY_LOW_KHR = 0x9148;
+ const GLenum DEBUG_SEVERITY_NOTIFICATION_KHR = 0x826B;
+
+ const GLenum STACK_UNDERFLOW_KHR = 0x0504;
+ const GLenum STACK_OVERFLOW_KHR = 0x0503;
+
+ void debugMessageControlKHR(GLenum source, GLenum type, GLenum severity, sequence<GLuint> ids, boolean enabled);
+ void debugMessageInsertKHR(GLenum source, GLenum type, GLuint id, GLenum severity, DOMString buf);
+
+ void pushDebugGroupKHR(GLenum source, GLuint id, DOMString message);
+ void popDebugGroupKHR();
+
+ void objectLabelKHR(WebGLObject? object, DOMString label);
+ DOMString getObjectLabelKHR(WebGLObject? object);
+}; // interface WEBGL_debug
+
+[NoInterfaceObject]
+interface WebGLDebugMessage : Event {
+ readonly attribute GLenum source;
+ readonly attribute GLenum type;
+ readonly attribute GLuint id;
+ readonly attribute GLenum severity;
+ readonly attribute DOMString message;
+}; // interface WebGLDebugMessage
+ ]]></idl>
+
+ <newfun>
+ <p>On <code>WEBGL_debug</code>:</p>
+
+ <function name="debugMessageControlKHR" type="void">
+ <param name="source" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="severity" type="GLenum"/>
+ <param name="ids" type="sequence&lt;GLuint&gt;"/>
+ <param name="enabled" type="boolean"/>
+ Enables or disables the reporting of <code>WebGLDebugMessage</code>
+ events for the specified messages.
+ </function>
+
+ <function name="debugMessageInsertKHR" type="void">
+ <param name="source" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="id" type="GLuint"/>
+ <param name="severity" type="GLenum"/>
+ <param name="message" type="DOMString"/>
+ Inserts a custom message into the debug log.
+ </function>
+
+ <function name="pushDebugGroupKHR" type="void">
+ <param name="source" type="GLenum"/>
+ <param name="id" type="GLuint"/>
+ <param name="message" type="DOMString"/>
+ Pushes a debug group on the stack.
+ </function>
+
+ <function name="popDebugGroupKHR" type="void">
+ Closes a group opened with <code>pushDebugGroupKHR</code>.
+ </function>
+
+ <function name="objectLabelKHR" type="void">
+ <param name="object" type="WebGLObject?"/>
+ <param name="label" type="DOMString"/>
+ Assigns a label to a <code>WebGLObject</code>.
+ </function>
+
+ <function name="getObjectLabelKHR" type="DOMString">
+ <param name="object" type="WebGLObject?"/>
+ Retrieves the label associated with a <code>WebGLObject</code>.
+ </function>
+
+ <function name="addEventListener" type="void">
+ <param name="type" type="DOMString"/>
+ <param name="listener" type="EventListener"/>
+ Register an event handler of a specific event type on the EventTarget.
+ </function>
+
+ <function name="removeEventListener" type="void">
+ <param name="type" type="DOMString"/>
+ <param name="listener" type="EventListener"/>
+ Removes an event listener from the EventTarget.
+ </function>
+
+ <function name="dispatchEvent" type="boolean">
+ <param name="event" type="Event"/>
+ Dispatch an event to this EventTarget.
+ </function>
+
+ </newfun>
+
+ <samplecode><div class="example">
+ Common initialization of the extension, with an example of debug message
+ reporting.
+
+ <pre xml:space="preserve"><![CDATA[
+function init(gl) {
+ ...
+ var ext = gl.getExtension('WEBGL_debug');
+
+ ext.addEventListener('message', function(evt) {
+ console.log(evt.source, evt.type, evt.id, evt.severity, evt.message);
+ });
+ ...
+}]]></pre></div></samplecode>
+
+ <samplecode><div class="example">
+ Skip a section of the code.
+
+ <pre xml:space="preserve"><![CDATA[
+function draw(gl, ext) {
+ ...
+
+ // Setup of the default active debug group: Filter everything in
+ ext.debugMessageControlKHR(gl.DONT_CARE, gl.DONT_CARE, gl.DONT_CARE, [], true);
+
+ // Generate a debug marker debug output message
+ ext.debugMessageInsertKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR,
+ ext.DEBUG_TYPE_MARKER_KHR, 100,
+ ext.DEBUG_SEVERITY_NOTIFICATION_KHR,
+ "Message 1");
+
+ // Push debug group 1
+ ext.pushDebugGroupKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR,
+ 1,
+ "Message 2");
+
+ // Setup of the debug group 1: Filter everything out
+ ext.debugMessageControlKHR(gl.DONT_CARE, gl.DONT_CARE, gl.DONT_CARE, [], false);
+
+ // This message won't appear in the debug output log of
+ ext.debugMessageInsertKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR,
+ ext.DEBUG_TYPE_MARKER_KHR, 100,
+ ext.DEBUG_SEVERITY_NOTIFICATION_KHR,
+ "Message 3");
+
+ // Pop debug group 1, restore the volume control of the default debug group.
+ ext.popDebugGroupKHR();
+
+ // Generate a debug marker debug output message
+ ext.debugMessageInsertKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR,
+ ext.DEBUG_TYPE_MARKER_KHR, 100,
+ ext.DEBUG_SEVERITY_NOTIFICATION_KHR,
+ "Message 5");
+
+ ...
+
+ // Expected debug output in the JS console:
+ // Message 1
+ // Message 2
+ // Message 2
+ // Message 5
+}]]></pre></div></samplecode>
+
+ <samplecode><div class="example">
+ Only output a subsection of the code and disable some messages for the
+ entire application.
+
+ <pre xml:space="preserve"><![CDATA[
+function draw(gl, ext) {
+ ...
+
+ // Setup the control of the debug output for the default debug group
+ ext.debugMessageControlKHR(
+ gl.DONT_CARE, gl.DONT_CARE, gl.DONT_CARE, [], false);
+ ext.debugMessageControlKHR(
+ ext.DEBUG_SOURCE_THIRD_PARTY_KHR, gl.DONT_CARE, gl.DONT_CARE, [], false);
+ var messages = [1234, 2345, 3456, 4567];
+ ext.debugMessageControlKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR, gl.DEBUG_TYPE_OTHER, gl.DONT_CARE,
+ messages, false);
+ ext.debugMessageControlKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR, ext.DEBUG_TYPE_PORTABILITY_KHR, gl.DONT_CARE,
+ messages, false);
+
+ // Push debug group 1
+ // Inherit the default debug group debug output volume control
+ // Filtered out by ext.debugMessageControlKHR
+ ext.pushDebugGroupKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR,
+ 1,
+ "Message 1");
+
+ // In this section of the code, we are interested in performances.
+ ext.debugMessageControlKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR, ext.DEBUG_TYPE_PERFORMANCE_KHR, gl.DONT_CARE, [], true);
+ // But we already identify that some messages are not really useful for us.
+ ext.debugMessageControlKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR, ext.DEBUG_TYPE_OTHER_KHR, gl.DONT_CARE,
+ [5678, 6789], false);
+
+ ext.debugMessageInsertKHR(
+ ext.DEBUG_SOURCE_APPLICATION_KHR,
+ ext.DEBUG_TYPE_PERFORMANCE_KHR, 1357,
+ ext.DEBUG_SEVERITY_MEDIUM_KHR,
+ "Message 2");
+ ext.debugMessageInsertKHR(
+ ext.DEBUG_SOURCE_THIRD_PARTY_KHR, // We still filter out these messages.
+ ext.DEBUG_TYPE_OTHER_KHR, 3579,
+ ext.DEBUG_SEVERITY_MEDIUM_KHR,
+ "Message 3");
+
+ ext.popDebugGroupKHR();
+
+ ...
+
+ // Expected debug output in the JS console:
+ // Message 2
+}]]></pre></div></samplecode>
+
+ <history>
+ <revision date="2015/09/18">
+ <change>Initial revision.</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_dynamic_texture/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_dynamic_texture/extension.xml
new file mode 100644
index 0000000000..c300876096
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_dynamic_texture/extension.xml
@@ -0,0 +1,1324 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi:set sw=2 ts=4: -->
+<?xml-stylesheet href="../../extension.xsl" type="text/xsl"?>
+<proposal href="proposals/WEBGL_dynamic_texture/">
+ <name>WEBGL_dynamic_texture</name>
+
+ <contact><a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Mark Callow, HI Corporation</contributor>
+
+ <contributor>Acorn Pooley, while at NVIDIA</contributor>
+
+ <contributor>Ken Russell, Google</contributor>
+
+ <contributor>David Sheets, Ashima Arts</contributor>
+
+ <contributor>William Hennebois, STMicroelectronics</contributor>
+
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0.2"/>
+ </depends>
+
+ <overview id="overview">
+ <p>A dynamic texture is a texture whose image changes frequently. The
+ source of the stream of images may be a producer outside the control of
+ the WebGL application. The classic example is using a playing video to
+ texture geometry. Texturing with video is currently achieved by using the
+ <code>TEXTURE2D</code> target and passing an <code>HTMLVideoElement</code>
+ to <code>texImage2D</code>. It is difficult, if not impossible to
+ implement video texturing with zero-copy efficiency via this API and much
+ of the behavior is underspecified.</p>
+
+ <p>This extension provides a mechanism for streaming image frames from an
+ <code>HTMLVideoElement</code>, <code>HTMLCanvasElement</code> or
+ <code>HTMLImageElement</code> (having multiple frames such those created
+ from animated GIF, APNG and MNG files) into a WebGL texture. This is done
+ via a new texture target, <code>TEXTURE_EXTERNAL_OES</code> which can only
+ be specified as being the consumer of an image stream from a new
+ <code>WDTStream</code> object which provides commands for connecting to a
+ producer element.</p>
+
+ <p>There is no support for most of the functions that manipulate other
+ texture targets (e.g. you cannot use <code>*[Tt]ex*Image*()</code>
+ functions with <code>TEXTURE_EXTERNAL_OES</code>). Also,
+ <code>TEXTURE_EXTERNAL_OES</code> targets never have more than a single
+ level of detail. These restrictions enable dynamic texturing with maximum
+ efficiency. They remove the need for a copy of the image data manipulable
+ via the WebGL API and allow sources which have internal formats not
+ otherwise supported by WebGL, such as planar or interleaved YUV data, to
+ be WebGL texture target siblings.</p>
+
+ <p>The extension extends GLSL ES with a new
+ <code>samplerExternalOES</code> type and matching sampling functions that
+ provide a place for an implementation to inject code for sampling non-RGB
+ data when necessary without degrading performance for other texture
+ targets. Sampling a <code>TEXTURE_EXTERNAL_OES</code> via a sampler of
+ type <code>samplerExternalOES</code> always returns RGBA data. This allows
+ the implementation to decide the most efficient format to use whether it
+ be RGB or YUV data. If the underlying format was exposed, the application
+ would have to query the format in use and provide shaders to handle both
+ cases.</p>
+
+ <p><code>WDTStream</code> provides a command for <em>latching</em> an
+ image frame into the consuming texture as its contents. This is equivalent
+ to copying the image into the texture but, due to the restrictions
+ outlined above a copy is not necessary. Most implementations will be able
+ to avoid one so this can be much faster than using
+ <code>texImage2D</code>. Latching can and should be implemented in a way
+ that allows the producer to run independently of 3D rendering.</p>
+
+ <p><strong>Terminology note:</strong> throughout this specification
+ <em>opaque black</em> refers to the RGBA value (0,0,0,1).</p>
+
+ <mirrors href="https://www.khronos.org/registry/gles/extensions/NV/NV_EGL_stream_consumer_external.txt"
+ name="NV_EGL_stream_consumer_external">
+ <!-- list the deviations here if there are any -->
+
+ <addendum>
+ <p>An <code>HTMLVideoElement</code>, <code>HTMLCanvasElement</code> or
+ <code>HTMLImageElement</code> is the producer of the stream of images
+ being consumed by the dynamic texture rather than the unspecified
+ external producer referred to in the extension.</p>
+ </addendum>
+
+ <addendum>
+ <p>A <code>WDTStream</code> is the deliverer of the stream of images
+ being consumed by the dynamic texture rather an
+ <code>EGLStream</code>.</p>
+ </addendum>
+
+ <addendum>
+ <p>References to <code>EGLImage</code> and associated state are
+ deleted.</p>
+ </addendum>
+
+ <addendum>
+ <p><code>WDTStream.connectSource</code> is used to connect a texture
+ to the image stream from an HTML element instead of the command
+ <code>eglStreamConsumerGLTextureNV</code> or its equivalent
+ <code>eglStreamConsumerGLTextureExternalKHR</code> referenced by the
+ extension.</p>
+ </addendum>
+
+ <addendum>
+ <p><code>WDTStream.acquireImage</code> and
+ <code>WDTStream.releaseImage</code> are used to latch and unlatch
+ image frames instead of the commands
+ <code>eglStreamConsumerAcquireNV</code> or its equivalent
+ <code>eglStreamConsumerAcquireKHR</code> and
+ <code>eglStreamConsumerReleaseNV</code> or its equivalent
+ <code>eglStreamConsumerReleaseKHR</code> referenced by the
+ extension.</p>
+ </addendum>
+
+ <p>For ease of reading, this specification briefly describes the new
+ functions and enumerants of <a
+ href="https://www.khronos.org/registry/gles/extensions/NV/NV_EGL_stream_consumer_external.txt">NV_EGL_stream_consumer_external</a>.
+ Consult that extension for detailed documentation of their meaning and
+ behavior. Changes to the language of that extension are given <a
+ href="#differences">later</a> in this specification.</p>
+ </mirrors>
+
+ <features>
+ <feature>
+ <p>The <code>createStream</code> function is available. This command
+ is used for creating <code>WDTStream</code> objects for streaming
+ external data to texture objects. <code>WDTStream </code>objects have
+ a number of functions and attributes, the most important of which are
+ listed below.</p>
+ </feature>
+
+ <feature>
+ <p>The functions <code>ustnow</code>,
+ <code>getLastDrawingBufferPresentTime</code> and
+ <code>setDrawingBufferPresentTime</code> are available. These commands
+ are used for accurate timing and specifying when the drawing buffer
+ should next be presented.</p>
+ </feature>
+
+ <feature>
+ <p>The functions <code>WDTStream.connectSource </code> and
+ <code>WDTStream.disconnect()</code> are available for binding and
+ unbinding the stream to <code>HTML{Canvas,Image,Video}Elements</code>
+ as is the <code>WDTStream.getSource</code> function for querying the
+ current stream source.</p>
+ </feature>
+
+ <feature>
+ <p>The functions <code>WDTStream.acquireImage</code> and
+ <code>WDTStream.releaseImage</code> are available. These commands are
+ used before 3D rendering to latch an image that will not change during
+ sampling and after to unlatch the image.</p>
+ </feature>
+
+ <glsl extname="WEBGL_dynamic_texture">
+ <alias extname="GL_NV_EGL_stream_consumer_external"/>
+
+ <alias extname="GL_OES_EGL_image_external"/>
+
+ <stage type="fragment"/>
+
+ <stage type="vertex"/>
+
+ <type name="samplerExternalOES"/>
+
+ <function name="texture2D" type="vec4">
+ <param name="sampler" type="samplerExternalOES"/>
+
+ <param name="coord" type="vec2"/>
+ </function>
+
+ <function name="texture2DProj" type="vec4">
+ <param name="sampler" type="samplerExternalOES"/>
+
+ <param name="coord" type="vec3"/>
+ </function>
+
+ <function name="texture2DProj" type="vec4">
+ <param name="sampler" type="samplerExternalOES"/>
+
+ <param name="coord" type="vec4"/>
+ </function>
+ </glsl>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_dynamic_texture {
+ typedef double WDTNanoTime;
+
+ const GLenum TEXTURE_EXTERNAL_OES = 0x8D65;
+ const GLenum SAMPLER_EXTERNAL_OES = 0x8D66;
+ const GLenum TEXTURE_BINDING_EXTERNAL_OES = 0x8D67;
+ const GLenum REQUIRED_TEXTURE_IMAGE_UNITS_OES = 0x8D68;
+
+ WDTStream? createStream();
+
+ WDTNanoTime getLastDrawingBufferPresentTime();
+ void setDrawingBufferPresentTime(WDTNanoTime pt);
+ WDTNanoTime ustnow();
+}; // interface WEBGL_dynamic_texture
+</idl>
+
+ <!-- new functions -->
+
+ <newfun>
+ <p>On <code>WEBGL_dynamic_texture</code>:</p>
+
+ <function name="createStream" type="WDTStream">Creates and returns a
+ <code>WDTStream</code> object whose consumer is the
+ <code>WebGLTexture</code> bound to the <code>TEXTURE_EXTERNAL_OES</code>
+ target of the active texture unit at the time of the call.</function>
+
+ <function name="getMinFrameDuration" type="WDTNanoTime">Returns the
+ duration of the shortest frame of the currently connected dynamic source
+ when <code>playbackRate</code> of the associated
+ <code>MediaController</code> is 1.0.</function>
+
+ <!--XXX Need to add counters so app knows which "frame" the time is for.-->
+
+ <function name="getLastDBPresentTime" type="WDTNanoTime">Returns the UST
+ the last time the DrawingBuffer was presented to the screen, i.e., after
+ the last return of the script to the browser.</function>
+
+ <function name="setDBPresentationTime" type="void"><param
+ name="presentTime" type="WDTNanoTime"/>Sets the UST at which the drawing
+ buffer should be presented after the script returns to the
+ browser.</function>
+
+ <function name="ustnow" type="WDTNanoTime">Returns the current
+ UST.</function>
+ </newfun>
+
+ <newfun>
+ <p>On <code>WDTStream</code>:</p>
+
+ <function name="WDTStream.connectSource" type="void"><param name="source"
+ type="StreamSource"/>Connects the <code>StreamSource</code> specified by
+ <em>source</em> as the producer for the stream. <code>StreamSource</code>
+ can be an <code>HTMLCanvasElement</code>, <code>HTMLImageElement</code> or
+ <code>HTMLVideoElement</code>.</function>
+
+ <function name="WDTStream.getSource" type="StreamSource?">Returns the
+ <code>HTML{Canvas,Image,Video}Element</code> that is connected to the
+ WDTStream as the producer of images.</function>
+
+ <function name="WDTStream.acquireImage" type="WDTStreamFrameInfo">Latches
+ an image frame. Sampling the <code>WebGLTexture</code>, that is the
+ <code>WDTStream</code>'s <em>consumer</em>, will return values from the
+ latched image. The image data is guaranteed not to change as long as the
+ image is latched. <code>WDTStream</code> returns <code>true</code> when an
+ image is successfully latched, <code>false</code> otherwise.</function>
+
+ <function name="WDTStream.releaseImage" type="void">Releases the latched
+ image. Subsequent samping of the <code>WebGLTexture</code>, that was bound
+ to the <code>TEXTURE_EXTERNAL_OES</code> target of the active texture unit
+ when the WDTStream was created, will return opaque black.</function>
+ </newfun>
+
+ <!-- new tokens -->
+
+ <newtok>
+ <p>The meaning and use of these tokens is exactly as described in <a
+ href="https://www.khronos.org/registry/gles/extensions/NV/NV_EGL_stream_consumer_external.txt">NV_EGL_stream_consumer_external</a>.</p>
+
+ <function name="bindTexture" type="void"><param name="target"
+ type="GLenum"/><param name="texture"
+ type="WebGLTexture?"/><code>TEXTURE_EXTERNAL_OES</code> is accepted as a
+ target by the <code>target</code> parameter of
+ <code>bindTexture()</code></function>
+
+ <function name="getActiveUniform" type="WebGLActiveInfo?"><param
+ name="program" type="WebGLProgram?"/><param name="index"
+ type="GLuint"/><code>SAMPLER_EXTERNAL_OES</code> can be returned in the
+ <code>type</code> field of the <code>WebGLActiveInfo</code> returned by
+ <code>getActiveUniform()</code></function>
+
+ <function name="getParameter" type="any"><param name="pname"
+ type="GLenum"/><code>TEXTURE_BINDING_EXTERNAL_OES</code> is accepted by
+ the <code>pname</code> parameter of
+ <code>getParameter()</code>.</function>
+
+ <function name="getTexParameter*" type="any"><param name="target"
+ type="GLenum"/><param name="pname"
+ type="GLenum"/><code>REQUIRED_TEXTURE_IMAGE_UNITS_OES</code> is accepted
+ as the <code>pname</code> parameter of
+ <code>GetTexParameter*()</code></function>
+ </newtok>
+
+ <!-- Refer to the <http://www.opengl.org/registry/doc/template.txt> OpenGL
+ extension template for a description of these sections. These sections
+ should be eliminated for WebGL extensions simply mirroring OpenGL or
+ OpenGL ES extensions.
+ -->
+
+ <!-- these take XHTML markup as contents -->
+
+ <security/>
+
+ <ipstatus>No known IP claims.</ipstatus>
+
+ <newtypes>
+ <typedef name="WDTNanoTime">
+ <type>double</type>
+
+ <p>This type is used for nanosecond time stamps and time periods.</p>
+ </typedef>
+
+ <interface name="WDTStreamFrameInfo" noobject="true">
+ <member>double frameTime;</member>
+
+ <member>WDTNanoTime presentTime</member>
+
+ <p>This interface is used to obtain information about the latched
+ frame.</p>
+ </interface>
+
+ <interface name="WDTStream" noobject="true">
+ <member>...</member>
+
+ <p>This interface is used to manage the image stream between the
+ producer and consumer.</p>
+ </interface>
+ </newtypes>
+
+ <additions>
+ <!-- Additions to Chapters of the WebGL Specification-->
+
+ <p>In section 4.3 <cite>Supported GLSL Constructs</cite>, replace the
+ paragraph beginning <cite>A WebGL implementation must ...</cite> with the
+ following paragraph:<blockquote>A WebGL implementation must only accept
+ shaders which conform to The OpenGL ES Shading Language, Version 1.00 <a
+ href="https://www.khronos.org/registry/webgl/specs/1.0.2/#refsGLES20GLSL">[GLES20GLSL]</a>,
+ as extended by <a
+ href="https://www.khronos.org/registry/gles/extensions/NV/NV_EGL_stream_consumer_external.txt">NV_EGL_stream_consumer_external</a>,
+ and which do not exceed the minimum functionality mandated in Sections 4
+ and 5 of Appendix A. In particular, a shader referencing state variables
+ or commands that are available in other versions of GLSL (such as that
+ found in versions of OpenGL for the desktop), must not be allowed to
+ load.</blockquote></p>
+
+ <p>In section 5.14 <cite>The WebGL Context</cite> , add the following to
+ the WebGLRenderingContext interface. Note that until such time as this
+ extension enters core WebGL the tokens and commands mentioned below will
+ be located on the WebGL_dynamic_texture extension interface shown
+ above.<li>In the list following <code>/* GetPName */</code>:<pre
+ class="idl" xml:space="preserve">TEXTURE_BINDING_EXTERNAL = 0x8D67;</pre></li><li>In
+ the list following <code>/* TextureParameterName */</code>:<pre
+ class="idl" xml:space="preserve">REQUIRED_TEXTURE_IMAGE_UNITS = 0x8D68;</pre></li><li>In
+ the list following <code>/* TextureTarget */</code>:<pre class="idl"
+ xml:space="preserve">TEXTURE_EXTERNAL = 0x8D65;</pre></li><li>In the list
+ following <code>/* Uniform Types */</code>:<pre class="idl"
+ xml:space="preserve">SAMPLER_EXTERNAL = 0x8D66;</pre></li><li>In the
+ alphabetical list of commands add the following :<pre class="idl"
+ xml:space="preserve">WDTStream? createStream();
+WDTNanoTime getLastDrawingBufferPresentTime();
+void setDrawingBufferPresentationTime(WDTNanoTime pt);
+WDTNanoTime ustnow();</pre></li></p>
+
+ <p>In section 5.14.3 <cite>Setting and getting state</cite>, add the
+ following to the table under <code>getParameter</code>.</p>
+
+ <dl class="methods">
+ <dt class="idl-code">
+ <dd>
+ <table>
+ <tr>
+ <td>TEXTURE_BINDING_EXTERNAL</td>
+
+ <td>int</td>
+ </tr>
+ </table>
+ </dd>
+ </dt>
+ </dl>
+
+ <p/>
+
+ <p>In section 5.14.8<cite>Texture objects</cite>, add the following to the
+ table under <code>getTexParameter</code>.</p>
+
+ <dl class="methods">
+ <dt class="idl-code">
+ <dd>
+ <table>
+ <tr>
+ <td>REQUIRED_TEXTURE_IMAGE_UNITS</td>
+
+ <td>int</td>
+ </tr>
+ </table>
+ </dd>
+ </dt>
+ </dl>
+
+ <p/>
+
+ <p>Add a new section 5.14.8.1 External textures.</p>
+
+ <blockquote>
+ <h3>5.14.8.1 External textures</h3>
+
+ <p>External textures are texture objects which receive image data from
+ outside of the GL. They enable texturing with rapidly changing image
+ data, e.g, a video, at low overhead and are used in conjunction with <a
+ href="#wdtstream">
+ <code>WDTStream</code>
+ </a> objects to create <em>dynamic textures</em>. See <a
+ href="#dynamic-textures">Dynamic Textures</a> for more information. An
+ external texture object is created by binding an unused
+ <code>WebGLTexture</code> to the target
+ <code>TEXTURE_EXTERNAL_OES</code>. Note that only unused WebGLTextures
+ or those previously used as external textures can be bound to
+ <code>TEXTURE_EXTERNAL_OES</code>. Binding a <code>WebGLTexture</code>
+ previously used with a different target or binding a WebGLTexture
+ previously used with TEXTURE_EXTERNAL_OES to a different target
+ generates a <code>GL_INVALID_OPERATION</code> error as documented in <a
+ href="https://www.khronos.org/registry/gles/extensions/NV/NV_EGL_stream_consumer_external.txt">GL_NV_EGL_stream_consumer_external.txt</a>.</p>
+ </blockquote>
+
+ <p>In section 5.14.10 <cite>Uniforms and attributes</cite>, add the
+ following to the table under <code>getUniform</code>.</p>
+
+ <dl class="methods">
+ <dt class="idl-code">
+ <dd>
+ <table>
+ <tr>
+ <td>samplerExternal</td>
+
+ <td>long</td>
+ </tr>
+ </table>
+ </dd>
+ </dt>
+ </dl>
+
+ <p/>
+
+ <p>Add a new section 5.16 Dynamic Textures</p>
+
+ <blockquote>
+ <h3 id="dynamic-textures">5.16 Dynamic Textures</h3>
+
+ <p>Dynamic textures are texture objects that display a stream of images
+ coming from a <em>producer</em> outside the WebGL application, the
+ classic example ibeing using a playing video to texture geometry from. A
+ <code>WDTStream</code> object mediates between the producer and the
+ <em>consumer</em>, the texture consuming the images.</p>
+
+ <p>The command<pre class="idl" xml:space="preserve">WDTStream? createStream();</pre>creates
+ a <a href="#wdtstream">WGTStream</a> object whose consumer is the
+ texture object currently bound to the <code>TEXTURE_EXTERNAL_OES</code>
+ target in the active texture unit. The initial <code>state</code> of the
+ newly created stream will be <code>STREAM_CONNECTING</code>. If the
+ texture object is already the consumer of a stream, createStream
+ generates an INVALID_OPERATION error and returns null. When a texture
+ object that is the consumer of a stream is deleted, the stream is also
+ deleted.</p>
+
+ <p>In order to maintain synchronization with other tracks of an
+ HTMLVideoElement's media group, most notably audio, the application must
+ be able to measure how long it takes to draw the scene containing the
+ dynamic texture and how long it takes the browser to compose and present
+ the canvas.</p>
+
+ <p>The command <pre class="idl" xml:space="preserve">WDTNanoTime ustnow();</pre>
+ returns the <em>unadjusted system time</em>, a monotonically increasing
+ clock, in units of nanoseconds. The zero time of this clock is not
+ important. It could start at system boot, browser start or navigation
+ start.</p>
+
+ <p>The command <pre class="idl" xml:space="preserve">WDTNanoTime getLastDrawingBufferPresentTime();</pre>
+ returns the UST the last time the composited page containing the drawing
+ buffer's content was presented to the user.</p>
+
+ <p>To ensure accurate synchronization of the textured image with other
+ tracks of an HTMLVideoElement's media group, the application must be
+ able to specify the <em>presentation time</em> of the drawing
+ buffer.</p>
+
+ <p>The command <pre class="idl" xml:space="preserve">void setDrawingBufferPresentTime(WDTNanoTime pt);</pre>
+ tells the browser the UST when the drawing buffer must be presented
+ after the application returns to the browser. The browser must present
+ the composited page containing the canvas to the user at the specified
+ UST. If the specified time has already passed when control returns, the
+ browser should present the drawing buffer as soon as possible. Should an
+ explicit drawing buffer present function be added to WebGL, the
+ presentation time will become one of its parameters.</p>
+
+ <h3>5.16.1 WDTStreamFrameInfo</h3>
+
+ <p>The <code>WDTStreamFrameInfo</code> interface represents information
+ about a frame acquired from a WDTStream.</p>
+
+ <pre class="idl" xml:space="preserve">[NoInterfaceObject] interface WDTStreamFrameInfo {
+ readonly attribute double frameTime;
+ readonly attribute WDTNanoTime presentTime;
+};</pre>
+
+ <h4>5.16.1.1 Attributes</h4>
+
+ <p>The following attributes are available:</p>
+
+ <dl class="methods">
+ <dt><code class="attribute-name">frameTime</code> of type
+ <code>double</code></dt>
+
+ <dd>The time of the frame relative to the start of the producer's
+ MediaController timeline in seconds. Equivalent to
+ <code>currentTime</code> in an HTMLMediaElement.</dd>
+
+ <dt><code class="attribute-name">presentTime</code> of type
+ <code>WDTNanoTime</code></dt>
+
+ <dd>The time the frame must be presented in order to sync with other
+ tracks in the element's mediagroup, particularly audio.</dd>
+ </dl>
+
+ <h3 id="wdtstream">5.16.2 WDTStream</h3>
+
+ <p>The <code>WDTStream</code> interface represents a stream object used
+ for controlling an image stream being fed to a dynamic texture
+ object.</p>
+
+ <pre class="idl" xml:space="preserve">[NoInterfaceObject] interface WDTStream {
+ typedef (HTMLCanvasElement or
+ HTMLImageElement or
+ HTMLVideoElement) StreamSource;
+
+ const GLenum STREAM_CONNECTING = 0;
+ const GLenum STREAM_EMPTY = 1;
+ const GLenum STREAM_NEW_FRAME_AVAILABLE = 2;
+ const GLenum STREAM_OLD_FRAME_AVAILABLE = 3;
+ const GLenum STREAM_DISCONNECTED = 4;
+
+ readonly attribute WebGLTexture consumer;
+
+ readonly attribute WDTStreamFrameInfo consumerFrame;
+ readonly attribute WDTStreamFrameInfo producerFrame;
+
+ readonly attribute WDTNanoTime minFrameDuration;
+
+ readonly attribute GLenum state;
+
+ attribute WDTNanotime acquireTimeout;
+ attribute WDTNanoTime consumerLatency;
+
+ void connectSource(StreamSource source);
+ void disconnect();
+ StreamSource? getSource();
+
+ boolean acquireImage();
+ void releaseImage();
+};</pre>
+
+ <h4>5.16.2.1 Attributes</h4>
+
+ <dl class="methods">
+ <dt><code class="attribute-name">consumer</code> of type
+ <code>WebGLTexture</code></dt>
+
+ <dd>The <code>WebGLTexture</code> that was bound to the
+ TEXTURE_EXTERNAL_OES target of the active texture unit at the time the
+ stream was created. Sampling this texture in a shader will return
+ samples from the image latched by <code>acquireImage</code>.</dd>
+
+ <dt><code class="attribute-name">consumerFrame</code> of type
+ <code>WDTStreamFrameInfo</code></dt>
+
+ <dd>Information about the last frame latched by the consumer via
+ <code>acquireImage.</code></dd>
+
+ <dt><code class="attribute-name">producerFrame</code> of type
+ <code>WDTStreamFrameInfo</code></dt>
+
+ <dd>Information about the frame most recently inserted into the stream
+ by the producer.</dd>
+
+ <dt><code class="attribute-name">minFrameDuration</code> of type
+ <code>WDTNanoTime</code></dt>
+
+ <dd>The minimum duration of a frame in the producer. Ideally this
+ should be an attribute on HTMLVideoElement. Most video container
+ formats have metadata that can be used to calculate this. It can only
+ reflect the actual value once the stream is connected to a producer
+ and the producer's <code>READY_STATE</code> is at least
+ <code>HAVE_METADATA</code>. The initial value is
+ <code>Number.MAX_VALUE</code> (i.e., infinity). Applications need this
+ information to determine how complex their drawing can be while
+ maintaining the video's frame rate.</dd>
+
+ <dt><code class="attribute-name">state</code> of type
+ <code>GLenum</code></dt>
+
+ <dd>The state of the stream. Possible states are
+ <code>STREAM_CONNECTING</code>, <code>STREAM_EMPTY</code>,
+ <code>STREAM_NEW_FRAME_AVAILABLE</code>,
+ <code>STREAM_OLD_FRAME_AVAILABLE</code> and
+ <code>STREAM_DISCONNECTED</code>.</dd>
+
+ <dt><code class="attribute-name">consumerLatency</code> of type
+ <code>WDTNanoTime</code></dt>
+
+ <dd>The time between the application latching an image from the stream
+ and the drawing buffer being presented. This is the time by which the
+ producer should delay playback of any synchronized tracks such as
+ audio. The initial value is an implementation-dependent constant
+ value, possibly zero. This should only be changed when the video is
+ paused as producers will not be able to change the playback delay on,
+ e.g. audio, without glitches. It may only be possible to set this
+ prior to starting playback. Implementation experience is needed.</dd>
+
+ <dt><code class="attribute-name">acquireTimeout</code> of type
+ <code>WDTNanoTime</code></dt>
+
+ <dd>The maximum time to block in <code>acquireImage</code> waiting for
+ a new frame. The initial value is 0.</dd>
+ </dl>
+
+ <h4>5.16.2.2 commands</h4>
+
+ <p>The command<pre class="idl" xml:space="preserve">void connectSource(StreamSource source);</pre>connects
+ the stream to the specified <code>StreamSource</code> element. If
+ <code>StreamSource</code> is an <code>HTMLMediaElement</code>, the
+ element's <code>autoPlay</code> attribute is set to <code>false</code>
+ to prevent playback starting before the application is ready. If
+ <code>state</code> is not <code>STREAM_CONNECTING</code>, an
+ <code>InvalidStateError</code> exception is thrown. After connecting
+ <code>state</code> becomes <code>STREAM_EMPTY</code>.</p>
+
+ <p>The command<pre class="idl" xml:space="preserve">void disconnect();</pre>disconnects
+ the stream from its source. Subsequent sampling of the associated
+ texture will return opaque black. <code>state</code> is set to
+ <code>STREAM_DISCONNECTED</code>.</p>
+
+ <p>The command<pre class="idl" xml:space="preserve">StreamSource? getSource();</pre>returns
+ the HTML element that is the producer for this stream.</p>
+
+ <p>The command<pre class="idl" xml:space="preserve">boolean acquireImage();</pre>causes
+ <em>consumer</em> to <em>latch</em> the most recent image frame from the
+ currently connected source. The rules for selecting the image to be
+ latched mirror those for selecting the image drawn by the
+ <code>drawImage</code> method of <a
+ href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#canvasrenderingcontext2d">CanvasRenderingContext2D</a>.</p>
+
+ <p>For HTMLVideoElements, it latches the frame of video that will
+ correspond to the <a
+ href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#current-playback-position">current
+ playback position</a> of the audio channel, as defined in the <a
+ href="http://www.whatwg.org/specs/web-apps/current-work/">HTML Living
+ Standard</a>, at least <em>latency</em> nanoseconds from the call
+ returning, where <em>latency</em> is the <code>consumerLatency</code>
+ attribute of the stream. If the element's <code>readyState</code>
+ attribute is either <code>HAVE_NOTHING</code> or
+ <code>HAVE_METADATA</code>, the command returns without latching
+ anything and the texture remains <em>incomplete</em>. The effective size
+ of the texture will be the element's <a
+ href="http://www.whatwg.org/specs/web-apps/current-work/#concept-video-intrinsic-width">intrinsic
+ width</a> and <a
+ href="http://www.whatwg.org/specs/web-apps/current-work/#concept-video-intrinsic-height">height</a>.</p>
+
+ <p>For animated HTMLImageElements it will latch the first frame of the
+ animation. The effective size of the texture will be the element's
+ intrinsic width and height. </p>
+
+ <p>For HTMLCanvasElements it will latch the current content of the
+ canvas as would be returned by a call to <code>toDataURL</code>.</p>
+
+ <p><code>acquireImage</code> will block until either the timeout
+ specified by <code>acquireTimeout</code> expires or state is neither
+ <code>STREAM_EMPTY</code> nor <code>STREAM_OLD_FRAME_AVAILABLE</code>,
+ whichever comes first.</p>
+
+ <p>The model is a stream of images between the producer and the
+ WebGLTexture consumer. <code>acquireImage</code> latches the most recent
+ image. If the producer has not inserted any new images since the last
+ call to <code>acquireImage</code> then <code>acquireImage</code> will
+ latch the same image it latched last time it was called. If the producer
+ has inserted one new image since the last call then
+ <code>acquireImage</code> will "latch" the newly inserted image. If the
+ producer has inserted more than one new image since the last call then
+ all but the most recently inserted image are discarded and
+ <code>acquireImage</code> will "latch" the most recently inserted image.
+ For <code>HTMLVideoElements</code>, the application can use the value of
+ the <code>frameTime</code> attribute in the <code>consumerFrame</code>
+ attribute to identify which image frame was actually latched.</p>
+
+ <p><code>acquireImage</code> returns <code>true</code> if an image has
+ been acquired, and <code>false</code> if the timeout fired. It throws
+ the following exceptions:<ul>
+ <li><code>InvalidStateError</code>, if no dynamic source is
+ connected to the stream.</li>
+ </ul>XXX Complete after resolving issue 22. XXX</p>
+
+ <p>The command <pre class="idl" xml:space="preserve">void releaseImage();</pre>releases
+ the latched image. <code>releaseImage</code> will prevent the producer
+ from re-using and/or modifying the image until all preceding WebGL
+ commands that use the image as a texture have completed. If
+ <code>acquireImage</code> is called twice without an intervening call to
+ <code>releaseImage</code> then <code>releaseImage</code> is implicitly
+ called at the start of <code>acquireImage</code>.</p>
+
+ <p>After successfully calling <code>releaseImage</code> the texture
+ becomes "incomplete".</p>
+
+ <p>If <code>releaseImage</code> is called twice without a successful
+ intervening call to <code>acquireImage</code>, or called with no
+ previous call to <code>acquireImage</code>, then the call does nothing
+ and the texture remains in "incomplete" state. This is not an error</p>
+
+ <p>It throws the following exceptions:<ul>
+ <li><code>InvalidStateError</code>, if no dynamic source is
+ connected to the stream.</li>
+ </ul>XXX Complete after resolving issue 22. XXX</p>
+
+ <p>To sample a dynamic texture, the texture object must be bound to the
+ target <code>TEXTURE_EXTERNAL_OES</code> and the sampler uniform must be
+ of type <code>samplerExternal</code>. If the texture object bound to
+ <code>TEXTURE_EXTERNAL_OES</code> is not bound to a dynamic source then
+ the texture is "incomplete" and the sampler will return opaque
+ black.</p>
+ </blockquote>
+
+ <p><a id="differences"/>At the end of section 6 <cite>Differences between
+ WebGL and OpenGL ES</cite>, add the following new sections. Note that
+ differences are considered with respect to the OpenGL ES 2.0 specification
+ as extended by <a
+ href="https://www.khronos.org/registry/gles/extensions/NV/NV_EGL_stream_consumer_external.txt">NV_EGL_stream_consumer_external</a>
+ in the absence of <a
+ href="http://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt">OES_EGL_image_external</a>.</p>
+
+ <blockquote>
+ <h3>6.25 External Texture Support</h3>
+
+ <p>WebGL supports <em>external textures</em> but provides its own
+ <code>WDTStream</code> interface instead of <code>EGLStream</code>.
+ <code>WDTStream </code>connects an HTMLCanvasElement, HTMLImageElement
+ or HTMLVideoElement as the producer for an external texture. Specific
+ language changes follow.</p>
+
+ <p>Section <cite>3.7.14.1 External Textures as Stream Consumers</cite>
+ is replaced with the following.<blockquote>
+ <p>To use a TEXTURE_EXTERNAL_OES texture as the consumer of images
+ from a dynamic HTML element, bind the texture to the active texture
+ unit, and call <code>createStream</code> to create a
+ <code>WDTStream</code>. Use the stream's <code>connectSource</code>
+ command to connect the stream to the desired producer HTML element.
+ The width, height, format, type, internalformat, border and image
+ data of the TEXTURE_EXTERNAL_OES texture will all be determined
+ based on the specified dynamic HTML element. If the element does not
+ have any source or the source is not yet loaded, the width, height
+ &amp; border will be zero, the format and internal format will be
+ undefined. Once the element's source has been loaded and one (or
+ more) images have been decoded these attributes are determined
+ (internally by the implementation), but they are not exposed to the
+ WebGL application and there is no way to query their values.</p>
+
+ <p> The TEXTURE_EXTERNAL_OES texture remains the consumer of the
+ dynamic HTML element's image frames until the first of any of these
+ events occur:<ol>
+ <li>The texture is associated with a different dynamic HTML
+ element (with a later call to
+ <code>WDTStream.connectSource</code>).</li>
+
+ <li>The texture is deleted in a call to
+ <code>deleteTextures</code>.</li>
+ </ol></p>
+
+ <p>Sampling an external texture which is not connected to a dynamic
+ HTML element will return opaque black. Sampling an external texture
+ which is connected to a dynamic HTML element will return opaque
+ black unless an image frame has been 'latched' into the texture by a
+ successful call to WDTStream.acquireImage.</p>
+ </blockquote></p>
+ </blockquote>
+ </additions>
+
+ <errors/>
+
+ <newstate/>
+
+ <newimplstate/>
+
+ <!-- New Implementation-Dependent State -->
+
+ <samplecode>
+ <p>XXX IGNORE THIS SAMPLE CODE. IT HAS NOT YET BEEN UPDATED TO MATCH THE
+ NEW SPEC TEXT. XXX</p>
+
+ <div class="example">This a fragment shader that samples a video texture.
+ Note that the surrounding <code>&lt;script&gt;</code> tag is not
+ essential; it is merely one way to include shader text in an HTML
+ file.<pre xml:space="preserve">&lt;script id="fshader" type="x-shader/x-fragment"&gt;
+ #extension OES_EGL_image_external : enable
+ precision mediump float;
+
+ uniform samplerExternalOES videoSampler;
+
+ varying float v_Dot;
+ varying vec2 v_texCoord;
+
+ void main()
+ {
+ vec2 texCoord = vec2(v_texCoord.s, 1.0 - v_texCoord.t);
+ vec4 color = texture2D(videoSampler, texCoord);
+ color += vec4(0.1, 0.1, 0.1, 1);
+ gl_FragColor = vec4(color.xyz * v_Dot, color.a);
+ }
+&lt;/script&gt;</pre></div>
+
+ <div class="example">This shows fragments from an application that renders
+ a spinning cube textured with a live video.<pre xml:space="preserve">&lt;html&gt;
+&lt;script type="text/javascript"&gt;
+
+ ///////////////////////////////////////////////////////////////////////
+ // Create a video texture and bind a source to it.
+ ///////////////////////////////////////////////////////////////////////
+
+ // Array of files currently loading
+ g_loadingFiles = [];
+
+ // Clears all the files currently loading.
+ // This is used to handle context lost events.
+ function clearLoadingFiles() {
+ for (var ii = 0; ii &lt; g_loadingFiles.length; ++ii) {
+ g_loadingFiles[ii].onload = undefined;
+ }
+ g_loadingFiles = [];
+ }
+
+ //
+ // createVideoTexture
+ //
+ // Load video from the passed HTMLVideoElement id, bind it to a new WebGLTexture object
+ // and return the WebGLTexture.
+ //
+ // Is there a constructor for an HTMLVideoElement so you can do like "new Image()?"
+ //
+ function createVideoTexture(ctx, videoId)
+ {
+ var texture = ctx.createTexture();
+ var video = document.getElementById(videoId);
+ g_loadingFiles.push(video);
+ video.onload = function() { doBindVideo(ctx, video, texture) }
+ return texture;
+ }
+
+ function doBindVideo(ctx, video, texture)
+ {
+ g_loadingFiles.splice(g_loadingFiles.indexOf(image), 1);
+ ctx.bindTexture(ctx.TEXTURE_EXTERNAL_OES, texture);
+ ctx.dynamicTextureSetSource(video);
+ // These are the default values of these properties so the following
+ // 4 lines are not necessary.
+ ctx.texParameteri(ctx.TEXTURE_EXTERNAL_OES, ctx.TEXTURE_MAG_FILTER, ctx.LINEAR);
+ ctx.texParameteri(ctx.TEXTURE_EXTERNAL_OES, ctx.TEXTURE_MIN_FILTER, ctx.LINEAR);
+ ctx.texParameteri(ctx.TEXTURE_EXTERNAL_OES, ctx.TEXTURE_WRAP_S, ctx.CLAMP_TO_EDGE);
+ ctx.texParameteri(ctx.TEXTURE_EXTERNAL_OES, ctx.TEXTURE_WRAP_T, ctx.CLAMP_TO_EDGE);
+ ctx.bindTexture(ctx.TEXTURE_EXTERNAL_OES, null);
+ }
+
+ ///////////////////////////////////////////////////////////////////////
+ // Initialize the application.
+ ///////////////////////////////////////////////////////////////////////
+
+ var g = {};
+ var videoTexture;
+
+ function init()
+ {
+ // Initialize
+ var gl = initWebGL(
+ // The id of the Canvas Element
+ "example");
+ if (!gl) {
+ return;
+ }
+ var program = simpleSetup(
+ gl,
+ // The ids of the vertex and fragment shaders
+ "vshader", "fshader",
+ // The vertex attribute names used by the shaders.
+ // The order they appear here corresponds to their index
+ // used later.
+ [ "vNormal", "vColor", "vPosition"],
+ // The clear color and depth values
+ [ 0, 0, 0.5, 1 ], 10000);
+
+ // Set some uniform variables for the shaders
+ gl.uniform3f(gl.getUniformLocation(program, "lightDir"), 0, 0, 1);
+ // Use the default texture unit 0 for the video
+ gl.uniform1i(gl.getUniformLocation(program, "samplerExternal"), 0);
+
+ // Create a box. On return 'gl' contains a 'box' property with
+ // the BufferObjects containing the arrays for vertices,
+ // normals, texture coords, and indices.
+ g.box = makeBox(gl);
+
+ // Load an image to use. Returns a WebGLTexture object
+ videoTexture = createVideoTexture(gl, "video");
+ // Bind the video texture
+ gl.bindTexture(gl.TEXTURE_EXTERNAL_OES, videoTexture);
+
+ // Create some matrices to use later and save their locations in the shaders
+ g.mvMatrix = new J3DIMatrix4();
+ g.u_normalMatrixLoc = gl.getUniformLocation(program, "u_normalMatrix");
+ g.normalMatrix = new J3DIMatrix4();
+ g.u_modelViewProjMatrixLoc =
+ gl.getUniformLocation(program, "u_modelViewProjMatrix");
+ g.mvpMatrix = new J3DIMatrix4();
+
+ // Enable all of the vertex attribute arrays.
+ gl.enableVertexAttribArray(0);
+ gl.enableVertexAttribArray(1);
+ gl.enableVertexAttribArray(2);
+
+ // Set up all the vertex attributes for vertices, normals and texCoords
+ gl.bindBuffer(gl.ARRAY_BUFFER, g.box.vertexObject);
+ gl.vertexAttribPointer(2, 3, gl.FLOAT, false, 0, 0);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, g.box.normalObject);
+ gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 0, 0);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, g.box.texCoordObject);
+ gl.vertexAttribPointer(1, 2, gl.FLOAT, false, 0, 0);
+
+ // Bind the index array
+ gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, g.box.indexObject);
+
+ return gl;
+ }
+
+ // ...
+
+ ///////////////////////////////////////////////////////////////////////
+ // Draw a frame
+ ///////////////////////////////////////////////////////////////////////
+ function draw(gl)
+ {
+ // Make sure the canvas is sized correctly.
+ reshape(gl);
+
+ // Clear the canvas
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
+
+ // Make a model/view matrix.
+ g.mvMatrix.makeIdentity();
+ g.mvMatrix.rotate(20, 1,0,0);
+ g.mvMatrix.rotate(currentAngle, 0,1,0);
+
+ // Construct the normal matrix from the model-view matrix and pass it in
+ g.normalMatrix.load(g.mvMatrix);
+ g.normalMatrix.invert();
+ g.normalMatrix.transpose();
+ g.normalMatrix.setUniform(gl, g.u_normalMatrixLoc, false);
+
+ // Construct the model-view * projection matrix and pass it in
+ g.mvpMatrix.load(g.perspectiveMatrix);
+ g.mvpMatrix.multiply(g.mvMatrix);
+ g.mvpMatrix.setUniform(gl, g.u_modelViewProjMatrixLoc, false);
+
+ // Acquire the latest video image
+ gl.dynamicTextureAcquireImage();
+
+ // Draw the cube
+ gl.drawElements(gl.TRIANGLES, g.box.numIndices, gl.UNSIGNED_BYTE, 0);
+
+ // Allow updates to the image again
+ gl.dynamicTextureReleaseImage();
+
+ // Show the framerate
+ framerate.snapshot();
+
+ currentAngle += incAngle;
+ if (currentAngle &gt; 360)
+ currentAngle -= 360;
+ }
+&lt;/script&gt;
+
+&lt;body onload="start()"&gt;
+&lt;video id="video" src="resources/video.ogv" autoplay="true" style="visibility: hidden"&gt;
+&lt;/video&gt;
+&lt;canvas id="example"&gt;
+ If you're seeing this your web browser doesn't support the &amp;lt;canvas&amp;gt; element. Ouch!
+&lt;/canvas&gt;
+&lt;div id="framerate"&gt;&lt;/div&gt;
+&lt;/body&gt;
+
+&lt;/html&gt;</pre></div>
+
+ <!--
+ <p>See the <a href="DynamicTexture.html" target="_blank">complete
+ sample</a>.</p>
+ -->
+ </samplecode>
+
+ <tests/>
+
+ <security>
+ <p>Statistical fingerprinting is a privacy concern where a malicious web
+ site may determine whether a user has visited a third-party web site by
+ measuring the timing of cache hits and misses of resources in the
+ third-party web site. Though the ustnow method of this extension returns
+ time data to a greater accuracy than before, it does not make this privacy
+ concern significantly worse than it was already. </p>
+ </security>
+
+ <issues>
+ <ol>
+ <li>
+ <p>What do applications need to be able to determine about the
+ source?</p>
+
+ <p>RESOLVED. Two things <ul>
+ <li>the minimum inter-frame interval. This is needed to determine
+ a rendering budget.</li>
+
+ <li>whether a frame has been missed.</li>
+ </ul></p>
+ </li>
+
+ <li>
+ <p>Neither the minimum inter-frame interval nor frame rate is exposed
+ by HTMLMediaElements. How can it be determined?</p>
+
+ <p>RESOLVED. Although there have been requests to expose the frame
+ rate, in connection with non-linear editing and <a
+ href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2011-January/029724.html">frame
+ accurate seeks to SMPTE time-code positions</a>, there has been no
+ resolution. Therefore the stream object interface will have to provide
+ a query for the minimum inter-frame interval. It can easily be derived
+ from the frame-rate of fixed-rate videos or from information that is
+ commonly stored in the container metadata for variable-rate formats.
+ For example the <a
+ href="http://matroska.org/technical/specs/index.html">Matroska</a> and
+ <a href="http://www.webmproject.org/code/specs/container/">WebM</a>
+ containers provide a FrameRate item, albeit listed as "information
+ only." Note that there is a <a
+ href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=22678">tracking
+ bug</a> for this feature at WHATWG/W3C where browser vendors can
+ express interest in implementing it.</p>
+ </li>
+
+ <li>
+ <p>How can the application determine whether it has missed a
+ frame?</p>
+
+ <p>RESOLVED. If a frame's <code>presentTime</code> is earlier than
+ ustnow() + consumerLatency then the application will have to drop the
+ frame and acquire the next one.</p>
+ </li>
+
+ <li>
+ <p>Why not use the <code>TEXTURE2D</code> target and
+ <code>texImage2D</code>?</p>
+
+ <p>RESOLVED. Use a new texture target and new commands. A new texture
+ target makes it easy to specify, implement and conformance test the
+ restrictions that enable a zero-copy implementation of dynamic
+ textures as described in the <a href="#overview">Overview</a>. Given
+ that one of those restriction is not allowing modification of the
+ texture data, which is normally done via <code>texImage2D</code> using
+ a new command will make the usage model clearer.</p>
+ </li>
+
+ <li>
+ <p>Why not use sampler2D uniforms?</p>
+
+ <p>RESOLVED. Use a new sampler type. Many zero-copy implementations
+ will need special shader code when sampling YUV format dynamic
+ textures. Implementations may choose to (a) re-compile at run time or
+ (b) inject conditional code which branches at run time according to
+ the format of the texture bound to TEXTURE_EXTERNAL_OES in the texture
+ unit to which the sampler variable is set. Without a new sampler type,
+ such conditional code would have to be injected for every sampler
+ fetch increasing the size of the shader and slowing sampling of other
+ texture targets. In order to preserve the possibility of using
+ approach (b), a new sampler type will be used.</p>
+ </li>
+
+ <li>
+ <p>Should the API be implemented as methods on the texture object or
+ as commands taking a texture object as a parameter?</p>
+
+ <p>RESOLVED. Neither. The <code>WebGLTexture</code> object represents
+ an OpenGL texture name. No object is created until the name is bound
+ to a texture target. Therefore the new commands should operate on a
+ the currently bound texture object.</p>
+ </li>
+
+ <li>
+ <p>Should dynamic textures be a new texture type or can
+ <code>WebGLTexture</code> be reused?</p>
+
+ <p>RESOLVED. <code>WebGLTexture</code> can be reused. As noted in the
+ previous issue a <code>WebGLTexture</code> represents a texture name
+ and is a handle to multiple texture types. The type of texture is set
+ according to the target to which the name is initially bound.</p>
+ </li>
+
+ <li>
+ <p>Should this extension use direct texture access commands or should
+ it use <code>texParameter</code> and <code>getTexParameter</code>?</p>
+
+ <p>RESOLVED. Use the latter. There is no directly accessible texture
+ object to which such commands can be added. Changing the API to have
+ such objects is outside the scope of this extension.</p>
+ </li>
+
+ <li>
+ <p>Should we re-use <code>#extension
+ NV_EGL_stream_consumer_external</code>, create our own GLSL extension
+ name or have both this and a WebGL-specific name?</p>
+
+ <p>RESOLVED. Any of <code>WEBGL_dynamic_texture</code> or the aliases
+ <code>GL_NV_EGL_stream_consumer_external</code> or
+ <code>GL_OES_EGL_image_external</code> can be used to enable this
+ extension's features in the shader. This permits the same shader to be
+ used with both WebGL and OpenGL ES 2.0.</p>
+ </li>
+
+ <li>
+ <p>What should happen when an object of type
+ <code>HTMLCanvasElement</code>, <code>HTMLImageElement</code> or
+ <code>HTMLVideoElement</code>is passed to the existing
+ <code>tex*Image2D</code> commands?</p>
+
+ <p>UNRESOLVED. This behavior is outside the scope of this extension
+ but handling of these objects is very underspecified in the WebGL
+ specification and needs to be clarified. Suggestion: for single-frame
+ HTMLImageElement set the texture image to the HTMLImageElement; for an
+ animated HTMLImageElement set the texture image to the first frame of
+ the animation; for an HTMLCanvasElement, set the texture image to the
+ current canvas image that would be returned by toDataURL; for an
+ HTMLVideoElement, set the texture image to the current frame. In all
+ cases, the texture image does not change until a subsequent call to a
+ <code>tex*Image2D</code> command. <em>Is this a change from the way
+ any of these elements are handled today?</em></p>
+ </li>
+
+ <li>
+ <p>Should <code>acquireImage</code> and <code>releaseImage</code>
+ generate errors if called when the stream is already in the state to
+ be set or ignore those extra calls?</p>
+
+ <p>RESOLVED. They should not generate errors.
+ <code>acquireImage</code> will be defined to implicitly call
+ <code>releaseImage</code> if there has not been an intervening
+ call.</p>
+ </li>
+
+ <li>
+ <p>This API is implementable on any platform at varying levels of
+ efficiency. Should it therefore move directly to core rather than
+ being an extension?</p>
+
+ <p>RESOLVED. No, unless doing so would result in implementations
+ appearing sooner.</p>
+ </li>
+
+ <li>
+ <p>Should this extension support HTMLImageElement?</p>
+
+ <p>UNRESOLVED. The HTML 5 Living Standard provides virtually no rules
+ for handling of animated HTMLImageElements and specifically no
+ definition of a current frame. In order to texture the animations from
+ such elements, this specification will need to provide rules. If we
+ are tracking the behavior of <a
+ href="http://www.whatwg.org/specs/web-apps/current-work/#dom-context-2d-drawimage">CanvasRenderingContext2D.drawImage</a>
+ then there is no point supporting HTMLImageElement as the
+ specification says to draw the first frame of animated
+ <code>HTMLImageElements</code>. </p>
+ </li>
+
+ <li>
+ <p>Should this extension extend <code>HTMLMediaElement</code> with an
+ acquireImage/releaseImage API?</p>
+
+ <p>RESOLVED. No. The API would have no purpose and would require
+ HTML{Video,Canvas,Image}Element becoming aware of WebGLTexture or,
+ even worse, aware of texture binding within WebGL. No similar API was
+ exposed to support CanvasRenderingContext2D.drawImage. The HTMLElement
+ is simply passed to drawImage.</p>
+ </li>
+
+ <li>
+ <p>Should <a
+ href="http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html#sec-DOMHighResTimeStamp">DOMHighResolutionTime</a>
+ and <code>window.performance.now()</code> from the W3C <a
+ href="http://dvcs.w3.org/hg/webperf/raw-file/tip/specs/HighResolutionTime/Overview.html">High-Resolution
+ Time</a> draft be used for the timestamps and as UST?</p>
+
+ <p>RESOLVED. No. The specified unit is milliseconds and, although the
+ preferred accuracy is microseconds, the required accuracy is only
+ milliseconds. At millisecond accuracy it is not possible to
+ distinguish between 29.97 fps and 30 fps which means sound for a 29.97
+ fps video will be ~3.5 seconds out of sync after 1 hour. Also
+ fractional <code>double</code> values must be used to represent times
+ &lt; 1 ms with the attendant issues of variable time steps as the
+ exponent changes. Feedback has been provided. Hopefully the draft
+ specification will be updated.</p>
+ </li>
+
+ <li>
+ <p>Should UST 0 be system start-up, browser start-up or <a
+ href="http://www.w3.org/TR/navigation-timing/#dom-performancetiming-navigationstart">navigationStart</a>
+ as defined in the W3C <a
+ href="http://www.w3.org/TR/2012/PR-navigation-timing-20120726/">Navigation
+ Timing</a> proposed recommendation?</p>
+
+ <p>RESOLVED. If <code>DOMHighResolutionTime</code> is used, then
+ navigationStart makes sense otherwise it can be left to the
+ implementation.</p>
+ </li>
+
+ <li>
+ <p>Should UST wrap rather then increment the exponent, so as to
+ maintain precision?</p>
+
+ <p>UNRESOLVED. The exponent will need to be incremented after 2**53
+ nanoseconds (~ 41 days). UST could wrap to 0 after that or just keep
+ counting. If it keeps counting, the precision will be halved so each
+ tick will be 2 nanoseconds. The next precision change will occur after
+ a further ~82 days.</p>
+ </li>
+
+ <li>
+ <p>Should WDTStream.state be a proper idl enum?</p>
+
+ <p>UNRESOLVED.</p>
+ </li>
+
+ <li>
+ <p>Does the application need to be able to find out if it has missed a
+ potential renderAnimationFrame callback, i.e, it has taken longer than
+ the browser's natural rAF period? If so, how?</p>
+
+ <p>UNRESOLVED.</p>
+ </li>
+
+ <li>
+ <p>What are the base and units of a renderbuffer's present time on
+ iOS?</p>
+
+ <p>UNRESOLVED.</p>
+ </li>
+
+ <li>
+ <p><code>CanvasRenderingContext2D.drawImage</code> requires an
+ InvalidStateError be thrown if either width or height of the source
+ canvas is 0? Do we need to do mirror this?</p>
+
+ <p>RESOLVED. Treating this situation as failing to acquire an image
+ and so returning opaque black when sampled provides more consistent
+ handling across StreamSource types and is more consistent with OpenGL
+ ES.</p>
+ </li>
+
+ <li>
+ <p>Should exceptions be used for errors on WDTStreams or should
+ GL-style error handling be used?</p>
+
+ <p>UNRESOLVED.</p>
+ </li>
+ </ol>
+ </issues>
+
+ <history>
+ <revision date="2012/07/05">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2012/07/06">
+ <change>Fixed incorrect dependency and minor naming inconsistencies.
+ Fixed missing parameter error and moved the location of the bindTexture
+ call in the sample code.</change>
+ </revision>
+
+ <revision date="2012/07/20">
+ <change>Significant rewrite that bases the extension on
+ GL_NV_EGL_stream_consumer_external and which uses semantics and
+ concepts" from EGLStream rather than EGLImage.</change>
+ </revision>
+
+ <revision date="2012/07/23">
+ <change>Change #extension aliases to match bug fixes in mirrored
+ extensions.</change>
+ </revision>
+
+ <revision date="2012/08/30">
+ <change>Update contributors list. Reorder issues to put all texture
+ object related issues together and modify them for consistency. Fix
+ small typos.</change>
+ </revision>
+
+ <revision date="2013/07/12">
+ <change>Major revamp. Expose stream objects and provide commands for
+ measuring time to render and present the drawing buffer.</change>
+ </revision>
+
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+
+ <revision date="2014/10/29">
+ <change>Used updated XSL to properly show interfaces add by this
+ extension under New Types.</change>
+ </revision>
+
+ <revision date="2015/10/02">
+ <change>Updated link to GL_NV_EGL_stream_consumer_external
+ extension.</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_subarray_uploads/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_subarray_uploads/extension.xml
new file mode 100644
index 0000000000..995e0dbe5d
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_subarray_uploads/extension.xml
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<proposal href="proposals/WEBGL_subarray_uploads/">
+ <name>WEBGL_subarray_uploads</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Jeff Gilbert (jgilbert 'at' mozilla.com)</contributor>
+ </contributors>
+
+ <number>k</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview>
+ <features>
+ <feature>
+ Though no-copy slicing of TypedArrays is already possible, it can still generate
+ considerable garbage, incuring GC load. Allowing for specification of subarray
+ offset and size can eliminate this source of garbage.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_subarray_uploads {
+ void bufferSubData(GLenum target, GLsizeiptr bufferOffset, GLsizeiptr subarrayOffset,
+ GLsizeiptr subarraySize, (ArrayBuffer or SharedArrayBuffer) data);
+
+ void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum sizedFormat,
+ GLsizeiptr subarrayOffset, GLsizeiptr subarraySize,
+ (ArrayBuffer or SharedArrayBuffer) data);
+
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format, GLenum type,
+ GLsizeiptr subarrayOffset, GLsizeiptr subarraySize,
+ (ArrayBuffer or SharedArrayBuffer) data);
+};
+ </idl>
+
+ <newfun>
+ <function name="bufferSubData" type="void">
+ <param name="target" type="GLenum"/>
+ <param name="bufferOffset" type="GLsizeiptr"/>
+ <param name="subarrayOffset" type="GLsizeiptr"/>
+ <param name="subarraySize" type="GLsizeiptr"/>
+ <param name="data" type="ArrayBuffer or SharedArrayBuffer"/>
+ Upload data from a subarray of an ArrayBuffer or SharedArrayBuffer.
+ </function>
+
+ <function name="compressedTexSubImage2D" type="void">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="sizedFormat" type="GLenum"/>
+ <param name="subarrayOffset" type="GLsizeiptr"/>
+ <param name="subarraySize" type="GLsizeiptr"/>
+ <param name="data" type="ArrayBuffer or SharedArrayBuffer"/>
+ Upload data from a subarray of an ArrayBuffer or SharedArrayBuffer.
+ </function>
+
+ <function name="texSubImage2D" type="void">
+ <param name="target" type="GLenum"/>
+ <param name="level" type="GLint"/>
+ <param name="xoffset" type="GLint"/>
+ <param name="yoffset" type="GLint"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ <param name="format" type="GLenum"/>
+ <param name="type" type="GLenum"/>
+ <param name="subarrayOffset" type="GLsizeiptr"/>
+ <param name="subarraySize" type="GLsizeiptr"/>
+ <param name="data" type="ArrayBuffer or SharedArrayBuffer"/>
+ Upload data from a subarray of an ArrayBuffer or SharedArrayBuffer.
+ </function>
+ </newfun>
+
+ <history>
+ <revision date="2016/06/07">
+ <change>Initial revision</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_multisample/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_multisample/extension.xml
new file mode 100644
index 0000000000..e1230d82e6
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_multisample/extension.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi:set sw=2 ts=4: -->
+<?xml-stylesheet href="../../extension.xsl" type="text/xsl"?>
+<proposal href="proposals/WEBGL_texture_multisample/">
+ <name>WEBGL_texture_multisample</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Jeff Gilbert, Mozilla</contributor>
+ </contributors>
+
+ <number>XYZ</number>
+
+ <depends>
+ <api version="2.0"/>
+ </depends>
+
+ <overview>
+ <features>
+ <feature>
+ Adds <code>texStorage2DMultisample()</code> and the <code>TEXTURE_2D_MULTISAMPLE</code>
+ target from OpenGL ES 3.1.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+ [NoInterfaceObject]
+ interface WEBGL_texture_storage_multisample {
+ const GLenum TEXTURE_2D_MULTISAMPLE = 0x9100;
+
+ void texStorage2DMultisample(GLenum target,
+ GLsizei samples,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLboolean fixedsamplelocations);
+ };
+ </idl>
+
+ <history>
+ <revision date="2017/12/18">
+ <change>Initial revision.</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_source_iframe/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_source_iframe/extension.xml
new file mode 100644
index 0000000000..1484a49ad1
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_texture_source_iframe/extension.xml
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi:set sw=2 ts=4: -->
+<?xml-stylesheet href="../../extension.xsl" type="text/xsl"?>
+
+<proposal href="proposals/WEBGL_texture_source_iframe/">
+ <name>WEBGL_texture_source_iframe</name>
+ <contact><a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+ <contributors>
+ <contributor>Zhenyao Mo, Google Inc</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>NN</number>
+ <depends>
+ <api version="1.0"/>
+ <api version="2.0"/>
+ </depends>
+ <overview>
+ <p>This extension enables WebGL implementations to bind an HTMLIFrameElement object as the data source
+ to a texture. While bound, the extension provides an API to allow applications to request the latest
+ iframe rendering results to be blitted to the texture. The extension also provides an API to allow
+ applications to transform and forward related user input events from WebGL canvas to the bound iframe,
+ thus enabling the bound iframe to be interative inside a WebGL scene.</p>
+ <p>Due to security concerns, currently this extension only supports same origin iframes. This
+ limitaion may be lifted in the future.</p>
+ </overview>
+ <idl xml:space="preserve"><![CDATA[
+[NoInterfaceObject]
+interface WEBGL_texture_source_iframe {
+ Promise<void> bindTextureSource(GLenum target, HTMLIFrameElement iframe);
+ Promise<void> requestFrame(GLenum target);
+ void setEventForwarding(function(Event));
+};
+ ]]></idl>
+ <newfun>
+ <function name="bindTextureSource" type="Promise&lt;void&gt;">
+ <param name="target" type="GLenum"/>
+ <param name="iframe" type="HTMLIFrameElement"/>
+ <p>
+ This function connects an <code>iframe</code> to the texture currently bound to <code>target</code> and returns a promise
+ that will be fulfilled once the iframe is rendered and ready to be blitted to the texture. If the <code>iframe</code>
+ is <code>null</code>, any existing binding between the texture and an iframe is broken.
+ If there are any errors, generate the GL error synchronously and the returned promise is
+ <a href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise">rejected</a>
+ with an <code>InvalidStateError</code>.
+ </p>
+ <p>
+ Once the function returns successfully, the texture is defined as following: its effective
+ internal format becomes <code>RGBA8</code>; its width and height becomes iframe element's
+ width and height.
+ </p>
+ <p>Error cases are listed below:
+ <ul>
+ <li><code>target</code> must be <code>TEXTURE_2D</code>; otherwise an <code>INVALID_ENUM</code>
+ error is generated.</li>
+ <li>If no texture is bound to the <code>target</code>, an <code>INVALID_OPERATION</code> is
+ generated.</li>
+ <li>If <code>iframe</code> is not the same origin, an <code>INVALID_OPERATION</code> is
+ generated.</li>
+ </ul>
+ </p>
+ <p>Note this function returns a promise asynchronously because wiring an iframe rendering results
+ to a WebGL texture could take multiple frames. The iframe could be invisible, therefore not part of
+ the rendering pipeline and needs to be inserted into it. The iframe could also be in a seperate
+ process from the one where WebGL is in, although this is likely not the case right now because we
+ currently limit iframe to be same origin only.</p>
+ </function>
+ <function name="requestFrame" type="Promise&lt;void&gt;">
+ <param name="target" type="GLenum"/>
+ <p>
+ This function instructs implementations to update the texture with the latest iframe rendering
+ results. The function returns a promise that will be fulfilled when the iframe rendering results from the same animation frame
+ when this function is called has been blitted to the texture.
+ </p>
+ <p>
+ If an application uses <code>requestAnimationFrame</code>, implementations must guarantee once
+ this function is called, the iframe rendering results from the same frame has been blitted to the
+ texture when entering the next animation frame. Therefore, it is not necessary for an
+ application to depend on the state of the returned promise. The promise is for applications that do not
+ use <code>requestAnimationFrame</code>.
+ </p>
+ <p>
+ Once this function called, it is not recommended to read from the texture until the returns promise is
+ fulfilled. The content of the texture during this period is undefined.
+ </p>
+ </function>
+ <function name="setEventForwarding" type="void">
+ <param name="func" type="Function"/>
+ <p>
+ This function allows an application to define an event forwarding
+ function that decides whether to forward user input events received on
+ the WebGL canvas to the iframe. If yes, this function needs to transform
+ event locations and displacements as needed. With this, an application
+ can allow users to interact the iframe rendered inside the WebGL scene.
+ </p>
+ <p>
+ The event forwarding function takes an event as input, and output a
+ bool. If returning true, the event is forwarded to the iframe and event
+ data might have been modified to transform the event from WebGL canvas
+ coordinates to iframe coordinates.
+ </p>
+ <p>
+ TODO(zmo@chromium.org): need some help how to define the forwarding function
+ signature.
+ </p>
+ </function>
+ </newfun>
+ <history>
+ <revision date="2017/09/20">
+ <change>Initial revision.</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_video_texture/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_video_texture/extension.xml
new file mode 100644
index 0000000000..764e6044af
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/proposals/WEBGL_video_texture/extension.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<proposal href="proposals/WEBGL_video_texture/">
+ <name>WEBGL_video_texture</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Byungseon Shin (sun.shin 'at' lge.com)</contributor>
+ <contributor>Andrey Volykhin (andrey.volykhin 'at' lge.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="https://www.khronos.org/registry/gles/extensions/OES/OES_EGL_image_external.txt"
+ name="OES_EGL_image_external">
+ <addendum>Defines a new texture target <code>TEXTURE_VIDEO_IMAGE</code>.</addendum>
+ <addendum>Provides a mechanism for binding <code>HTMLVideoElement</code> stream to video texture targets.</addendum>
+ <addendum>Provides time of frame, texture width and height of <code>HTMLVideoElement</code>'s texture binding.</addendum>
+ </mirrors>
+
+ <features>
+ <feature>Add support for <code>WEBGL_video_texture</code>
+ binding of HTMLVideoElement.</feature>
+
+ <glsl extname="WEBGL_video_texture">
+ <stage type="fragment"/>
+ <type name="samplerVideoWEBGL"/>
+
+ <function name="texture2D" type="vec4">
+ <param name="sampler" type="samplerVideoWEBGL"/>
+
+ <param name="coord" type="vec2"/>
+ </function>
+
+ </glsl>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WebGLVideoFrameInfo {
+ readonly attribute double currentTime;
+ readonly attribute unsigned long textureWidth;
+ readonly attribute unsigned long textureHeight;
+};
+
+[NoInterfaceObject]
+interface WEBGL_video_texture {
+ const GLenum TEXTURE_VIDEO_IMAGE = 0x851D;
+ const GLenum SAMPLER_VIDEO_IMAGE = 0x8B61;
+
+ [RaisesException] WebGLVideoFrameInfo VideoElementTargetVideoTexture(
+ GLenum target, HTMLVideoElement video);
+};
+ </idl>
+
+ <samplecode xml:space="preserve">
+
+ <p> This a fragment shader that samples a video texture.</p>
+ <pre>
+ #extension GL_WEBGL_video_texture : require
+ precision mediump float;
+ varying vec2 v_texCoord;
+
+ uniform samplerVideoWEBGL uSampler;
+
+ void main(void) {
+ gl_FragColor = texture2D(uSampler, v_texCoord);
+ }
+ </pre>
+
+ <p> This shows application that renders video using proposed extension. </p>
+ <pre>
+ var videoElement = document.getElementById("video");
+ var videoTexture = gl.createTexture();
+
+ function update() {
+ var ext = gl.getExtension('WEBGL_video_texture');
+ if(ext !=== null){
+ gl.bindTexture(ext.TEXTURE_VIDEO_IMAGE, videoTexture);
+ ext.VideoElementTargetVideoTexture(ext.TEXTURE_VIDEO_IMAGE, videoElement);
+ gl.bindTexture(ext.TEXTURE_VIDEO_IMAGE, null);
+ }
+ }
+
+ function render() {
+ gl.clearColor(0.0, 0.0, 1.0, 1.0);
+ gl.clear(gl.COLOR_BUFFER_BIT);
+
+ gl.bindBuffer(gl.ARRAY_BUFFER, squareVerticesBuffer);
+ gl.vertexAttribPointer(vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);
+
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(ext.TEXTURE_VIDEO_IMAGE, videoTexture);
+ gl.uniform1i(gl.getUniformLocation(shaderProgram, "uSampler"), 0);
+
+ gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
+ }
+ </pre>
+
+ <p> Application renders each video frames into WebGL canvas based on game-loop pattern. </p>
+ <pre>
+
+ while (true) {
+ update();
+ processInput();
+ render();
+ }
+ </pre>
+
+ </samplecode>
+
+ <tests/>
+
+ <issues/>
+
+ <history>
+ <revision date="2016/11/05">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2017/01/10">
+ <change>Change EGLImageTargetTexture2DOES to be called at every WebGL rendering cycle.</change>
+ <change>Add VideoFrameInfo interface.</change>
+ <change>Change EGLImageTargetTexture2DOES to return VideoFrameInfo as a currently mapped frame.</change>
+ </revision>
+ <revision date="2017/08/03">
+ <change>Change Extension name to WEBGL_video_texture for abstracion of OES_EGL_image_external extension.</change>
+ <change>Define new sampler and texture type, TEXTURE_VIDEO_IMAGE and SAMPLER_VIDEO_IMAGE.</change>
+ <change>Change EGLImageTargetTexture2DOES to VideoElementTargetVideoTexture.</change>
+ </revision>
+ </history>
+</proposal>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/EXT_texture_storage/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/EXT_texture_storage/extension.xml
new file mode 100644
index 0000000000..e1c434ef4e
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/EXT_texture_storage/extension.xml
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rejected href="rejected/EXT_texture_storage/">
+ <name>EXT_texture_storage</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Kirill Dmitrenko (dmikis 'at' yandex-team.ru)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>k</number>
+
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0"/>
+ </depends>
+
+ <overview>
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/EXT/EXT_texture_storage.txt"
+ name="EXT_texture_storage">
+ </mirrors>
+
+ <features>
+ <feature>
+ The behaviour of <code>texImage2D</code>,
+ <code>compressedTexImage2D</code> and <code>copyTexImage2D</code>
+ methods of a WebGL context is changed. After a successful call to <code>texStorage2DEXT</code>,
+ the value of <code>TEXTURE_IMMUTABLE_FORMAT_EXT</code> for this texture
+ object is set to <code>TRUE</code>, and no further changes to the dimensions
+ or format of the texture may be made. Using <code>texImage2D</code>,
+ <code>compressedTexImage2D</code>, <code>copyTexImage2D</code> or
+ <code>texStorage2DEXT</code> with the same texture will result
+ in the error <code>INVALID_OPERATION</code> being generated.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+interface EXT_texture_storage {
+ const GLenum TEXTURE_IMMUTABLE_FORMAT_EXT = 0x912F;
+ void texStorage2DEXT(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+}
+</idl>
+
+ <newfun>
+ <function name="texStorage2DEXT" type="void">
+ <param name="target" type="GLenum"/>
+ <param name="levels" type="GLsizei"/>
+ <param name="internalformat" type="GLenum"/>
+ <param name="width" type="GLsizei"/>
+ <param name="height" type="GLsizei"/>
+ Simultaneously specify storage for all levels of a two-dimensional texture.
+ </function>
+ </newfun>
+
+ <history>
+ <revision date="2015/09/16">
+ <change>Initial revision</change>
+ </revision>
+ <revision date="2017/01/11">
+ <change>Moved to rejected now that initial WebGL 2.0 implementations are shipping imminently.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/OES_depth24/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/OES_depth24/extension.xml
new file mode 100644
index 0000000000..05fd2a39fb
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/OES_depth24/extension.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rejected href="rejected/OES_depth24/">
+ <name>OES_depth24</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Florian Boesch (pyalot 'at' gmail.com)</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ <core version="2.0" />
+ </depends>
+
+ <overview>
+ <mirrors href="https://www.khronos.org/registry/gles/extensions/OES/OES_depth24.txt"
+ name="OES_depth24">
+ </mirrors>
+
+ <features>
+ <feature>
+ Allows 24-bit depth components as a valid render buffer storage format.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface OES_depth24 {
+ const GLenum DEPTH_COMPONENT24_OES = 0x81A6;
+};
+ </idl>
+
+ <samplecode xml:space="preserve">
+ <pre>
+ var extension = gl.getExtension('OES_depth24');
+ if(extension !=== null){
+ var depth = gl.createRenderbuffer();
+ gl.bindRenderbuffer(gl.RENDERBUFFER, depth);
+ gl.renderbufferStorage(gl.RENDERBUFFER, extension.DEPTH_COMPONENT24_OES, 128, 128);
+ gl.bindRenderbuffer(gl.RENDERBUFFER, null);
+
+ var fbo = gl.createFramebuffer();
+ gl.bindFramebuffer(gl.FRAMEBUFFER, fbo);
+ gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, depth);
+
+ var fboStatus = gl.checkFramebufferStatus(gl.FRAMEBUFFER);
+ console.assert(fboStatus == gl.FRAMEBUFFER_COMPLETE, 'Framebuffer is not complete');
+
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ console.assert(gl.getError() == gl.NO_ERROR, 'A GL error occured');
+ }
+ </pre>
+ </samplecode>
+
+ <history>
+ <revision date="2015/01/26">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2015/02/05">
+ <change>Moved to rejected because WEBGL_depth_texture can be used as a workaround for 24-bit depth for FBOs.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_compressed_texture_atc/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_compressed_texture_atc/extension.xml
new file mode 100644
index 0000000000..a08906974c
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_compressed_texture_atc/extension.xml
@@ -0,0 +1,112 @@
+<?xml version="1.0"?>
+
+<rejected href="rejected/WEBGL_compressed_texture_atc/">
+ <name>WEBGL_compressed_texture_atc</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>12</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the compressed texture formats defined in the
+ <a href="http://www.khronos.org/registry/gles/extensions/AMD/AMD_compressed_ATC_texture.txt">
+ AMD_compressed_ATC_texture</a> OpenGL extension to WebGL.
+ </p>
+ <features>
+ <feature>
+ Compression formats <code>COMPRESSED_RGB_ATC_WEBGL</code>,
+ <code>COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL</code>, and
+ <code>COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL</code> may be passed to
+ the <code>compressedTexImage2D</code> and <code>compressedTexSubImage2D</code> entry points.
+
+ These formats correspond to the 3 formats defined in the AMD_compressed_ATC_texture OpenGL
+ extension. Although the enum names are changed, their numeric values are the same. The correspondence
+ is given by this table:
+ <table>
+ <tr>
+ <th>WebGL format enum</th>
+ <th>OpenGL format enum</th>
+ <th>Numeric value</th>
+ </tr>
+ <tr>
+ <td>COMPRESSED_RGB_ATC_WEBGL</td>
+ <td>ATC_RGB_AMD</td>
+ <td>0x8C92</td>
+ </tr>
+ <tr>
+ <td>COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL</td>
+ <td>ATC_RGBA_EXPLICIT_ALPHA_AMD</td>
+ <td>0x8C93</td>
+ </tr>
+ <tr>
+ <td>COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL</td>
+ <td>ATC_RGBA_INTERPOLATED_ALPHA_AMD</td>
+ <td>0x87EE</td>
+ </tr>
+ </table>
+ </feature>
+ <feature>
+ Calling <code>getParameter</code> with the argument <code>COMPRESSED_TEXTURE_FORMATS</code>
+ will include the 3 formats from this specification.
+ </feature>
+ <feature>
+ <p>The following format-specific restrictions must be enforced:</p>
+ <dl>
+ <dt>COMPRESSED_RGB_ATC_WEBGL</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code>, must be equal to the following number of bytes:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 8
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+
+ <dt>COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL</dt>
+ <dt>COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL</dt>
+ <dd><p>The <code>byteLength</code> of the ArrayBufferView, <code>pixels</code>, passed to
+ <code>compressedTexImage2D</code>, must be equal to the following number of bytes:</p>
+ <blockquote><code>
+ floor((width + 3) / 4) * floor((height + 3) / 4) * 16
+ </code></blockquote>
+ <p>If it is not, an <code>INVALID_VALUE</code> error is generated.</p>
+ </dd>
+ </dl>
+ </feature>
+ </features>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_compressed_texture_atc {
+ /* Compressed Texture Formats */
+ const GLenum COMPRESSED_RGB_ATC_WEBGL = 0x8C92;
+ const GLenum COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL = 0x8C93;
+ const GLenum COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
+};
+ </idl>
+ <history>
+ <revision date="2012/09/11">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/07/03">
+ <change>Clarified that length of ArrayBufferView is actually byteLength.</change>
+ </revision>
+ <revision date="2014/04/17">
+ <change>Removed reference to compressedTexSubImage2D. This format can only be used with compressedTexImage2D.</change>
+ </revision>
+ <revision date="2014/06/27">
+ <change>Moved to community approved after discussion on public_webgl list.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2018/04/25">
+ <change>Moved to rejected status at Khronos Montreal face-to-face meeting.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_debug_shader_precision/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_debug_shader_precision/extension.xml
new file mode 100644
index 0000000000..f017bca85d
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_debug_shader_precision/extension.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0"?>
+
+<rejected href="rejected/WEBGL_debug_shader_precision/">
+ <name>WEBGL_debug_shader_precision</name>
+
+ <contact><a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Olli Etuaho, NVIDIA</contributor>
+
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension enables software emulation of mediump and lowp floating point arithmetic in GLSL shaders for the purposes of shader testing. The emulation is enabled for shaders that are compiled after the extension has been enabled. Shaders compiled before the extension is enabled are not subject to emulation. The emulation does not model any specific device, but hypothetical shader units that implement IEEE half-precision floating point and the minimum requirements for lowp in The OpenGL ES Shading Language specification version 1.00.17. It is suggested that the software emulation is implemented in shader code, but a large performance cost on the order of one magnitude is still expected on all operations subject to emulation.
+ </p>
+ <div class="note">
+ Many varieties of PC GPUs only implement one precision for floating point operations that corresponds to highp in The OpenGL ES Shading Language, so errors in shader code which uses mediump or lowp precision may be undetectable on these GPUs. Testing shaders with this extension enabled is recommended to ensure compatibility with a wide variety of hardware. Due to the large performance cost of emulation, this extension should only be used for testing and not in a production environment.
+ </div>
+ <p>
+ The emulation applies to:
+ </p>
+ <ul>
+ <li>accesses to variables in r-value expressions (not on the left side of an assignment operator, includes passing in parameters to a function)</li>
+ <li>return values of built-in functions</li>
+ <li>return values of binary math operators, including assignment and compound assignment</li>
+ <li>results of binary math operations evaluated as a part of compound assignment</li>
+ </ul>
+ <div class="note">
+ <p>
+ Examples of operations not subject to emulation:
+ </p>
+ <ul>
+ <li>The math operator is unary, so storing the result and the return value are not subject to emulation: my_float++;</li>
+ </ul>
+ </div>
+ <features>
+ <feature>
+ <p>
+ Operations listed above resulting in a mediump precision floating point scalar, vector or matrix must perform the following steps on the resulting scalar value or each of the components of the vector or matrix:
+ </p>
+ <ol>
+ <li>Clamp the value to the range [-65504.0, 65504.0].</li>
+ <li>Determine the floating-point exponent <em>e</em> of the clamped value.</li>
+ <li>If <em>e</em> &lt; -15, return 0.0, skipping steps 4-6. The sign bit of the return value is undefined in this case.</li>
+ <li>Let <em>x</em> be the clamped value multiplied by 2^(-<em>e</em> + 10.0).</li>
+ <li>Let <em>y</em> be sign(<em>x</em>) * floor(abs(<em>x</em>)).</li>
+ <li>Return <em>y</em> * 2^(<em>e</em> - 10.0).</li>
+ </ol>
+ </feature>
+ <feature>
+ <p>
+ Operations listed above resulting in a lowp precision floating point scalar, vector or matrix must perform the following steps on the resulting scalar value or each of the components of the vector or matrix:
+ </p>
+ <ol>
+ <li>Clamp the value to the range [-2.0, 2.0].</li>
+ <li>Let <em>x</em> be the clamped value multiplied by 2^8.</li>
+ <li>Let <em>y</em> be sign(<em>x</em>) * floor(abs(<em>x</em>)).</li>
+ <li>Return <em>y</em> * 2^(-8).</li>
+ </ol>
+ </feature>
+ <feature>
+ <p>
+ sign, floor, and abs in the above steps refer to built-in functions in The OpenGL ES Shading Language.
+ </p>
+ <p>
+ The handling of positive and negative infinity and NaN by the above steps is undefined.
+ </p>
+ </feature>
+ <feature>
+ <p>
+ The <code>#pragma webgl_debug_shader_precision</code> directive is accepted by the shader compiler, and can be used to disable the emulation for specific shaders. By default, emulation is enabled by all shaders, but including <code>#pragma webgl_debug_shader_precision(off)</code> in a shader must disable emulation for that shader.
+ </p>
+ </feature>
+ </features>
+ <p>
+ Due to hardware limitations, it is allowed that some shaders which compile and link successfully when the extension is disabled do not compile or link when the extension is enabled.
+ </p>
+ </overview>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_debug_shader_precision {
+};
+ </idl>
+ <history>
+ <revision date="2014/11/05">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2014/11/10">
+ <change>Added a #pragma directive to use in shaders and did minor clarifications.</change>
+ </revision>
+ <revision date="2014/11/12">
+ <change>Lifted restrictions concerning math operations evaluated as a part of compound assignment.</change>
+ </revision>
+ <revision date="2015/01/24">
+ <change>Moved to rejected on grounds of it being easy to provide as a library (with emscripten).</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_draw_elements_no_range_check/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_draw_elements_no_range_check/extension.xml
new file mode 100644
index 0000000000..c38a127262
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_draw_elements_no_range_check/extension.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rejected href="rejected/WEBGL_draw_elements_no_range_check/">
+ <name>WEBGL_draw_elements_no_range_check</name>
+
+ <contact><a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Olli Etuaho, NVIDIA</contributor>
+
+ <contributor>Jeff Gilbert, Mozilla</contributor>
+
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview id="overview">
+ <p><code>drawElements</code> robustness is currently ensured by checking
+ indices in the element array buffer against the size of the array buffer
+ they are indexing. These checks are undesirable from a performance
+ perspective, since they introduce CPU overhead to the API and require index
+ buffers to have a copy in CPU-accessible memory.</p>
+
+ <p>This extension changes the behavior of <code>drawElements</code> to use
+ security features built into hardware, bypassing the CPU-side range check
+ and improving performance. The drawback is that if out-of-range indices are
+ referenced by <code>drawElements</code>, no error is generated and the
+ rendering results of that call will be undefined. However, supplying
+ out-of-range indices to <code>drawElements</code> will not result in
+ reading vertex data from outside the enabled vertex buffer objects, nor
+ abnormal program termination, as specified in the OpenGL extension
+ <a href="http://www.opengl.org/registry/specs/ARB/robust_buffer_access_behavior.txt">ARB_robust_buffer_access_behavior</a>.</p>
+
+ <p>It is suggested that this extension is left disabled when debugging. Any
+ <code>INVALID_OPERATION</code> errors from <code>drawElements</code> seen
+ while the extension is off mean that the application is supplying incorrect
+ indices to the API, even if rendering results would seem correct when this
+ extension is enabled.</p>
+
+ <p>This extension interacts with
+ <a href="http://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/">ANGLE_instanced_arrays</a>.</p>
+
+ <features>
+ <feature>
+ Calling <code>drawElements</code> will not produce an <code>INVALID_OPERATION</code>
+ error if a referenced index lies outside the storage of the bound buffer. Instead,
+ rendering is performed and attribute indices that are outside the valid range will produce
+ undefined rendering results.
+ </feature>
+ <feature>
+ Interaction with ANGLE_instanced_arrays: calling <code>drawElementsInstancedANGLE</code>
+ will not produce an <code>INVALID_OPERATION</code> error if a referenced index
+ lies outside the storage of the bound buffer, but will instead produce undefined
+ rendering results similarly to <code>drawElements</code>.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_draw_elements_no_range_check {
+};
+ </idl>
+
+ <issues>
+ </issues>
+ <history>
+ <revision date="2014/03/14">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute.</change>
+ </revision>
+ <revision date="2015/01/24">
+ <change>Moved to rejected.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_get_buffer_sub_data_async/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_get_buffer_sub_data_async/extension.xml
new file mode 100644
index 0000000000..b224f6dbc3
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_get_buffer_sub_data_async/extension.xml
@@ -0,0 +1,141 @@
+<?xml version="1.0"?>
+
+<rejected href="rejected/WEBGL_get_buffer_sub_data_async/">
+ <name>WEBGL_get_buffer_sub_data_async</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Kai Ninomiya, Google Inc.</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>34</number>
+ <depends>
+ <api version="2.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension allows asynchronous buffer readback in WebGL 2.0.
+ </p>
+ <features>
+ <feature>
+ This extension exposes an asynchronous buffer readback entry point for
+ non-blocking readbacks from WebGL buffers. It is equivalent to
+ <code>getBufferSubData</code> but returns a <code>Promise</code>
+ instead of an immediate readback result.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_get_buffer_sub_data_async {
+ // Asynchronous version of getBufferSubData which fulfills the returned promise when the data becomes available.
+ Promise&lt;ArrayBuffer&gt; getBufferSubDataAsync(GLenum target, GLintptr srcByteOffset, ArrayBufferView dstBuffer,
+ optional GLuint dstOffset = 0, optional GLuint length = 0); // May throw DOMException
+};
+ </idl>
+
+ <newfun>
+ <function name="getBufferSubDataAsync" type="Promise&lt;ArrayBuffer&gt;">
+ <param name="target" type="GLenum"/>
+ <param name="srcByteOffset" type="GLintptr"/>
+ <param name="dstBuffer" type="ArrayBufferView"/>
+ <param name="dstOffset" type="optional GLuint"/>
+ <param name="length" type="optional GLuint"/>
+ Reads back data asynchronously from the bound WebGLBuffer into <code>dstBuffer</code>.
+ <br/><br/>
+ Let <code>buf</code> be the buffer bound to <code>target</code> at the time
+ <code>getBufferSubDataAsync</code> is called.
+ If <code>length</code> is 0, let <code>copyLength</code> be
+ <code>dstBuffer.length - dstOffset</code>; otherwise, let
+ <code>copyLength</code> be <code>length</code>.
+ <br/><br/>
+ If <code>copyLength</code> is greater than zero,
+ copy <code>copyLength</code> typed elements (each of size <code>dstBuffer.BYTES_PER_ELEMENT</code>)
+ from <code>buf</code> into <code>dstBuffer</code>,
+ reading <code>buf</code> starting at byte index <code>srcByteOffset</code> and
+ writing into <code>dstBuffer</code> starting at element index <code>dstOffset</code>.
+ If <code>copyLength</code> is 0, no data is written to <code>dstBuffer</code>, but
+ this does not cause a GL error to be generated.
+ <ul>
+ <li>If no WebGLBuffer is bound to <code>target</code>,
+ an <code>INVALID_OPERATION</code> error is generated.
+ </li>
+ <li>If <code>target</code> is <code>TRANSFORM_FEEDBACK_BUFFER</code>,
+ and any transform feedback object is currently active,
+ an <code>INVALID_OPERATION</code> error is generated.
+ </li>
+ <li>If <code>dstOffset</code> is greater than <code>dstBuffer.length</code>,
+ an <code>INVALID_VALUE</code> error is generated.
+ </li>
+ <li>If <code>dstOffset + copyLength</code> is greater than <code>dstBuffer.length</code>,
+ an <code>INVALID_VALUE</code> error is generated.
+ </li>
+ <li>If <code>srcByteOffset</code> is less than zero,
+ an <code>INVALID_VALUE</code> error is generated.
+ </li>
+ <li>If <code>srcByteOffset + copyLength*dstBuffer.BYTES_PER_ELEMENT</code>
+ is larger than the length of <code>buf</code>,
+ an <code>INVALID_OPERATION</code> is generated.
+ </li>
+ </ul>
+ When invoked, <code>getBufferSubDataAsync</code> must run these steps:
+ <ul>
+ <li>Let <code>promise</code> be a Promise to be returned.
+ </li>
+ <li>Check for the errors defined above. If there are any errors, generate the GL error
+ synchronously and
+ <a href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise">reject</a>
+ <code>promise</code> with an <code>InvalidStateError</code>.
+ </li>
+ <li>Insert a readback of <code>buf</code> into the GL command stream, using the range
+ defined above.
+ </li>
+ <li>Return <code>promise</code>, but continue running these steps in parallel.
+ </li>
+ <li>Upon completion of the readback, queue a task performing the following steps:
+ <ul>
+ <li>If the context has been lost, or if <code>dstBuffer</code> has been neutered,
+ <a href="https://www.w3.org/2001/tag/doc/promises-guide/#reject-promise">reject</a>
+ <code>promise</code> with an <code>InvalidStateError</code>. In this case, no GL
+ error is generated.
+ </li>
+ <li>Write the readback result into <code>dstBuffer</code>, using the range defined
+ above.
+ </li>
+ <li><a href="https://www.w3.org/2001/tag/doc/promises-guide/#resolve-promise">Resolve</a>
+ <code>promise</code> with <code>dstBuffer</code>.
+ </li>
+ </ul>
+ The task source for this task is the <a href="#WEBGLCONTEXTEVENT">WebGL task source</a>.
+ </li>
+ </ul>
+ If the returned Promise is rejected, no data is written to <code>dstBuffer</code>.
+
+ <div class="note">
+ Even if <code>getBufferSubDataAsync</code> is called multiple times in a row with the same
+ <code>dstBuffer</code>, <code>then</code> callbacks added synchronously will never see
+ results of subsequent <code>getBufferSubDataAsync</code> calls.
+ </div>
+
+ <div class="note rationale">
+ Compared to the synchronous version of <code>getBufferSubData</code>, this version may
+ impose less overhead on applications. Intended use cases include reading pixels into a
+ pixel buffer object and examining that data on the CPU. It does not force the graphics
+ pipeline to be stalled as <code>getBufferSubData</code> does.
+ </div>
+ </function>
+ </newfun>
+
+ <history>
+ <revision date="2016/12/13">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2018/05/04">
+ <change>Set status to rejected following the working group's decision to
+ allow optimizations of the existing getBufferSubData API instead of
+ exposing a new one.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_shared_resources/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_shared_resources/extension.xml
new file mode 100644
index 0000000000..c512f89b67
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_shared_resources/extension.xml
@@ -0,0 +1,381 @@
+<?xml version="1.0"?>
+
+<rejected href="rejected/WEBGL_shared_resources/">
+ <name>WEBGL_shared_resources</name>
+ <contact>
+ <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org)
+ </contact>
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+ <number>22</number>
+ <depends>
+ <api version="1.0"/>
+ </depends>
+ <overview>
+ <p>
+ This extension exposes the ability to share WebGL resources with multiple WebGLRenderingContexts.
+ </p>
+ <p>
+ Background:
+ </p>
+ <p>
+ The OpenGL ES spec defines that you can share a resource (texture, buffer, shader, program,
+ renderbuffer) with 2 or more GL contexts but with some caveats. To guarantee you'll see a
+ change made in one context in other context requires calling glFinish on the context that
+ made the change and call glBind on the context that wants to see the change.
+ </p>
+ <p>
+ Not calling glFinish and/or glBind does not guarantee you won't see the results which means
+ that users may do neither and their app might just happen to work on some platforms and
+ mysteriously have glitches, rendering corruption, gl errors or program failure on others.
+ </p>
+ <p>
+ WebGL must present consistent behavior for sharing and so this extension provides
+ an API so that implementions can enforce and optimize these requirements.
+ </p>
+ <features>
+ <feature>
+ <p>Adds a new context creation parameter:</p>
+ <dl>
+ <dt><span class="prop-value">shareGroup</span></dt>
+ <dd>
+ <em>Default: undefined</em>. If the value is set to the <code>group</code>
+ attribute from the <code>WEBGL_shared_resources</code> object from an existing context
+ then resources from the existing context are shared with the newly created context.
+ </dd>
+ </dl>
+ <pre class="example">
+var canvas1 = document.createElement("canvas");
+var canvas2 = document.createElement("canvas");
+var ctx1 = canvas1.getContext("webgl");
+var sharedResourcesExtension = ctx1.getExtension("WEBGL_shared_resources");
+var ctx2 = canvas2.getContext("webgl", {
+ shareGroup: sharedResourcesExtension.group
+});
+ </pre>
+ </feature>
+ <feature>
+ <p>
+ In order for a context to use a resouce it must first acquire it.
+ Contexts can make a request to acquire a resource by calling acquireSharedResource
+ in one of 2 modes, EXCLUSIVE or READ_ONLY. A resource may be acquired by multiple
+ contexts in READ_ONLY mode. The resource may only be acquired by one context
+ if the mode is EXCLUSIVE. acquireSharedResource returns an id you can use to cancel the acquire
+ by calling cancelAcquireSharedResource.
+ When the resource is available in the requested mode the callback
+ will be invoked. Resources start their life as acquired in EXCLUSIVE mode in the context
+ in which they are created.
+ </p>
+ <p>
+ To release a resource so it may be acquired by another context call releaseSharedResource and
+ pass it the resource to be released.
+ </p>
+ </feature>
+ <feature>
+ <p>
+ After a resource is acquired it must be bound before it is used. Binding
+ means for buffers calling bindBuffer, for textures either bindTexture or
+ framebufferTexture2D, for renderbuffers either bindRenderbuffer or framebufferRenderbuffer,
+ for shaders attachShader, for programs useProgram. Binding once is sufficient to satisfy
+ this requirement. In other words, if you have a texture attached to more than one texture
+ unit the texture only needs to be re-bound to 1 texture unit. Attemping to use a resource
+ which has not been bound since it was acquired generates INVALID_OPERATION.
+ </p>
+ <p>
+ Bind Requirement Algorithm:
+ </p>
+ <p>
+ Each resource has a per-context bound flag. When a resource is acquired in a context its
+ bound flag for that context is set to false. If one of the functions listed above
+ is called the bound flag for that context is set to true. Drawing and reading functions,
+ clear, drawArrays, drawElements, readPixels, that would access a resource whose bound flag
+ for that context is false generate INVALID_FRAMEBUFFER_OPERATION. All other functions that
+ use a resource whose bound flag for that context is false generate INVALID_OPERATION.
+ </p>
+ <p>
+ Note: In the specific case of programs, it is not an error to call draw with a program
+ or call useProgram for a program which has shaders that have
+ been acquired but not re-attached. Nor it is an error to draw with or call useProgram
+ for a program which has shaders that have not been acquired. It is an error to call linkProgram
+ for a program that is using shaders that have been acquired but not re-attached.
+ </p>
+ </feature>
+ <feature>
+ <p>
+ When an attempt is made to use a resource that is not acquired in the current context
+ the implementation must generate the error INVALID_OPERATION or INVALID_FRAMEBUFFER_OPRATION.
+ This includes all gl calls
+ that would access the given resource directly or indirectly. For example, a
+ draw call must fail if any of the resources it would access is not acquired in the
+ correct mode for the call. In other words, if the draw call would read from a buffer
+ or texture and that buffer or texture is not acquired for READ_ONLY or EXCLUSIVE mode the draw
+ must fail with INVALID_FRAMEBUFFER_OPERATION. If the draw would render to a texture or renderbuffer
+ that is not acquired for EXCLUSIVE mode the draw must fail and generate INVALID_FRAMEBUFFER_OPERATION.
+ If a program used in the draw is not acquired for READ_ONLY or EXCLUSIVE mode the draw or clear must fail
+ and generate INVALID_FRAMEBUFFER_OPERATION.
+ </p>
+ <p>
+ For buffers not acquired this includes but is not limited to
+ </p>
+ <pre>
+ bindBuffer
+ bufferData
+ bufferSubData
+ deleteBuffer
+ drawArrays
+ drawElements
+ getParameter with parameter (BUFFER_SIZE or BUFFER_USAGE)
+ isBuffer
+ vertexAttribPointer
+ </pre>
+ <p>
+ For a buffer acquired in READ_ONLY mode this includes but is not limited to
+ </p>
+ <pre>
+ bufferData
+ bufferSubData
+ </pre>
+ <p>
+ For programs not acquired this includes but is not limited to
+ </p>
+ <pre>
+ attachShader
+ bindAttribLocation
+ drawArrays
+ drawElements
+ deleteProgram
+ getActiveAttrib
+ getActiveUniform
+ getAttribLocation
+ getUniformLocation
+ getProgramParameter
+ getProgramInfoLog
+ isProgram
+ linkProgram
+ useProgram
+ validateProgram
+ </pre>
+ <p>
+ For programs acquired in READ_ONLY mode includes but is not limited to
+ </p>
+ <pre>
+ bindAttribLocation
+ deleteProgram
+ linkProgram
+ </pre>
+ <p>
+ For renderbuffers not acquired this includes but is not limited to
+ </p>
+ <pre>
+ bindRenderbuffer
+ clear
+ deleteRenderbuffer
+ drawArrays
+ drawElements
+ framebufferRenderbuffer
+ isRenderbuffer
+ renderbufferStorage
+ </pre>
+ <p>
+ For renderbuffers acquired in READ_ONLY mode this includes
+ </p>
+ <pre>
+ clear
+ deleteRenderbuffer
+ drawArrays
+ drawElements
+ renderbufferStorage
+ </pre>
+ <p>
+ For shaders not acquired this includes but is not limited to
+ </p>
+ <pre>
+ attachShader
+ compileShader
+ deleteShader
+ getShaderSource
+ getShaderParameter
+ isShader
+ shaderSource
+ </pre>
+ <p>
+ For shaders acquired in READ_ONLY mode this includes but is not limited to
+ </p>
+ <pre>
+ deleteShader
+ compileShader
+ shaderSource
+ </pre>
+ <p>
+ For textures not acquired this includes but is not limited to
+ </p>
+ <pre>
+ bindTexture
+ clear
+ compressedTexImage2D
+ compressedTexSubImage2D
+ copyTexImage2D
+ copyTexSubImage2D
+ drawArrays
+ drawElements
+ deleteTexture
+ framebufferTexture2D
+ getTexParameter
+ isTexture
+ texImage2D
+ texParameter
+ texSubImage2D
+ </pre>
+ <p>
+ For textures acquired in READ_ONLY mode this includes but is not limited to
+ </p>
+ <pre>
+ clear
+ compressedTexImage2D
+ compressedTexSubImage2D
+ copyTexImage2D
+ copyTexSubImage2D
+ drawArrays
+ drawElements
+ deleteTexture
+ texImage2D
+ texParameter
+ texSubImage2D
+ </pre>
+ <p>
+ The term "not limited to" is intended to point out that extension may enable
+ other functions to which these rule should apply. For example drawArraysInstancedANGLE
+ must follow the same rules as drawArrays.
+ </p>
+ </feature>
+ <feature>
+ <p>
+ Calling checkFramebufferStatus with the argument FRAMEBUFFER or DRAW_FRAMEBUFFER must
+ return FRAMEBUFFER_INCOMPLETE_ATTACHMENT if any of the resources referenced by the currently
+ bound framebuffer are not acquired for EXCLUSIVE access.
+ Calling checkFramebufferStatus with the argument READ_FRAMEBUFFER will return
+ FRAMEBUFFER_INCOMPLETE_ATTACHMENT if any of the resources referenced by the currently bound
+ framebuffer are not acquired for EXCLUSIVE or READ_ONLY access.
+ </p>
+ <p>
+ Note: This extension exposes the constants READ_FRAMEBUFFER and DRAW_FRAMEBUFFER only for
+ the purpose of calling checkFramebufferStatus. In particular, this extension does not enable
+ calling bindFramebuffer with either constant.
+ </p>
+ </feature>
+ <feature>
+ <p>
+ A context that is deleted automatically releases all resources it has acquired. Note that
+ currently there is no way to explicitly delete a context. Contexts are deleted through
+ garbage collection.
+ </p>
+ </feature>
+ <feature>
+ <p>
+ Note that implementing this extension changes the base class of the sharable resources.
+ Specifically: WebGLBuffer, WebGLProgram, WebGLRenderbuffer, WebGLShader, and WebGLTexture
+ change their base class from WebGLObject to WebGLSharedObject.
+ </p>
+ </feature>
+ </features>
+ </overview>
+ <issues>
+ <ul>
+ <li>
+ <div>
+ Q: What happens if one context deletes a resource another context is attempting to acquire?
+ </div>
+ <div>
+ A: Nothing special. The acquire will succeed when the context that currently has the resource
+ releases it. The context that acquires the resource can use the WebGLSharedObject
+ (buffer, texture, etc...) and will get the normal WebGL behavior associated with using
+ a deleted resource.
+ </div>
+ </li>
+ <li>
+ <div>
+ Q: Can you attach a resources that you have not acquired to a container?
+ </div>
+ <div>
+ A: No. An attachment can remain attached while it is released but it must be acquired
+ when attaching.
+ In particular a framebuffer attachment may not be attached to a framebuffer unless
+ the attachment is acquired. A shader may not be attached to a program unless the
+ shader is acquired. A buffer may not be attached to an attibute, vertexAttribPointer,
+ unless the buffer is acquired.
+ </div>
+ </li>
+ <li>
+ <div>
+ Q: What happens if you try to acquire a resource you already have acquired?
+ </div>
+ <div>
+ A: It will generate INVALID_OPERATION
+ </div>
+ </li>
+ </ul>
+ </issues>
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_shared_resources {
+ const GLenum READ_ONLY = 0x0001;
+ const GLenum EXCLUSIVE = 0x0004;
+
+ const GLenum READ_FRAMEBUFFER = 0x8CA8;
+ const GLenum DRAW_FRAMEBUFFER = 0x8CA9;
+
+ readonly attribute WebGLShareGroup group;
+
+ long acquireSharedResource(
+ WebGLSharedObject resource,
+ GLenum mode,
+ AcquireSharedResourcesCallback callback);
+ void releaseSharedResource(
+ WebGLSharedObject resource);
+ void cancelAcquireSharedResource(long id);
+};
+
+callback AcquireSharedResourcesCallback = void ();
+
+[NoInterfaceObject]
+interface WebGLShareGroup {
+};
+
+interface WebGLSharedObject : WebGLObject {
+};
+
+interface WebGLBuffer : WebGLSharedObject {
+};
+
+interface WebGLProgram : WebGLSharedObject {
+};
+
+interface WebGLRenderbuffer : WebGLSharedObject {
+};
+
+interface WebGLShader : WebGLSharedObject {
+};
+
+interface WebGLTexture : WebGLSharedObject {
+};
+ </idl>
+ <history>
+ <revision date="2012/02/06">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2013/05/14">
+ <change>Moved to draft after agreement in working group.</change>
+ </revision>
+ <revision date="2014/07/15">
+ <change>Added NoInterfaceObject extended attribute to extension interface and WebGLShareGroup.</change>
+ </revision>
+ <revision date="2018/05/02">
+ <change>Rejected after discussion on public_webgl and no strong objections. At this point in
+ the WebGL API's development it is not profitable to invest the time to implement this
+ extension. Alternatives: CanvasRenderingContext2D.drawImage taking a WebGL-rendered canvas as
+ argument, or using OffscreenCanvas.transferToImageBitmap with a WebGL-rendered canvas,
+ combined with ImageBitmapRenderingContext.transferFromImageBitmap.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_subscribe_uniform/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_subscribe_uniform/extension.xml
new file mode 100644
index 0000000000..ee85cdd4bd
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_subscribe_uniform/extension.xml
@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rejected href="rejected/WEBGL_subscribe_uniform/">
+ <name>WEBGL_subscribe_uniform</name>
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Owen Glofcheski, Google</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+
+ <overview id="overview">
+ <p> This extension exposes the ability to subscribe to a set of uniform targets
+ which can be used to populate uniforms within shader programs. This extension
+ is generic, but currently only supports mouse position as a subscription target.
+ </p><p>Background:
+ </p><p>The depth of the web pipeline makes it difficult to support low latency
+ interaction as event information retrieved via javascript
+ is outdated by the time it's displayed to clients. By populating event
+ information later in the pipeline one can reduce perceived input latency.
+ </p><p>This extension creates a new buffer type <code>'Valuebuffer'</code> to
+ maintain the active state for predefined subscription targets. Since a
+ mechanism for buffering uniform information isn't available pre 2.0 (UBOs)
+ an additional data type was needed. See 'New Types' for additional
+ information.</p>
+ <p> When this extension is enabled: </p>
+ <ul>
+ <li>This extension provides a mechanism to store mouse positional information
+ in buffers and defer modification of uniform variables which use mouse
+ positional information until the WebGL commands are executed.
+ </li>
+ <li>This extension provides a mechanism to explicitly update mouse
+ positional information to maintain per frame consistency.
+ </li>
+ </ul>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_subscribe_uniform {
+ const GLenum SUBSCRIBED_VALUES_BUFFER = 0x924B;
+
+ // subscription targets
+ const GLenum MOUSE_POSITION = 0x924C;
+
+ WebGLValuebuffer? createValuebuffer();
+ void deleteValuebuffer(WebGLValuebuffer? buffer);
+ void isValuebuffer(WebGLValuebuffer? buffer);
+ void bindValuebuffer(GLenum target, WebGLValuebuffer? buffer);
+
+ void subscribeValue(GLenum traget, GLenum subscription);
+ void populateSubscribedValues(GLenum target);
+ void uniformValuebuffer(WebGLUniformLocation? location, GLenum target, GLenum subscription);
+}; // interface WEBGL_subscribe_uniform
+ </idl>
+
+ <newfun>
+ <function name="createValuebuffer" type="WebGLValuebuffer">
+ Creates and returns a <code>Valuebuffer</code> object.</function>
+
+ <function name="deleteValuebuffer" type="void"><param
+ name="buffer" type="WebGLValuebuffer"/>Deletes a <code>Valuebuffer</code>
+ object.</function>
+
+ <function name="isValuebuffer" type="bool"><param
+ name="buffer" type="WebGLValuebuffer"/>Returns whether an object is a
+ <code>Valuebuffer</code> object.</function>
+
+ <function name="bindValuebuffer" type="void"><param
+ name="target" type="GLenum"/><param
+ name="buffer" type="WebGLValuebuffer"/>Lets you use a named
+ <code>Valuebuffer</code> object.</function>
+
+ <function name="subscribeValuebuffer" type="void"><param
+ name="target" type="GLenum"/><param
+ name="subscription" type="GLenum"/>Subscribes the currently bound
+ <code>Valuebuffer</code> object to a subscription target.</function>
+
+ <function name="populateSubscribedValues" type="void"><param
+ name="target" type="GLenum"/>Populates the currently bound
+ <code>Valuebuffer</code> object with the state of the subscriptions to
+ which it is subscribed.</function>
+
+ <function name="uniformValuebuffer" type="void"><param
+ name="location" type="WebGLUniformLocation"/><param
+ name="target" type="GLenum"/><param
+ name="subscription" type="GLenum"/>Modifies the value of a uniform variable
+ or uniform variable array using the state of the subscription target in the
+ currently bound <code>Valuebuffer</code> object.</function>
+ </newfun>
+
+ <newtypes>
+ <interface name="WebGLValuebuffer" noobject="true">
+ <p>This interface is used to maintain a reference to internal
+ <code>Valuebuffer</code> subscription states.</p>
+ </interface>
+ <p>A <code>Valuebuffer</code> abstracts the mapping of subscription targets to internal
+ state and acts as a single storage object for subscription information (e.g. current
+ mouse position). Clients can then use the objects data to populate uniform variables.</p>
+ <p>Post WebGL API 2.0, this abstraction could exist as a layer ontop of UBOs
+ which managers the mapping of subscription targets to internal state and the mapping
+ of subscription targets to offsets within the buffer. The UBO would be used to store the
+ active buffer state as well as the uniform location mapping. Clients would be required to
+ state all their subscription targets at once to allocate the appropriate amount of memory.
+ Aside from this small change the implementation is essentially the same, with UBOs replacing
+ <code>Valuebuffers</code> and relevant create, delete, bind methods being replaced.
+ Additionally, the inclusion of UBOs would replace the need for
+ <code>uniformValueBuffer(...)</code>.</p>
+ </newtypes>
+
+ <newtok>
+ <function name="bindValuebuffer" type="any"><param
+ name="target" type="GLenum"/><param
+ name="buffer" type="WebGLValuebuffer"/>
+ <p><code>SUBSCRIBED_VALUES_BUFFER</code>
+ is accepted as the target parameter to bindValuebuffer</p></function>
+
+ <function name="subscribeValuebuffer" type="void"><param
+ name="target" type="GLenum"/><param
+ name="subscription" type="GLenum"/>
+ <p><code>SUBSCRIBED_VALUES_BUFFER</code>
+ is accepted as the target parameter to subscribeValuebuffer</p>
+ <p><code>MOUSE_POSITION</code>
+ is accepted as the subscription parameter to subscribeValuebuffer</p></function>
+
+ <function name="populateSubscribedValues" type="void"><param
+ name="target" type="GLenum"/>
+ <p><code>SUBSCRIBED_VALUES_BUFFER</code>
+ is accepted as the target parameter to populateSubscribedValues</p></function>
+
+ <function name="uniformValuebuffer" type="void"><param
+ name="location" type="WebGLUniformLocation"/><param
+ name="target" type="GLenum"/><param
+ name="subscription" type="GLenum"/>
+ <p><code>SUBSCRIBED_VALUES_BUFFER</code>
+ is accepted as the target parameter to uniformValuebuffer</p>
+ <p><code>MOUSE_POSITION</code>
+ is accepted as the subscription parameter to uniformValuebuffer</p></function>
+ </newtok>
+
+ <samplecode><div class="example"><pre xml:space="preserve">
+&lt;script id="vshader" type="x-shader/x-vertex"&gt;
+ uniform ivec2 uMousePosition;
+
+ void main()
+ {
+ gl_Position = vec4(uMousePosition, 0, 1);
+ }
+&lt;/script&gt;
+
+function init(gl) {
+ shader.uMousePosition = gl.getUniformLocation(shader, "uMousePosition");
+ ...
+
+ var ext = gl.getExtension('WEBGL_subscribe_uniform');
+
+ // Create the value buffer and subscribe.
+ var valuebuffer = ext.createValuebuffer();
+ ext.bindValuebuffer(SUBSCRIBED_VALUES_BUFFER, valuebuffer);
+ ext.subscribeValue(MOUSE_POSITION);
+ ...
+}
+
+function draw(gl) {
+ // Populate buffer and populate uniform
+ ext.bindValuebuffer(SUBSCRIBED_VALUES_BUFFER, valuebuffer);
+ ext.populateSubscribedValues(SUBSCRIBED_VALUES_BUFFER);
+ ext.uniformValuebuffer(shader.uMousePosition,
+ SUBSCRIBED_VALUES_BUFFER,
+ MOUSE_POSITION);
+
+ gl.drawElements(...);
+}
+ </pre></div></samplecode>
+
+ <issues/>
+
+ <history>
+ <revision date="2014/11/13">
+ <change>Initial revision.</change>
+ </revision>
+
+ <revision date="2016/04/14">
+ <change>Moved to rejected state. Does not have a champion at this point. Was difficult to
+ reason about how to use the extension, given that the on-screen rendering would be farther
+ ahead than the application's state. Seems that the best solution is to focus on reducing the
+ depth, and therefore latency, of the browser's rendering pipeline.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_texture_from_depth_video/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_texture_from_depth_video/extension.xml
new file mode 100644
index 0000000000..da3cf2b595
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/rejected/WEBGL_texture_from_depth_video/extension.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<rejected href="rejected/WEBGL_texture_from_depth_video/">
+ <name>WEBGL_texture_from_depth_video</name>
+
+ <contact><a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <contributors>
+ <contributor>Ningxin Hu, Intel</contributor>
+ <contributor>Anssi Kostiainen, Intel</contributor>
+ <contributor>Rob Manson, buildAR</contributor>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>NN</number>
+
+ <depends>
+ <api version="1.0"/>
+ </depends>
+
+ <overview id="overview">
+
+ <p>This extension provides support for the <a
+ href="http://w3c.github.io/mediacapture-depth/">Media
+ Capture Depth Stream Extensions</a>. Specifically, it supports
+ uploading to a WebGL texture a <code>video</code> element whose
+ source is a <code>MediaStream</code> object containing a <a
+ href="http://w3c.github.io/mediacapture-depth/#dfn-depth-track">
+ depth track</a>.</p>
+
+ <features>
+ <feature>
+ A <code>video</code> element whose source is a <code>MediaStream</code>
+ object containing a <a
+ href="http://w3c.github.io/mediacapture-depth/#dfn-depth-track">
+ depth track</a> may be uploaded to a WebGL
+ texture of format <code>RGB</code> and type
+ <code>UNSIGNED_SHORT_5_6_5</code>.
+ </feature>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve">
+[NoInterfaceObject]
+interface WEBGL_texture_from_depth_video {
+};
+ </idl>
+
+ <samplecode>
+ <div class="example">
+
+ This code sets up a video element from a depth stream, uploads
+ it to a WebGL texture, and samples that texture in the fragment
+ shader, reconstructing the 16-bit depth values from the red,
+ green and blue channels.
+
+<pre xml:space="preserve">var ext = gl.getExtension("WEBGL_texture_from_depth_video");
+if (ext) {
+ navigator.getUserMedia({ video: true }, successVideo, failureVideo);
+}
+
+var depthVideo;
+
+function successVideo(s) {
+ // wire the stream into a &lt;video&gt; element for playback
+ depthVideo = document.querySelector('#video');
+ depthVideo.src = URL.createObjectURL(s);
+ depthVideo.play();
+}
+
+// ... later, in the rendering loop ...
+
+if (ext) {
+ gl.texImage2D(
+ gl.TEXTURE_2D,
+ 0,
+ gl.RGB,
+ gl.RGB,
+ gl.UNSIGNED_SHORT_5_6_5,
+ depthVideo
+ );
+}
+
+&lt;script id="fragment-shader" type="x-shader/x-fragment"&gt;
+ varying vec2 v_texCoord;
+ // u_tex points to the texture unit containing the depth texture.
+ uniform sampler2D u_tex;
+ void main() {
+ vec4 floatColor = texture2D(u_tex, v_texCoord);
+ vec3 rgb = floatColor.rgb;
+ ...
+ float depth = 63488. * rgb.r + 2016. * rgb.g + 31. * rgb.b;
+ ...
+ }
+&lt;/script&gt;</pre></div>
+ </samplecode>
+
+ <issues>
+ </issues>
+ <history>
+ <revision date="2014/11/03">
+ <change>Initial revision.</change>
+ </revision>
+ <revision date="2015/01/24">
+ <change>Moved to rejected on the grounds that it can be done without an extension.</change>
+ </revision>
+ </history>
+</rejected>
diff --git a/third_party/rust/khronos_api/api_webgl/extensions/template/extension.xml b/third_party/rust/khronos_api/api_webgl/extensions/template/extension.xml
new file mode 100644
index 0000000000..b80d3cad88
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/extensions/template/extension.xml
@@ -0,0 +1,226 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- The root element should be <draft href="~~"> for draft extensions -->
+<!-- The root element should be <proposal href="~~"> for proposed extensions -->
+<!-- The root element should be <ratified href="~~"> for ratified extensions -->
+<!-- @href should be a URI relative to the WebGL extension registry at
+http://www.khronos.org/registry/webgl/extensions/
+-->
+<extension href="template/">
+ <!-- The name of the extension. This is also the string which is passed to the
+ WebGLRenderingContext getExtension API to enable the extension. For example, if
+ the extension were OES_texture_float, then the extension would be fetched and
+ enabled with a call to getExtension("OES_texture_float")
+
+ Per WebGL convention, the 'GL_' prefix is dropped from all extension and enum
+ names, and the 'gl' prefix dropped from, and capitalization adjusted of, all
+ function names.
+ -->
+
+ <name>template</name>
+
+ <!-- The optional alternate name strings of the extension for draft exts -->
+
+ <aliases>
+ <alias>VENDOR_EXT_NAME</alias>
+
+ <alias>VENDOR_EXT_NAME</alias>
+ </aliases>
+
+ <!-- the email address of the contact of the specification -->
+
+ <!-- prefer to 'at' instead of the '@' character to reduce spam -->
+
+ <contact> <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL
+ working group</a> (public_webgl 'at' khronos.org) </contact>
+
+ <!-- Names and email addresses of individuals who contributed to the development of
+ the specification
+ -->
+
+ <contributors>
+ <contributor>Members of the WebGL working group</contributor>
+ </contributors>
+
+ <number>k <!-- extension number in registry --></number>
+
+ <depends>
+ <api version="1.0"/>
+
+ <core version="2.0"/>
+
+ <!-- Version in which the extension functionality was integrated into the core spec -->
+
+ <core version="2.0">
+ <glsl version="300 es"/>
+
+ <!-- GLSL #version required to use the feature, if any -->
+
+ <addendum> Difference in core spec from extension. </addendum>
+ </core>
+
+ <removed version="2.0"/>
+
+ <!-- Version as of which extension is no longer supported -->
+
+ <ext name="WEBGL_required_ext" require="true"/>
+
+ <ext name="WEBGL_base_ext"/>
+
+ <!-- api/extension with hyperlink -->
+ </depends>
+
+ <overview>
+ <!-- use mirrors if this extension wraps another -->
+
+ <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_texture_float.txt"
+ name="OES_texture_float">
+ <!-- list the deviations here if there are any -->
+
+ <addendum>Optional support for <code>FLOAT</code> textures as FBO
+ attachments.</addendum>
+
+ <!-- Tags not 'addendum' replace the default text that says
+ "Consult the above extension for documentation, issues and new functions and enumerants."
+ -->
+ </mirrors>
+
+ <!-- normal free-form XHTML is allowed here -->
+
+ <div class="nonnormative">
+ <p> This template for WebGL extensions is derived from the <a
+ href="http://www.opengl.org/registry/doc/template/txt">OpenGL extension
+ template</a>. Refer to the OpenGL extension template for full
+ documentation of the content that should be contained in the sections
+ below. Because WebGL is fundamentally a Web API, its extensions are
+ specified in XML transformed with XSLT into HTML for easier
+ hyperlinking. </p>
+
+ <p> Because most WebGL extensions are expected to simply mirror existing
+ OpenGL and OpenGL ES extensions, it is desirable to keep the WebGL
+ extension specifications as small as possible and simply refer to the
+ other specifications for the behavioral definitions. </p>
+ </div>
+
+ <features>
+ <!-- a list of features in XHTML -->
+
+ <feature>Frobs the <b>baz</b></feature>
+
+ <!-- can also specify glsl built-ins in structured format -->
+
+ <glsl extname="GL_OES_foo_bar">
+ <alias extname="GL_NV_foo_bar"/>
+
+ <alias extname="GL_ATI_foo_bar"/>
+
+ <stage type="fragment"/>
+
+ <stage type="vertex"/>
+
+ <function name="myfun" type="vec4">
+ <param type="vec4"/>
+ </function>
+ </glsl>
+ </features>
+ </overview>
+
+ <idl xml:space="preserve"> <!-- copied literally into a <pre> -->
+ <!-- Enums and functions introduced by the extension should be specified as
+ 'const GLenum' and methods on the extension object. The extension IDL should
+ be written assuming that the typedefs in
+ <a href="../../specs/latest/webgl.idl">webgl.idl</a> and
+ <a href="../../typedarray/specs/latest/typedarrays.idl">typedarrays.idl</a>
+ have already been defined, and may implicitly reference other web platform
+ specifications.
+ -->
+module webgl {
+
+interface OES_foo_bar {
+ const GLenum NEW_ENUM = 0xF00;
+
+ void doSomethingNew(GLenum state, GLuint value);
+}; // interface OES_foo_bar
+
+}; // module webgl
+ </idl>
+
+ <!-- new functions -->
+
+ <newfun>
+ <function name="loseContext" type="void"> XHTML description </function>
+ </newfun>
+
+ <!-- new types -->
+
+ <newtypes>
+ <typedef name="in_pipe"> <type>unsigned long long</type> XHTML </typedef>
+
+ <typedef name="out_pipe"> <type>unsigned long long</type> XHTML </typedef>
+
+ <interface name="Plumber">
+ <member>Plumber work(in_pipe,out_pipe);</member>
+
+ <p>After attempting a connection, the plumber is no longer the same.</p>
+ </interface>
+
+ <interface name="Agency" noobject="true"> <member>void
+ register(Plumber);</member> <member>Plumber find();</member> XHTML
+ </interface>
+ </newtypes>
+
+ <!-- new tokens -->
+
+ <newtok>
+ <function name="getParameter" type="any"> <param name="pname"
+ type="GLenum"/> XHTML </function>
+ </newtok>
+
+ <!-- Refer to the <http://www.opengl.org/registry/doc/template.txt> OpenGL
+ extension template for a description of these sections. These sections
+ should be eliminated for WebGL extensions simply mirroring OpenGL or
+ OpenGL ES extensions.
+ -->
+
+ <!-- these take XHTML markup as contents -->
+
+ <security/>
+
+ <ipstatus/>
+
+ <additions/>
+
+ <!-- Additions to the WebGL Specification -->
+
+ <errors/>
+
+ <newstate/>
+
+ <newimplstate/>
+
+ <!-- New Implementation-Dependent State -->
+
+ <samplecode/>
+
+ <tests/>
+
+ <issues/>
+
+ <history>
+ <!-- a list of revisions in any order -->
+
+ <!-- Include important changes in the evolution of the extension. It's
+ especially important to include this section if the extension is modified
+ after a version has been shipped. Consult the
+ <http://www.opengl.org/registry/doc/template.txt> OpenGL extension template
+ for an example.
+ -->
+
+ <revision date="YYYY/MM/DD">
+ <!-- a list of changes -->
+
+ <change>Quuxed the bar</change>
+
+ <change>Fooed the frob</change>
+ </revision>
+ </history>
+</extension>
diff --git a/third_party/rust/khronos_api/api_webgl/specs/latest/1.0/webgl.idl b/third_party/rust/khronos_api/api_webgl/specs/latest/1.0/webgl.idl
new file mode 100644
index 0000000000..826dfff0c5
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/specs/latest/1.0/webgl.idl
@@ -0,0 +1,760 @@
+// AUTOGENERATED FILE -- DO NOT EDIT -- SEE Makefile
+//
+// WebGL IDL definitions scraped from the Khronos specification:
+// https://www.khronos.org/registry/webgl/specs/latest/
+
+// Copyright (c) 2018 The Khronos Group Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and/or associated documentation files (the
+// "Materials"), to deal in the Materials without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Materials, and to
+// permit persons to whom the Materials are furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Materials.
+//
+// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+typedef unsigned long GLenum;
+typedef boolean GLboolean;
+typedef unsigned long GLbitfield;
+typedef byte GLbyte; /* 'byte' should be a signed 8 bit type. */
+typedef short GLshort;
+typedef long GLint;
+typedef long GLsizei;
+typedef long long GLintptr;
+typedef long long GLsizeiptr;
+// Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL.
+typedef octet GLubyte; /* 'octet' should be an unsigned 8 bit type. */
+typedef unsigned short GLushort;
+typedef unsigned long GLuint;
+typedef unrestricted float GLfloat;
+typedef unrestricted float GLclampf;
+
+// The power preference settings are documented in the WebGLContextAttributes
+// section of the specification.
+enum WebGLPowerPreference { "default", "low-power", "high-performance" };
+
+
+dictionary WebGLContextAttributes {
+ GLboolean alpha = true;
+ GLboolean depth = true;
+ GLboolean stencil = false;
+ GLboolean antialias = true;
+ GLboolean premultipliedAlpha = true;
+ GLboolean preserveDrawingBuffer = false;
+ WebGLPowerPreference powerPreference = "default";
+ GLboolean failIfMajorPerformanceCaveat = false;
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLBuffer : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLFramebuffer : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLProgram : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLRenderbuffer : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLShader : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLTexture : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLUniformLocation {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLActiveInfo {
+ readonly attribute GLint size;
+ readonly attribute GLenum type;
+ readonly attribute DOMString name;
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLShaderPrecisionFormat {
+ readonly attribute GLint rangeMin;
+ readonly attribute GLint rangeMax;
+ readonly attribute GLint precision;
+};
+
+typedef (ImageBitmap or
+ ImageData or
+ HTMLImageElement or
+ HTMLCanvasElement or
+ HTMLVideoElement) TexImageSource;
+
+typedef ([AllowShared] Float32Array or sequence<GLfloat>) Float32List;
+typedef ([AllowShared] Int32Array or sequence<GLint>) Int32List;
+
+interface mixin WebGLRenderingContextBase
+{
+
+ /* ClearBufferMask */
+ const GLenum DEPTH_BUFFER_BIT = 0x00000100;
+ const GLenum STENCIL_BUFFER_BIT = 0x00000400;
+ const GLenum COLOR_BUFFER_BIT = 0x00004000;
+
+ /* BeginMode */
+ const GLenum POINTS = 0x0000;
+ const GLenum LINES = 0x0001;
+ const GLenum LINE_LOOP = 0x0002;
+ const GLenum LINE_STRIP = 0x0003;
+ const GLenum TRIANGLES = 0x0004;
+ const GLenum TRIANGLE_STRIP = 0x0005;
+ const GLenum TRIANGLE_FAN = 0x0006;
+
+ /* AlphaFunction (not supported in ES20) */
+ /* NEVER */
+ /* LESS */
+ /* EQUAL */
+ /* LEQUAL */
+ /* GREATER */
+ /* NOTEQUAL */
+ /* GEQUAL */
+ /* ALWAYS */
+
+ /* BlendingFactorDest */
+ const GLenum ZERO = 0;
+ const GLenum ONE = 1;
+ const GLenum SRC_COLOR = 0x0300;
+ const GLenum ONE_MINUS_SRC_COLOR = 0x0301;
+ const GLenum SRC_ALPHA = 0x0302;
+ const GLenum ONE_MINUS_SRC_ALPHA = 0x0303;
+ const GLenum DST_ALPHA = 0x0304;
+ const GLenum ONE_MINUS_DST_ALPHA = 0x0305;
+
+ /* BlendingFactorSrc */
+ /* ZERO */
+ /* ONE */
+ const GLenum DST_COLOR = 0x0306;
+ const GLenum ONE_MINUS_DST_COLOR = 0x0307;
+ const GLenum SRC_ALPHA_SATURATE = 0x0308;
+ /* SRC_ALPHA */
+ /* ONE_MINUS_SRC_ALPHA */
+ /* DST_ALPHA */
+ /* ONE_MINUS_DST_ALPHA */
+
+ /* BlendEquationSeparate */
+ const GLenum FUNC_ADD = 0x8006;
+ const GLenum BLEND_EQUATION = 0x8009;
+ const GLenum BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */
+ const GLenum BLEND_EQUATION_ALPHA = 0x883D;
+
+ /* BlendSubtract */
+ const GLenum FUNC_SUBTRACT = 0x800A;
+ const GLenum FUNC_REVERSE_SUBTRACT = 0x800B;
+
+ /* Separate Blend Functions */
+ const GLenum BLEND_DST_RGB = 0x80C8;
+ const GLenum BLEND_SRC_RGB = 0x80C9;
+ const GLenum BLEND_DST_ALPHA = 0x80CA;
+ const GLenum BLEND_SRC_ALPHA = 0x80CB;
+ const GLenum CONSTANT_COLOR = 0x8001;
+ const GLenum ONE_MINUS_CONSTANT_COLOR = 0x8002;
+ const GLenum CONSTANT_ALPHA = 0x8003;
+ const GLenum ONE_MINUS_CONSTANT_ALPHA = 0x8004;
+ const GLenum BLEND_COLOR = 0x8005;
+
+ /* Buffer Objects */
+ const GLenum ARRAY_BUFFER = 0x8892;
+ const GLenum ELEMENT_ARRAY_BUFFER = 0x8893;
+ const GLenum ARRAY_BUFFER_BINDING = 0x8894;
+ const GLenum ELEMENT_ARRAY_BUFFER_BINDING = 0x8895;
+
+ const GLenum STREAM_DRAW = 0x88E0;
+ const GLenum STATIC_DRAW = 0x88E4;
+ const GLenum DYNAMIC_DRAW = 0x88E8;
+
+ const GLenum BUFFER_SIZE = 0x8764;
+ const GLenum BUFFER_USAGE = 0x8765;
+
+ const GLenum CURRENT_VERTEX_ATTRIB = 0x8626;
+
+ /* CullFaceMode */
+ const GLenum FRONT = 0x0404;
+ const GLenum BACK = 0x0405;
+ const GLenum FRONT_AND_BACK = 0x0408;
+
+ /* DepthFunction */
+ /* NEVER */
+ /* LESS */
+ /* EQUAL */
+ /* LEQUAL */
+ /* GREATER */
+ /* NOTEQUAL */
+ /* GEQUAL */
+ /* ALWAYS */
+
+ /* EnableCap */
+ /* TEXTURE_2D */
+ const GLenum CULL_FACE = 0x0B44;
+ const GLenum BLEND = 0x0BE2;
+ const GLenum DITHER = 0x0BD0;
+ const GLenum STENCIL_TEST = 0x0B90;
+ const GLenum DEPTH_TEST = 0x0B71;
+ const GLenum SCISSOR_TEST = 0x0C11;
+ const GLenum POLYGON_OFFSET_FILL = 0x8037;
+ const GLenum SAMPLE_ALPHA_TO_COVERAGE = 0x809E;
+ const GLenum SAMPLE_COVERAGE = 0x80A0;
+
+ /* ErrorCode */
+ const GLenum NO_ERROR = 0;
+ const GLenum INVALID_ENUM = 0x0500;
+ const GLenum INVALID_VALUE = 0x0501;
+ const GLenum INVALID_OPERATION = 0x0502;
+ const GLenum OUT_OF_MEMORY = 0x0505;
+
+ /* FrontFaceDirection */
+ const GLenum CW = 0x0900;
+ const GLenum CCW = 0x0901;
+
+ /* GetPName */
+ const GLenum LINE_WIDTH = 0x0B21;
+ const GLenum ALIASED_POINT_SIZE_RANGE = 0x846D;
+ const GLenum ALIASED_LINE_WIDTH_RANGE = 0x846E;
+ const GLenum CULL_FACE_MODE = 0x0B45;
+ const GLenum FRONT_FACE = 0x0B46;
+ const GLenum DEPTH_RANGE = 0x0B70;
+ const GLenum DEPTH_WRITEMASK = 0x0B72;
+ const GLenum DEPTH_CLEAR_VALUE = 0x0B73;
+ const GLenum DEPTH_FUNC = 0x0B74;
+ const GLenum STENCIL_CLEAR_VALUE = 0x0B91;
+ const GLenum STENCIL_FUNC = 0x0B92;
+ const GLenum STENCIL_FAIL = 0x0B94;
+ const GLenum STENCIL_PASS_DEPTH_FAIL = 0x0B95;
+ const GLenum STENCIL_PASS_DEPTH_PASS = 0x0B96;
+ const GLenum STENCIL_REF = 0x0B97;
+ const GLenum STENCIL_VALUE_MASK = 0x0B93;
+ const GLenum STENCIL_WRITEMASK = 0x0B98;
+ const GLenum STENCIL_BACK_FUNC = 0x8800;
+ const GLenum STENCIL_BACK_FAIL = 0x8801;
+ const GLenum STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802;
+ const GLenum STENCIL_BACK_PASS_DEPTH_PASS = 0x8803;
+ const GLenum STENCIL_BACK_REF = 0x8CA3;
+ const GLenum STENCIL_BACK_VALUE_MASK = 0x8CA4;
+ const GLenum STENCIL_BACK_WRITEMASK = 0x8CA5;
+ const GLenum VIEWPORT = 0x0BA2;
+ const GLenum SCISSOR_BOX = 0x0C10;
+ /* SCISSOR_TEST */
+ const GLenum COLOR_CLEAR_VALUE = 0x0C22;
+ const GLenum COLOR_WRITEMASK = 0x0C23;
+ const GLenum UNPACK_ALIGNMENT = 0x0CF5;
+ const GLenum PACK_ALIGNMENT = 0x0D05;
+ const GLenum MAX_TEXTURE_SIZE = 0x0D33;
+ const GLenum MAX_VIEWPORT_DIMS = 0x0D3A;
+ const GLenum SUBPIXEL_BITS = 0x0D50;
+ const GLenum RED_BITS = 0x0D52;
+ const GLenum GREEN_BITS = 0x0D53;
+ const GLenum BLUE_BITS = 0x0D54;
+ const GLenum ALPHA_BITS = 0x0D55;
+ const GLenum DEPTH_BITS = 0x0D56;
+ const GLenum STENCIL_BITS = 0x0D57;
+ const GLenum POLYGON_OFFSET_UNITS = 0x2A00;
+ /* POLYGON_OFFSET_FILL */
+ const GLenum POLYGON_OFFSET_FACTOR = 0x8038;
+ const GLenum TEXTURE_BINDING_2D = 0x8069;
+ const GLenum SAMPLE_BUFFERS = 0x80A8;
+ const GLenum SAMPLES = 0x80A9;
+ const GLenum SAMPLE_COVERAGE_VALUE = 0x80AA;
+ const GLenum SAMPLE_COVERAGE_INVERT = 0x80AB;
+
+ /* GetTextureParameter */
+ /* TEXTURE_MAG_FILTER */
+ /* TEXTURE_MIN_FILTER */
+ /* TEXTURE_WRAP_S */
+ /* TEXTURE_WRAP_T */
+
+ const GLenum COMPRESSED_TEXTURE_FORMATS = 0x86A3;
+
+ /* HintMode */
+ const GLenum DONT_CARE = 0x1100;
+ const GLenum FASTEST = 0x1101;
+ const GLenum NICEST = 0x1102;
+
+ /* HintTarget */
+ const GLenum GENERATE_MIPMAP_HINT = 0x8192;
+
+ /* DataType */
+ const GLenum BYTE = 0x1400;
+ const GLenum UNSIGNED_BYTE = 0x1401;
+ const GLenum SHORT = 0x1402;
+ const GLenum UNSIGNED_SHORT = 0x1403;
+ const GLenum INT = 0x1404;
+ const GLenum UNSIGNED_INT = 0x1405;
+ const GLenum FLOAT = 0x1406;
+
+ /* PixelFormat */
+ const GLenum DEPTH_COMPONENT = 0x1902;
+ const GLenum ALPHA = 0x1906;
+ const GLenum RGB = 0x1907;
+ const GLenum RGBA = 0x1908;
+ const GLenum LUMINANCE = 0x1909;
+ const GLenum LUMINANCE_ALPHA = 0x190A;
+
+ /* PixelType */
+ /* UNSIGNED_BYTE */
+ const GLenum UNSIGNED_SHORT_4_4_4_4 = 0x8033;
+ const GLenum UNSIGNED_SHORT_5_5_5_1 = 0x8034;
+ const GLenum UNSIGNED_SHORT_5_6_5 = 0x8363;
+
+ /* Shaders */
+ const GLenum FRAGMENT_SHADER = 0x8B30;
+ const GLenum VERTEX_SHADER = 0x8B31;
+ const GLenum MAX_VERTEX_ATTRIBS = 0x8869;
+ const GLenum MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB;
+ const GLenum MAX_VARYING_VECTORS = 0x8DFC;
+ const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
+ const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C;
+ const GLenum MAX_TEXTURE_IMAGE_UNITS = 0x8872;
+ const GLenum MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD;
+ const GLenum SHADER_TYPE = 0x8B4F;
+ const GLenum DELETE_STATUS = 0x8B80;
+ const GLenum LINK_STATUS = 0x8B82;
+ const GLenum VALIDATE_STATUS = 0x8B83;
+ const GLenum ATTACHED_SHADERS = 0x8B85;
+ const GLenum ACTIVE_UNIFORMS = 0x8B86;
+ const GLenum ACTIVE_ATTRIBUTES = 0x8B89;
+ const GLenum SHADING_LANGUAGE_VERSION = 0x8B8C;
+ const GLenum CURRENT_PROGRAM = 0x8B8D;
+
+ /* StencilFunction */
+ const GLenum NEVER = 0x0200;
+ const GLenum LESS = 0x0201;
+ const GLenum EQUAL = 0x0202;
+ const GLenum LEQUAL = 0x0203;
+ const GLenum GREATER = 0x0204;
+ const GLenum NOTEQUAL = 0x0205;
+ const GLenum GEQUAL = 0x0206;
+ const GLenum ALWAYS = 0x0207;
+
+ /* StencilOp */
+ /* ZERO */
+ const GLenum KEEP = 0x1E00;
+ const GLenum REPLACE = 0x1E01;
+ const GLenum INCR = 0x1E02;
+ const GLenum DECR = 0x1E03;
+ const GLenum INVERT = 0x150A;
+ const GLenum INCR_WRAP = 0x8507;
+ const GLenum DECR_WRAP = 0x8508;
+
+ /* StringName */
+ const GLenum VENDOR = 0x1F00;
+ const GLenum RENDERER = 0x1F01;
+ const GLenum VERSION = 0x1F02;
+
+ /* TextureMagFilter */
+ const GLenum NEAREST = 0x2600;
+ const GLenum LINEAR = 0x2601;
+
+ /* TextureMinFilter */
+ /* NEAREST */
+ /* LINEAR */
+ const GLenum NEAREST_MIPMAP_NEAREST = 0x2700;
+ const GLenum LINEAR_MIPMAP_NEAREST = 0x2701;
+ const GLenum NEAREST_MIPMAP_LINEAR = 0x2702;
+ const GLenum LINEAR_MIPMAP_LINEAR = 0x2703;
+
+ /* TextureParameterName */
+ const GLenum TEXTURE_MAG_FILTER = 0x2800;
+ const GLenum TEXTURE_MIN_FILTER = 0x2801;
+ const GLenum TEXTURE_WRAP_S = 0x2802;
+ const GLenum TEXTURE_WRAP_T = 0x2803;
+
+ /* TextureTarget */
+ const GLenum TEXTURE_2D = 0x0DE1;
+ const GLenum TEXTURE = 0x1702;
+
+ const GLenum TEXTURE_CUBE_MAP = 0x8513;
+ const GLenum TEXTURE_BINDING_CUBE_MAP = 0x8514;
+ const GLenum TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515;
+ const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516;
+ const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517;
+ const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518;
+ const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519;
+ const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A;
+ const GLenum MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C;
+
+ /* TextureUnit */
+ const GLenum TEXTURE0 = 0x84C0;
+ const GLenum TEXTURE1 = 0x84C1;
+ const GLenum TEXTURE2 = 0x84C2;
+ const GLenum TEXTURE3 = 0x84C3;
+ const GLenum TEXTURE4 = 0x84C4;
+ const GLenum TEXTURE5 = 0x84C5;
+ const GLenum TEXTURE6 = 0x84C6;
+ const GLenum TEXTURE7 = 0x84C7;
+ const GLenum TEXTURE8 = 0x84C8;
+ const GLenum TEXTURE9 = 0x84C9;
+ const GLenum TEXTURE10 = 0x84CA;
+ const GLenum TEXTURE11 = 0x84CB;
+ const GLenum TEXTURE12 = 0x84CC;
+ const GLenum TEXTURE13 = 0x84CD;
+ const GLenum TEXTURE14 = 0x84CE;
+ const GLenum TEXTURE15 = 0x84CF;
+ const GLenum TEXTURE16 = 0x84D0;
+ const GLenum TEXTURE17 = 0x84D1;
+ const GLenum TEXTURE18 = 0x84D2;
+ const GLenum TEXTURE19 = 0x84D3;
+ const GLenum TEXTURE20 = 0x84D4;
+ const GLenum TEXTURE21 = 0x84D5;
+ const GLenum TEXTURE22 = 0x84D6;
+ const GLenum TEXTURE23 = 0x84D7;
+ const GLenum TEXTURE24 = 0x84D8;
+ const GLenum TEXTURE25 = 0x84D9;
+ const GLenum TEXTURE26 = 0x84DA;
+ const GLenum TEXTURE27 = 0x84DB;
+ const GLenum TEXTURE28 = 0x84DC;
+ const GLenum TEXTURE29 = 0x84DD;
+ const GLenum TEXTURE30 = 0x84DE;
+ const GLenum TEXTURE31 = 0x84DF;
+ const GLenum ACTIVE_TEXTURE = 0x84E0;
+
+ /* TextureWrapMode */
+ const GLenum REPEAT = 0x2901;
+ const GLenum CLAMP_TO_EDGE = 0x812F;
+ const GLenum MIRRORED_REPEAT = 0x8370;
+
+ /* Uniform Types */
+ const GLenum FLOAT_VEC2 = 0x8B50;
+ const GLenum FLOAT_VEC3 = 0x8B51;
+ const GLenum FLOAT_VEC4 = 0x8B52;
+ const GLenum INT_VEC2 = 0x8B53;
+ const GLenum INT_VEC3 = 0x8B54;
+ const GLenum INT_VEC4 = 0x8B55;
+ const GLenum BOOL = 0x8B56;
+ const GLenum BOOL_VEC2 = 0x8B57;
+ const GLenum BOOL_VEC3 = 0x8B58;
+ const GLenum BOOL_VEC4 = 0x8B59;
+ const GLenum FLOAT_MAT2 = 0x8B5A;
+ const GLenum FLOAT_MAT3 = 0x8B5B;
+ const GLenum FLOAT_MAT4 = 0x8B5C;
+ const GLenum SAMPLER_2D = 0x8B5E;
+ const GLenum SAMPLER_CUBE = 0x8B60;
+
+ /* Vertex Arrays */
+ const GLenum VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622;
+ const GLenum VERTEX_ATTRIB_ARRAY_SIZE = 0x8623;
+ const GLenum VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624;
+ const GLenum VERTEX_ATTRIB_ARRAY_TYPE = 0x8625;
+ const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A;
+ const GLenum VERTEX_ATTRIB_ARRAY_POINTER = 0x8645;
+ const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
+
+ /* Read Format */
+ const GLenum IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A;
+ const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
+
+ /* Shader Source */
+ const GLenum COMPILE_STATUS = 0x8B81;
+
+ /* Shader Precision-Specified Types */
+ const GLenum LOW_FLOAT = 0x8DF0;
+ const GLenum MEDIUM_FLOAT = 0x8DF1;
+ const GLenum HIGH_FLOAT = 0x8DF2;
+ const GLenum LOW_INT = 0x8DF3;
+ const GLenum MEDIUM_INT = 0x8DF4;
+ const GLenum HIGH_INT = 0x8DF5;
+
+ /* Framebuffer Object. */
+ const GLenum FRAMEBUFFER = 0x8D40;
+ const GLenum RENDERBUFFER = 0x8D41;
+
+ const GLenum RGBA4 = 0x8056;
+ const GLenum RGB5_A1 = 0x8057;
+ const GLenum RGB565 = 0x8D62;
+ const GLenum DEPTH_COMPONENT16 = 0x81A5;
+ const GLenum STENCIL_INDEX8 = 0x8D48;
+ const GLenum DEPTH_STENCIL = 0x84F9;
+
+ const GLenum RENDERBUFFER_WIDTH = 0x8D42;
+ const GLenum RENDERBUFFER_HEIGHT = 0x8D43;
+ const GLenum RENDERBUFFER_INTERNAL_FORMAT = 0x8D44;
+ const GLenum RENDERBUFFER_RED_SIZE = 0x8D50;
+ const GLenum RENDERBUFFER_GREEN_SIZE = 0x8D51;
+ const GLenum RENDERBUFFER_BLUE_SIZE = 0x8D52;
+ const GLenum RENDERBUFFER_ALPHA_SIZE = 0x8D53;
+ const GLenum RENDERBUFFER_DEPTH_SIZE = 0x8D54;
+ const GLenum RENDERBUFFER_STENCIL_SIZE = 0x8D55;
+
+ const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0;
+ const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1;
+ const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2;
+ const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
+
+ const GLenum COLOR_ATTACHMENT0 = 0x8CE0;
+ const GLenum DEPTH_ATTACHMENT = 0x8D00;
+ const GLenum STENCIL_ATTACHMENT = 0x8D20;
+ const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
+
+ const GLenum NONE = 0;
+
+ const GLenum FRAMEBUFFER_COMPLETE = 0x8CD5;
+ const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6;
+ const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
+ const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9;
+ const GLenum FRAMEBUFFER_UNSUPPORTED = 0x8CDD;
+
+ const GLenum FRAMEBUFFER_BINDING = 0x8CA6;
+ const GLenum RENDERBUFFER_BINDING = 0x8CA7;
+ const GLenum MAX_RENDERBUFFER_SIZE = 0x84E8;
+
+ const GLenum INVALID_FRAMEBUFFER_OPERATION = 0x0506;
+
+ /* WebGL-specific enums */
+ const GLenum UNPACK_FLIP_Y_WEBGL = 0x9240;
+ const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
+ const GLenum CONTEXT_LOST_WEBGL = 0x9242;
+ const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
+ const GLenum BROWSER_DEFAULT_WEBGL = 0x9244;
+
+ [Exposed=Window] readonly attribute HTMLCanvasElement canvas;
+ readonly attribute GLsizei drawingBufferWidth;
+ readonly attribute GLsizei drawingBufferHeight;
+
+ [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
+ [WebGLHandlesContextLoss] boolean isContextLost();
+
+ sequence<DOMString>? getSupportedExtensions();
+ object? getExtension(DOMString name);
+
+ void activeTexture(GLenum texture);
+ void attachShader(WebGLProgram program, WebGLShader shader);
+ void bindAttribLocation(WebGLProgram program, GLuint index, DOMString name);
+ void bindBuffer(GLenum target, WebGLBuffer? buffer);
+ void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
+ void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
+ void bindTexture(GLenum target, WebGLTexture? texture);
+ void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+ void blendEquation(GLenum mode);
+ void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
+ void blendFunc(GLenum sfactor, GLenum dfactor);
+ void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
+ GLenum srcAlpha, GLenum dstAlpha);
+
+ void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
+ void bufferData(GLenum target, [AllowShared] BufferSource? data, GLenum usage);
+ void bufferSubData(GLenum target, GLintptr offset, [AllowShared] BufferSource data);
+
+ [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
+ void clear(GLbitfield mask);
+ void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+ void clearDepth(GLclampf depth);
+ void clearStencil(GLint s);
+ void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+ void compileShader(WebGLShader shader);
+
+ void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
+ GLsizei width, GLsizei height, GLint border,
+ [AllowShared] ArrayBufferView data);
+ void compressedTexSubImage2D(GLenum target, GLint level,
+ GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format,
+ [AllowShared] ArrayBufferView data);
+
+ void copyTexImage2D(GLenum target, GLint level, GLenum internalformat,
+ GLint x, GLint y, GLsizei width, GLsizei height,
+ GLint border);
+ void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
+
+ WebGLBuffer? createBuffer();
+ WebGLFramebuffer? createFramebuffer();
+ WebGLProgram? createProgram();
+ WebGLRenderbuffer? createRenderbuffer();
+ WebGLShader? createShader(GLenum type);
+ WebGLTexture? createTexture();
+
+ void cullFace(GLenum mode);
+
+ void deleteBuffer(WebGLBuffer? buffer);
+ void deleteFramebuffer(WebGLFramebuffer? framebuffer);
+ void deleteProgram(WebGLProgram? program);
+ void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
+ void deleteShader(WebGLShader? shader);
+ void deleteTexture(WebGLTexture? texture);
+
+ void depthFunc(GLenum func);
+ void depthMask(GLboolean flag);
+ void depthRange(GLclampf zNear, GLclampf zFar);
+ void detachShader(WebGLProgram program, WebGLShader shader);
+ void disable(GLenum cap);
+ void disableVertexAttribArray(GLuint index);
+ void drawArrays(GLenum mode, GLint first, GLsizei count);
+ void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset);
+
+ void enable(GLenum cap);
+ void enableVertexAttribArray(GLuint index);
+ void finish();
+ void flush();
+ void framebufferRenderbuffer(GLenum target, GLenum attachment,
+ GLenum renderbuffertarget,
+ WebGLRenderbuffer? renderbuffer);
+ void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
+ WebGLTexture? texture, GLint level);
+ void frontFace(GLenum mode);
+
+ void generateMipmap(GLenum target);
+
+ WebGLActiveInfo? getActiveAttrib(WebGLProgram program, GLuint index);
+ WebGLActiveInfo? getActiveUniform(WebGLProgram program, GLuint index);
+ sequence<WebGLShader>? getAttachedShaders(WebGLProgram program);
+
+ [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram program, DOMString name);
+
+ any getBufferParameter(GLenum target, GLenum pname);
+ any getParameter(GLenum pname);
+
+ [WebGLHandlesContextLoss] GLenum getError();
+
+ any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
+ GLenum pname);
+ any getProgramParameter(WebGLProgram program, GLenum pname);
+ DOMString? getProgramInfoLog(WebGLProgram program);
+ any getRenderbufferParameter(GLenum target, GLenum pname);
+ any getShaderParameter(WebGLShader shader, GLenum pname);
+ WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
+ DOMString? getShaderInfoLog(WebGLShader shader);
+
+ DOMString? getShaderSource(WebGLShader shader);
+
+ any getTexParameter(GLenum target, GLenum pname);
+
+ any getUniform(WebGLProgram program, WebGLUniformLocation location);
+
+ WebGLUniformLocation? getUniformLocation(WebGLProgram program, DOMString name);
+
+ any getVertexAttrib(GLuint index, GLenum pname);
+
+ [WebGLHandlesContextLoss] GLintptr getVertexAttribOffset(GLuint index, GLenum pname);
+
+ void hint(GLenum target, GLenum mode);
+ [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer);
+ [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap);
+ [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
+ [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program);
+ [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
+ [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
+ [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
+ void lineWidth(GLfloat width);
+ void linkProgram(WebGLProgram program);
+ void pixelStorei(GLenum pname, GLint param);
+ void polygonOffset(GLfloat factor, GLfloat units);
+
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
+ GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
+
+ void renderbufferStorage(GLenum target, GLenum internalformat,
+ GLsizei width, GLsizei height);
+ void sampleCoverage(GLclampf value, GLboolean invert);
+ void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
+
+ void shaderSource(WebGLShader shader, DOMString source);
+
+ void stencilFunc(GLenum func, GLint ref, GLuint mask);
+ void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
+ void stencilMask(GLuint mask);
+ void stencilMaskSeparate(GLenum face, GLuint mask);
+ void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
+ void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
+
+ void texImage2D(GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLsizei height, GLint border, GLenum format,
+ GLenum type, [AllowShared] ArrayBufferView? pixels);
+ void texImage2D(GLenum target, GLint level, GLint internalformat,
+ GLenum format, GLenum type, TexImageSource source); // May throw DOMException
+
+ void texParameterf(GLenum target, GLenum pname, GLfloat param);
+ void texParameteri(GLenum target, GLenum pname, GLint param);
+
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLenum format, GLenum type, TexImageSource source); // May throw DOMException
+
+ void uniform1f(WebGLUniformLocation? location, GLfloat x);
+ void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
+ void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
+ void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+ void uniform1i(WebGLUniformLocation? location, GLint x);
+ void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
+ void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
+ void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
+
+ void uniform1fv(WebGLUniformLocation? location, Float32List v);
+ void uniform2fv(WebGLUniformLocation? location, Float32List v);
+ void uniform3fv(WebGLUniformLocation? location, Float32List v);
+ void uniform4fv(WebGLUniformLocation? location, Float32List v);
+
+ void uniform1iv(WebGLUniformLocation? location, Int32List v);
+ void uniform2iv(WebGLUniformLocation? location, Int32List v);
+ void uniform3iv(WebGLUniformLocation? location, Int32List v);
+ void uniform4iv(WebGLUniformLocation? location, Int32List v);
+
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
+
+ void useProgram(WebGLProgram? program);
+ void validateProgram(WebGLProgram program);
+
+ void vertexAttrib1f(GLuint index, GLfloat x);
+ void vertexAttrib2f(GLuint index, GLfloat x, GLfloat y);
+ void vertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z);
+ void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+
+ void vertexAttrib1fv(GLuint index, Float32List values);
+ void vertexAttrib2fv(GLuint index, Float32List values);
+ void vertexAttrib3fv(GLuint index, Float32List values);
+ void vertexAttrib4fv(GLuint index, Float32List values);
+
+ void vertexAttribPointer(GLuint index, GLint size, GLenum type,
+ GLboolean normalized, GLsizei stride, GLintptr offset);
+
+ void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLRenderingContext
+{
+};
+WebGLRenderingContext includes WebGLRenderingContextBase;
+
+
+[Exposed=(Window,Worker),
+ Constructor(DOMString type,
+ optional WebGLContextEventInit eventInit)]
+interface WebGLContextEvent : Event {
+ readonly attribute DOMString statusMessage;
+};
+
+// EventInit is defined in the DOM4 specification.
+dictionary WebGLContextEventInit : EventInit {
+ DOMString statusMessage = "";
+};
diff --git a/third_party/rust/khronos_api/api_webgl/specs/latest/2.0/webgl2.idl b/third_party/rust/khronos_api/api_webgl/specs/latest/2.0/webgl2.idl
new file mode 100644
index 0000000000..8c565276de
--- /dev/null
+++ b/third_party/rust/khronos_api/api_webgl/specs/latest/2.0/webgl2.idl
@@ -0,0 +1,604 @@
+// AUTOGENERATED FILE -- DO NOT EDIT -- SEE Makefile
+//
+// WebGL IDL definitions scraped from the Khronos specification:
+// https://www.khronos.org/registry/webgl/specs/latest/
+
+// Copyright (c) 2018 The Khronos Group Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and/or associated documentation files (the
+// "Materials"), to deal in the Materials without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Materials, and to
+// permit persons to whom the Materials are furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Materials.
+//
+// THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+// MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
+
+typedef long long GLint64;
+typedef unsigned long long GLuint64;
+
+
+[Exposed=(Window,Worker)]
+interface WebGLQuery : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLSampler : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLSync : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLTransformFeedback : WebGLObject {
+};
+
+[Exposed=(Window,Worker)]
+interface WebGLVertexArrayObject : WebGLObject {
+};
+
+typedef ([AllowShared] Uint32Array or sequence<GLuint>) Uint32List;
+
+interface mixin WebGL2RenderingContextBase
+{
+ const GLenum READ_BUFFER = 0x0C02;
+ const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
+ const GLenum UNPACK_SKIP_ROWS = 0x0CF3;
+ const GLenum UNPACK_SKIP_PIXELS = 0x0CF4;
+ const GLenum PACK_ROW_LENGTH = 0x0D02;
+ const GLenum PACK_SKIP_ROWS = 0x0D03;
+ const GLenum PACK_SKIP_PIXELS = 0x0D04;
+ const GLenum COLOR = 0x1800;
+ const GLenum DEPTH = 0x1801;
+ const GLenum STENCIL = 0x1802;
+ const GLenum RED = 0x1903;
+ const GLenum RGB8 = 0x8051;
+ const GLenum RGBA8 = 0x8058;
+ const GLenum RGB10_A2 = 0x8059;
+ const GLenum TEXTURE_BINDING_3D = 0x806A;
+ const GLenum UNPACK_SKIP_IMAGES = 0x806D;
+ const GLenum UNPACK_IMAGE_HEIGHT = 0x806E;
+ const GLenum TEXTURE_3D = 0x806F;
+ const GLenum TEXTURE_WRAP_R = 0x8072;
+ const GLenum MAX_3D_TEXTURE_SIZE = 0x8073;
+ const GLenum UNSIGNED_INT_2_10_10_10_REV = 0x8368;
+ const GLenum MAX_ELEMENTS_VERTICES = 0x80E8;
+ const GLenum MAX_ELEMENTS_INDICES = 0x80E9;
+ const GLenum TEXTURE_MIN_LOD = 0x813A;
+ const GLenum TEXTURE_MAX_LOD = 0x813B;
+ const GLenum TEXTURE_BASE_LEVEL = 0x813C;
+ const GLenum TEXTURE_MAX_LEVEL = 0x813D;
+ const GLenum MIN = 0x8007;
+ const GLenum MAX = 0x8008;
+ const GLenum DEPTH_COMPONENT24 = 0x81A6;
+ const GLenum MAX_TEXTURE_LOD_BIAS = 0x84FD;
+ const GLenum TEXTURE_COMPARE_MODE = 0x884C;
+ const GLenum TEXTURE_COMPARE_FUNC = 0x884D;
+ const GLenum CURRENT_QUERY = 0x8865;
+ const GLenum QUERY_RESULT = 0x8866;
+ const GLenum QUERY_RESULT_AVAILABLE = 0x8867;
+ const GLenum STREAM_READ = 0x88E1;
+ const GLenum STREAM_COPY = 0x88E2;
+ const GLenum STATIC_READ = 0x88E5;
+ const GLenum STATIC_COPY = 0x88E6;
+ const GLenum DYNAMIC_READ = 0x88E9;
+ const GLenum DYNAMIC_COPY = 0x88EA;
+ const GLenum MAX_DRAW_BUFFERS = 0x8824;
+ const GLenum DRAW_BUFFER0 = 0x8825;
+ const GLenum DRAW_BUFFER1 = 0x8826;
+ const GLenum DRAW_BUFFER2 = 0x8827;
+ const GLenum DRAW_BUFFER3 = 0x8828;
+ const GLenum DRAW_BUFFER4 = 0x8829;
+ const GLenum DRAW_BUFFER5 = 0x882A;
+ const GLenum DRAW_BUFFER6 = 0x882B;
+ const GLenum DRAW_BUFFER7 = 0x882C;
+ const GLenum DRAW_BUFFER8 = 0x882D;
+ const GLenum DRAW_BUFFER9 = 0x882E;
+ const GLenum DRAW_BUFFER10 = 0x882F;
+ const GLenum DRAW_BUFFER11 = 0x8830;
+ const GLenum DRAW_BUFFER12 = 0x8831;
+ const GLenum DRAW_BUFFER13 = 0x8832;
+ const GLenum DRAW_BUFFER14 = 0x8833;
+ const GLenum DRAW_BUFFER15 = 0x8834;
+ const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
+ const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
+ const GLenum SAMPLER_3D = 0x8B5F;
+ const GLenum SAMPLER_2D_SHADOW = 0x8B62;
+ const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
+ const GLenum PIXEL_PACK_BUFFER = 0x88EB;
+ const GLenum PIXEL_UNPACK_BUFFER = 0x88EC;
+ const GLenum PIXEL_PACK_BUFFER_BINDING = 0x88ED;
+ const GLenum PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
+ const GLenum FLOAT_MAT2x3 = 0x8B65;
+ const GLenum FLOAT_MAT2x4 = 0x8B66;
+ const GLenum FLOAT_MAT3x2 = 0x8B67;
+ const GLenum FLOAT_MAT3x4 = 0x8B68;
+ const GLenum FLOAT_MAT4x2 = 0x8B69;
+ const GLenum FLOAT_MAT4x3 = 0x8B6A;
+ const GLenum SRGB = 0x8C40;
+ const GLenum SRGB8 = 0x8C41;
+ const GLenum SRGB8_ALPHA8 = 0x8C43;
+ const GLenum COMPARE_REF_TO_TEXTURE = 0x884E;
+ const GLenum RGBA32F = 0x8814;
+ const GLenum RGB32F = 0x8815;
+ const GLenum RGBA16F = 0x881A;
+ const GLenum RGB16F = 0x881B;
+ const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
+ const GLenum MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
+ const GLenum MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
+ const GLenum MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
+ const GLenum MAX_VARYING_COMPONENTS = 0x8B4B;
+ const GLenum TEXTURE_2D_ARRAY = 0x8C1A;
+ const GLenum TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
+ const GLenum R11F_G11F_B10F = 0x8C3A;
+ const GLenum UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
+ const GLenum RGB9_E5 = 0x8C3D;
+ const GLenum UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
+ const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
+ const GLenum TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
+ const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
+ const GLenum RASTERIZER_DISCARD = 0x8C89;
+ const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
+ const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
+ const GLenum INTERLEAVED_ATTRIBS = 0x8C8C;
+ const GLenum SEPARATE_ATTRIBS = 0x8C8D;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
+ const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
+ const GLenum RGBA32UI = 0x8D70;
+ const GLenum RGB32UI = 0x8D71;
+ const GLenum RGBA16UI = 0x8D76;
+ const GLenum RGB16UI = 0x8D77;
+ const GLenum RGBA8UI = 0x8D7C;
+ const GLenum RGB8UI = 0x8D7D;
+ const GLenum RGBA32I = 0x8D82;
+ const GLenum RGB32I = 0x8D83;
+ const GLenum RGBA16I = 0x8D88;
+ const GLenum RGB16I = 0x8D89;
+ const GLenum RGBA8I = 0x8D8E;
+ const GLenum RGB8I = 0x8D8F;
+ const GLenum RED_INTEGER = 0x8D94;
+ const GLenum RGB_INTEGER = 0x8D98;
+ const GLenum RGBA_INTEGER = 0x8D99;
+ const GLenum SAMPLER_2D_ARRAY = 0x8DC1;
+ const GLenum SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
+ const GLenum SAMPLER_CUBE_SHADOW = 0x8DC5;
+ const GLenum UNSIGNED_INT_VEC2 = 0x8DC6;
+ const GLenum UNSIGNED_INT_VEC3 = 0x8DC7;
+ const GLenum UNSIGNED_INT_VEC4 = 0x8DC8;
+ const GLenum INT_SAMPLER_2D = 0x8DCA;
+ const GLenum INT_SAMPLER_3D = 0x8DCB;
+ const GLenum INT_SAMPLER_CUBE = 0x8DCC;
+ const GLenum INT_SAMPLER_2D_ARRAY = 0x8DCF;
+ const GLenum UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
+ const GLenum UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
+ const GLenum UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
+ const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
+ const GLenum DEPTH_COMPONENT32F = 0x8CAC;
+ const GLenum DEPTH32F_STENCIL8 = 0x8CAD;
+ const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
+ const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
+ const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
+ const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
+ const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
+ const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
+ const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
+ const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
+ const GLenum FRAMEBUFFER_DEFAULT = 0x8218;
+ const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
+ const GLenum DEPTH_STENCIL = 0x84F9;
+ const GLenum UNSIGNED_INT_24_8 = 0x84FA;
+ const GLenum DEPTH24_STENCIL8 = 0x88F0;
+ const GLenum UNSIGNED_NORMALIZED = 0x8C17;
+ const GLenum DRAW_FRAMEBUFFER_BINDING = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
+ const GLenum READ_FRAMEBUFFER = 0x8CA8;
+ const GLenum DRAW_FRAMEBUFFER = 0x8CA9;
+ const GLenum READ_FRAMEBUFFER_BINDING = 0x8CAA;
+ const GLenum RENDERBUFFER_SAMPLES = 0x8CAB;
+ const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
+ const GLenum MAX_COLOR_ATTACHMENTS = 0x8CDF;
+ const GLenum COLOR_ATTACHMENT1 = 0x8CE1;
+ const GLenum COLOR_ATTACHMENT2 = 0x8CE2;
+ const GLenum COLOR_ATTACHMENT3 = 0x8CE3;
+ const GLenum COLOR_ATTACHMENT4 = 0x8CE4;
+ const GLenum COLOR_ATTACHMENT5 = 0x8CE5;
+ const GLenum COLOR_ATTACHMENT6 = 0x8CE6;
+ const GLenum COLOR_ATTACHMENT7 = 0x8CE7;
+ const GLenum COLOR_ATTACHMENT8 = 0x8CE8;
+ const GLenum COLOR_ATTACHMENT9 = 0x8CE9;
+ const GLenum COLOR_ATTACHMENT10 = 0x8CEA;
+ const GLenum COLOR_ATTACHMENT11 = 0x8CEB;
+ const GLenum COLOR_ATTACHMENT12 = 0x8CEC;
+ const GLenum COLOR_ATTACHMENT13 = 0x8CED;
+ const GLenum COLOR_ATTACHMENT14 = 0x8CEE;
+ const GLenum COLOR_ATTACHMENT15 = 0x8CEF;
+ const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
+ const GLenum MAX_SAMPLES = 0x8D57;
+ const GLenum HALF_FLOAT = 0x140B;
+ const GLenum RG = 0x8227;
+ const GLenum RG_INTEGER = 0x8228;
+ const GLenum R8 = 0x8229;
+ const GLenum RG8 = 0x822B;
+ const GLenum R16F = 0x822D;
+ const GLenum R32F = 0x822E;
+ const GLenum RG16F = 0x822F;
+ const GLenum RG32F = 0x8230;
+ const GLenum R8I = 0x8231;
+ const GLenum R8UI = 0x8232;
+ const GLenum R16I = 0x8233;
+ const GLenum R16UI = 0x8234;
+ const GLenum R32I = 0x8235;
+ const GLenum R32UI = 0x8236;
+ const GLenum RG8I = 0x8237;
+ const GLenum RG8UI = 0x8238;
+ const GLenum RG16I = 0x8239;
+ const GLenum RG16UI = 0x823A;
+ const GLenum RG32I = 0x823B;
+ const GLenum RG32UI = 0x823C;
+ const GLenum VERTEX_ARRAY_BINDING = 0x85B5;
+ const GLenum R8_SNORM = 0x8F94;
+ const GLenum RG8_SNORM = 0x8F95;
+ const GLenum RGB8_SNORM = 0x8F96;
+ const GLenum RGBA8_SNORM = 0x8F97;
+ const GLenum SIGNED_NORMALIZED = 0x8F9C;
+ const GLenum COPY_READ_BUFFER = 0x8F36;
+ const GLenum COPY_WRITE_BUFFER = 0x8F37;
+ const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */
+ const GLenum COPY_WRITE_BUFFER_BINDING = 0x8F37; /* Same as COPY_WRITE_BUFFER */
+ const GLenum UNIFORM_BUFFER = 0x8A11;
+ const GLenum UNIFORM_BUFFER_BINDING = 0x8A28;
+ const GLenum UNIFORM_BUFFER_START = 0x8A29;
+ const GLenum UNIFORM_BUFFER_SIZE = 0x8A2A;
+ const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
+ const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
+ const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
+ const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
+ const GLenum MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
+ const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
+ const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
+ const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
+ const GLenum ACTIVE_UNIFORM_BLOCKS = 0x8A36;
+ const GLenum UNIFORM_TYPE = 0x8A37;
+ const GLenum UNIFORM_SIZE = 0x8A38;
+ const GLenum UNIFORM_BLOCK_INDEX = 0x8A3A;
+ const GLenum UNIFORM_OFFSET = 0x8A3B;
+ const GLenum UNIFORM_ARRAY_STRIDE = 0x8A3C;
+ const GLenum UNIFORM_MATRIX_STRIDE = 0x8A3D;
+ const GLenum UNIFORM_IS_ROW_MAJOR = 0x8A3E;
+ const GLenum UNIFORM_BLOCK_BINDING = 0x8A3F;
+ const GLenum UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
+ const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
+ const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
+ const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
+ const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
+ const GLenum INVALID_INDEX = 0xFFFFFFFF;
+ const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
+ const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
+ const GLenum MAX_SERVER_WAIT_TIMEOUT = 0x9111;
+ const GLenum OBJECT_TYPE = 0x9112;
+ const GLenum SYNC_CONDITION = 0x9113;
+ const GLenum SYNC_STATUS = 0x9114;
+ const GLenum SYNC_FLAGS = 0x9115;
+ const GLenum SYNC_FENCE = 0x9116;
+ const GLenum SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
+ const GLenum UNSIGNALED = 0x9118;
+ const GLenum SIGNALED = 0x9119;
+ const GLenum ALREADY_SIGNALED = 0x911A;
+ const GLenum TIMEOUT_EXPIRED = 0x911B;
+ const GLenum CONDITION_SATISFIED = 0x911C;
+ const GLenum WAIT_FAILED = 0x911D;
+ const GLenum SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
+ const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
+ const GLenum ANY_SAMPLES_PASSED = 0x8C2F;
+ const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
+ const GLenum SAMPLER_BINDING = 0x8919;
+ const GLenum RGB10_A2UI = 0x906F;
+ const GLenum INT_2_10_10_10_REV = 0x8D9F;
+ const GLenum TRANSFORM_FEEDBACK = 0x8E22;
+ const GLenum TRANSFORM_FEEDBACK_PAUSED = 0x8E23;
+ const GLenum TRANSFORM_FEEDBACK_ACTIVE = 0x8E24;
+ const GLenum TRANSFORM_FEEDBACK_BINDING = 0x8E25;
+ const GLenum TEXTURE_IMMUTABLE_FORMAT = 0x912F;
+ const GLenum MAX_ELEMENT_INDEX = 0x8D6B;
+ const GLenum TEXTURE_IMMUTABLE_LEVELS = 0x82DF;
+
+ const GLint64 TIMEOUT_IGNORED = -1;
+
+ /* WebGL-specific enums */
+ const GLenum MAX_CLIENT_WAIT_TIMEOUT_WEBGL = 0x9247;
+
+ /* Buffer objects */
+ // WebGL1:
+ void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
+ void bufferData(GLenum target, [AllowShared] BufferSource? srcData, GLenum usage);
+ void bufferSubData(GLenum target, GLintptr dstByteOffset, [AllowShared] BufferSource srcData);
+ // WebGL2:
+ void bufferData(GLenum target, [AllowShared] ArrayBufferView srcData, GLenum usage, GLuint srcOffset,
+ optional GLuint length = 0);
+ void bufferSubData(GLenum target, GLintptr dstByteOffset, [AllowShared] ArrayBufferView srcData,
+ GLuint srcOffset, optional GLuint length = 0);
+
+ void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
+ GLintptr writeOffset, GLsizeiptr size);
+ // MapBufferRange, in particular its read-only and write-only modes,
+ // can not be exposed safely to JavaScript. GetBufferSubData
+ // replaces it for the purpose of fetching data back from the GPU.
+ void getBufferSubData(GLenum target, GLintptr srcByteOffset, [AllowShared] ArrayBufferView dstBuffer,
+ optional GLuint dstOffset = 0, optional GLuint length = 0);
+
+ /* Framebuffer objects */
+ void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0,
+ GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+ void framebufferTextureLayer(GLenum target, GLenum attachment, WebGLTexture? texture, GLint level,
+ GLint layer);
+ void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
+ void invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments,
+ GLint x, GLint y, GLsizei width, GLsizei height);
+ void readBuffer(GLenum src);
+
+ /* Renderbuffer objects */
+ any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
+ void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat,
+ GLsizei width, GLsizei height);
+
+ /* Texture objects */
+ void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width,
+ GLsizei height);
+ void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width,
+ GLsizei height, GLsizei depth);
+
+ // WebGL1 legacy entrypoints:
+ void texImage2D(GLenum target, GLint level, GLint internalformat,
+ GLsizei width, GLsizei height, GLint border, GLenum format,
+ GLenum type, [AllowShared] ArrayBufferView? pixels);
+ void texImage2D(GLenum target, GLint level, GLint internalformat,
+ GLenum format, GLenum type, TexImageSource source); // May throw DOMException
+
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height,
+ GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLenum format, GLenum type, TexImageSource source); // May throw DOMException
+
+ // WebGL2 entrypoints:
+ void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type, GLintptr pboOffset);
+ void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type,
+ TexImageSource source); // May throw DOMException
+ void texImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+ GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData,
+ GLuint srcOffset);
+
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+ GLsizei depth, GLint border, GLenum format, GLenum type, GLintptr pboOffset);
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+ GLsizei depth, GLint border, GLenum format, GLenum type,
+ TexImageSource source); // May throw DOMException
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+ GLsizei depth, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView? srcData);
+ void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height,
+ GLsizei depth, GLint border, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData,
+ GLuint srcOffset);
+
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
+ GLsizei height, GLenum format, GLenum type, GLintptr pboOffset);
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
+ GLsizei height, GLenum format, GLenum type,
+ TexImageSource source); // May throw DOMException
+ void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width,
+ GLsizei height, GLenum format, GLenum type, [AllowShared] ArrayBufferView srcData,
+ GLuint srcOffset);
+
+ void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
+ GLintptr pboOffset);
+ void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
+ TexImageSource source); // May throw DOMException
+ void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
+ [AllowShared] ArrayBufferView? srcData, optional GLuint srcOffset = 0);
+
+ void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
+ GLint x, GLint y, GLsizei width, GLsizei height);
+
+ void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
+ GLsizei height, GLint border, GLsizei imageSize, GLintptr offset);
+ void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
+ GLsizei height, GLint border, [AllowShared] ArrayBufferView srcData,
+ optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0);
+
+ void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLintptr offset);
+ void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width,
+ GLsizei height, GLsizei depth, GLint border, [AllowShared] ArrayBufferView srcData,
+ optional GLuint srcOffset = 0, optional GLuint srcLengthOverride = 0);
+
+ void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLintptr offset);
+ void compressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLsizei width, GLsizei height, GLenum format,
+ [AllowShared] ArrayBufferView srcData,
+ optional GLuint srcOffset = 0,
+ optional GLuint srcLengthOverride = 0);
+
+ void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, GLsizei imageSize, GLintptr offset);
+ void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
+ GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
+ GLenum format, [AllowShared] ArrayBufferView srcData,
+ optional GLuint srcOffset = 0,
+ optional GLuint srcLengthOverride = 0);
+
+ /* Programs and shaders */
+ [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram program, DOMString name);
+
+ /* Uniforms */
+ void uniform1ui(WebGLUniformLocation? location, GLuint v0);
+ void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
+ void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
+ void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+
+ void uniform1fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform2fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform3fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform4fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+
+ void uniform1iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform2iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform3iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+
+ void uniform1uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform2uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform3uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+
+ /* Vertex attribs */
+ void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
+ void vertexAttribI4iv(GLuint index, Int32List values);
+ void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
+ void vertexAttribI4uiv(GLuint index, Uint32List values);
+ void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
+
+ /* Writing to the drawing buffer */
+ void vertexAttribDivisor(GLuint index, GLuint divisor);
+ void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
+ void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
+ void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);
+
+ /* Reading back pixels */
+ // WebGL1:
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
+ [AllowShared] ArrayBufferView? dstData);
+ // WebGL2:
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
+ GLintptr offset);
+ void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
+ [AllowShared] ArrayBufferView dstData, GLuint dstOffset);
+
+ /* Multiple Render Targets */
+ void drawBuffers(sequence<GLenum> buffers);
+
+ void clearBufferfv(GLenum buffer, GLint drawbuffer, Float32List values,
+ optional GLuint srcOffset = 0);
+ void clearBufferiv(GLenum buffer, GLint drawbuffer, Int32List values,
+ optional GLuint srcOffset = 0);
+ void clearBufferuiv(GLenum buffer, GLint drawbuffer, Uint32List values,
+ optional GLuint srcOffset = 0);
+
+ void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
+
+ /* Query Objects */
+ WebGLQuery? createQuery();
+ void deleteQuery(WebGLQuery? query);
+ [WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query);
+ void beginQuery(GLenum target, WebGLQuery query);
+ void endQuery(GLenum target);
+ WebGLQuery? getQuery(GLenum target, GLenum pname);
+ any getQueryParameter(WebGLQuery query, GLenum pname);
+
+ /* Sampler Objects */
+ WebGLSampler? createSampler();
+ void deleteSampler(WebGLSampler? sampler);
+ [WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler);
+ void bindSampler(GLuint unit, WebGLSampler? sampler);
+ void samplerParameteri(WebGLSampler sampler, GLenum pname, GLint param);
+ void samplerParameterf(WebGLSampler sampler, GLenum pname, GLfloat param);
+ any getSamplerParameter(WebGLSampler sampler, GLenum pname);
+
+ /* Sync objects */
+ WebGLSync? fenceSync(GLenum condition, GLbitfield flags);
+ [WebGLHandlesContextLoss] GLboolean isSync(WebGLSync? sync);
+ void deleteSync(WebGLSync? sync);
+ GLenum clientWaitSync(WebGLSync sync, GLbitfield flags, GLuint64 timeout);
+ void waitSync(WebGLSync sync, GLbitfield flags, GLint64 timeout);
+ any getSyncParameter(WebGLSync sync, GLenum pname);
+
+ /* Transform Feedback */
+ WebGLTransformFeedback? createTransformFeedback();
+ void deleteTransformFeedback(WebGLTransformFeedback? tf);
+ [WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback? tf);
+ void bindTransformFeedback (GLenum target, WebGLTransformFeedback? tf);
+ void beginTransformFeedback(GLenum primitiveMode);
+ void endTransformFeedback();
+ void transformFeedbackVaryings(WebGLProgram program, sequence<DOMString> varyings, GLenum bufferMode);
+ WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram program, GLuint index);
+ void pauseTransformFeedback();
+ void resumeTransformFeedback();
+
+ /* Uniform Buffer Objects and Transform Feedback Buffers */
+ void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer);
+ void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size);
+ any getIndexedParameter(GLenum target, GLuint index);
+ sequence<GLuint>? getUniformIndices(WebGLProgram program, sequence<DOMString> uniformNames);
+ any getActiveUniforms(WebGLProgram program, sequence<GLuint> uniformIndices, GLenum pname);
+ GLuint getUniformBlockIndex(WebGLProgram program, DOMString uniformBlockName);
+ any getActiveUniformBlockParameter(WebGLProgram program, GLuint uniformBlockIndex, GLenum pname);
+ DOMString? getActiveUniformBlockName(WebGLProgram program, GLuint uniformBlockIndex);
+ void uniformBlockBinding(WebGLProgram program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+
+ /* Vertex Array Objects */
+ WebGLVertexArrayObject? createVertexArray();
+ void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
+ [WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
+ void bindVertexArray(WebGLVertexArrayObject? array);
+};
+
+[Exposed=(Window,Worker)]
+interface WebGL2RenderingContext
+{
+};
+WebGL2RenderingContext includes WebGLRenderingContextBase;
+WebGL2RenderingContext includes WebGL2RenderingContextBase;
+
+