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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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