Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions specs/latest/2.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2210,8 +2210,31 @@ <h4>Texture objects</h4>
<p><em>offset</em> is the byte offset into the WebGLBuffer's data store; generates an <code>INVALID_VALUE</code> error if it's less than 0.</p>
<p>The ETC2 and EAC texture formats defined in OpenGL ES 3.0 are <a href="#NO_ETC2_EAC">not available in WebGL 2.0</a>.
</dd>

<dt class="idl-code">
[throws] undefined texElementImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type,
Element element);
</dt>
<dd>
<p>Renders the given element to the currently bound WebGLTexture.</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantics of HTML-in-Canvas have evolved significantly in https://github.com/WICG/html-in-canvas . Now there's a paint event which applications should watch for, and texElementImage2D copies in the rendered version of the element at the time of the last paint event. Could you please expand out the text here to describe more precisely what ends up in the WebGLTexture? URL links to the upstream spec would probably be best, to avoid duplicating text.

<p>The width and height of the texture are derived from the CSS width and height of the element at the time of rendering. Add links to whatwg.</p>
<p>TBD: define state of rendering + security. These will be more links to whatwg</p><p></p>
<p>If no WebGLBuffer is bound to the <code>PIXEL_PACK_BUFFER</code> target, generates an
<code>INVALID_OPERATION</code> error.</p>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This validation related to PIXEL_PACK_BUFFER looks reversed; if a buffer's bound to that target then the textures' contents come from it. I think that instead this should say "If a WebGLBuffer is bound...", since the goal is for the texture's contents to come from the rendered element.

<p>The combination of <em>internalformat</em>, <em>format</em>, and <em>type</em> must be listed in the following table:</p>
<table id="TEXTURE_TYPES_FORMATS_FROM_DOM_ELEMENTS_TABLE_2">
<tr><th>Internal Format</th><th>Format</th><th>Type</th></tr>
<tr><td>RGB</td><td>RGB</td><td>UNSIGNED_BYTE</td></tr>
<tr><td>RGBA</td><td>RGBA</td><td>UNSIGNED_BYTE</td></tr>
<tr><td>RGB16F</td><td>RGB</td><td>HALF_FLOAT<br>FLOAT</td></tr>
<tr><td>RGB32F</td><td>RGB</td><td>FLOAT</td></tr>
<tr><td>RGBA16F</td><td>RGBA</td><td>HALF_FLOAT<br>FLOAT</td></tr>
<tr><td>RGBA32F</td><td>RGBA</td><td>FLOAT</td></tr>
</table>
</dd>
</dl>


Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove extra blank line.

<!-- ======================================================================================================= -->

<h4>Programs and Shaders</h4>
Expand Down
3 changes: 3 additions & 0 deletions specs/latest/2.0/webgl2.idl
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,9 @@ interface mixin WebGL2RenderingContextOverloads
optional unsigned long long srcOffset = 0,
optional GLuint srcLengthOverride = 0);

undefined texElementImage2D(GLenum target, GLint level, GLint internalformat, GLenum format, GLenum type,
Element element);

undefined uniform1fv(WebGLUniformLocation? location, Float32List data, optional unsigned long long srcOffset = 0,
optional GLuint srcLength = 0);
undefined uniform2fv(WebGLUniformLocation? location, Float32List data, optional unsigned long long srcOffset = 0,
Expand Down