Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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 dont 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>

File diff suppressed because it is too large Load Diff

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>