Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove WebGLObject superinterface. #3625

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
10 changes: 8 additions & 2 deletions extensions/EXT_disjoint_timer_query/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,20 @@
only on WebGL 1.0 contexts. See the <a href="../EXT_disjoint_timer_query_webgl2/">EXT_disjoint_timer_query_webgl2</a>
extension for how it is exposed on WebGL 2.0 contexts.
</feature>
<feature>
<code>WebGLTimerQueryEXT</code> is a WebGL resource object.
Each <code>WebGLTimerQueryEXT</code> has an <b><a
name="webgl-timerqueryext-invalidated-flag">invalidated</a></b>
flag, which is initially unset.
</feature>
</features>
</overview>

<idl xml:space="preserve">
typedef unsigned long long GLuint64EXT;

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WebGLTimerQueryEXT : WebGLObject {
interface WebGLTimerQueryEXT {
};

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
Expand Down Expand Up @@ -97,7 +103,7 @@ interface EXT_disjoint_timer_query {
<param name="query" type="WebGLTimerQueryEXT?"/>
Returns true if the passed <code>WebGLTimerQueryEXT</code> is valid and false otherwise. Returns false if
the query's <a
href="../../specs/latest/1.0/#webgl-object-invalidated-flag">invalidated
href="#webgl-timerqueryext-invalidated-flag">invalidated
flag</a> is set or if the query was generated by a different
<code>WebGLRenderingContext</code> than this one.
</function>
Expand Down
12 changes: 10 additions & 2 deletions extensions/OES_vertex_array_object/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@
</depends>
<overview>
<mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_vertex_array_object.txt" name="OES_vertex_array_object" />
<features>
<feature>
<code>WebGLVertexArrayObjectOES</code> is a WebGL resource object.
Each <code>WebGLVertexArrayObjectOES</code> has an <b><a
name="webgl-vertexarrayobjectoes-invalidated-flag">invalidated</a></b>
flag, which is initially unset.
</feature>
</features>
</overview>
<idl xml:space="preserve">
[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WebGLVertexArrayObjectOES : WebGLObject {
interface WebGLVertexArrayObjectOES {
};

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
Expand Down Expand Up @@ -68,7 +76,7 @@ interface OES_vertex_array_object {
<code>WebGLRenderingContext</code> than this one.</p>

<p>Returns false if the vertex array's
<a href="../../specs/1.0/#webgl-object-invalidated-flag">invalidated
<a href="#webgl-vertexarrayobjectoes-invalidated-flag">invalidated
flag</a> is set.</p>
</function>
</newfun>
Expand Down
28 changes: 24 additions & 4 deletions extensions/proposals/WEBGL_debug/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
<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.
with a union type argument representing all possible WebGL resource
types.
</addendum>

<addendum>
Expand Down Expand Up @@ -92,7 +93,7 @@

<feature>
<code>objectLabelKHR</code> and <code>getObjectLabelKHR</code> are
exposed, to assign a label to a <code>WebGLObject</code> and retrieve
exposed, to assign a label to a WebGL resource object and retrieve
it.
</feature>

Expand All @@ -112,6 +113,25 @@
</overview>

<idl xml:space="preserve"><![CDATA[
typedef (/* WebGL 1.0 resource types */
WebGLBuffer or
WebGLFramebuffer or
WebGLProgram or
WebGLRenderbuffer or
WebGLShader or
WebGLTexture or

/* WebGL 2.0 resource types */
WebGLQuery or
WebGLSampler or
WebGLSync or
WebGLTransformFeedback or
WebGLVertexArrayObject or

/* WebGL extension resource types */
WebGLTimerQueryEXT or
WebGLVertexArrayObjectOES) WebGLResourceType;

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
interface WEBGL_debug : EventTarget {
const GLenum MAX_DEBUG_MESSAGE_LENGTH_KHR = 0x9143;
Expand Down Expand Up @@ -151,8 +171,8 @@ interface WEBGL_debug : EventTarget {
undefined pushDebugGroupKHR(GLenum source, GLuint id, DOMString message);
undefined popDebugGroupKHR();

undefined objectLabelKHR(WebGLObject? object, DOMString label);
DOMString getObjectLabelKHR(WebGLObject? object);
undefined objectLabelKHR(WebGLResourceType? object, DOMString label);
DOMString getObjectLabelKHR(WebGLResourceType? object);
}; // interface WEBGL_debug

[Exposed=(Window,Worker), LegacyNoInterfaceObject]
Expand Down
120 changes: 68 additions & 52 deletions specs/latest/1.0/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -517,18 +517,19 @@ <h2>WebGL Resources</h2>

<p>
OpenGL manages several types of resources as part of its state. These are identified
by integer object names and are obtained from OpenGL by various creation calls.
In contrast WebGL represents these resources as DOM objects. Each object is derived
from the WebGLObject interface. Currently supported resources are:
textures, buffers (i.e., VBOs), framebuffers, renderbuffers, shaders and
programs. The WebGLRenderingContext interface has a method to create a
WebGLObject subclass for each type. Data from the underlying graphics library are
stored in these objects and are fully managed by them.
The DOM object will stay alive not only as long as the author retains an explicit reference
to it, but also as long as it is in use by the underlying graphics library.
When the DOM object is destroyed, it marks its resources for deletion.
If authors wish to mark an object for deletion prior to the DOM object being destroyed,
they may explicitly call the respective delete function. (e.g. deleteTexture)
by integer object names and are obtained from OpenGL by various creation calls. In
contrast, WebGL represents these resources as opaque, typed objects. Each resource
type has an associated Web IDL interface type. Currently supported resources are:
textures, buffers (i.e., vertex buffer objects, or VBOs), framebuffers,
renderbuffers, shaders and programs. The WebGLRenderingContext interface contains
methods to create objects of each type. Data from the underlying graphics library
are stored in these objects and are fully managed by them. The object will stay
alive not only as long as the author retains an explicit reference to it, but also as
long as it is in use by the underlying graphics library. When the ECMAScript object
is destroyed, it marks its resources for deletion. If authors wish to mark a
resource for deletion prior to the ECMAScript object being destroyed, they may
explicitly call the respective delete function: for
example, <code>deleteTexture</code>.
</p>

<!-- ======================================================================================================= -->
Expand Down Expand Up @@ -983,21 +984,6 @@ <h4>Context creation parameters</h4>
</pre>
</div>

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

<h3>WebGLObject</h3>

<p>
The <code>WebGLObject</code> interface is the parent interface for all GL objects.
</p>
<p>
Each <code>WebGLObject</code> has
an <b><a name="webgl-object-invalidated-flag">invalidated</a></b> flag, which is initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn data-dfn-type="interface" id="WebGLObject">WebGLObject</dfn> {
};</pre>

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

<h3>WebGLBuffer</h3>
Expand All @@ -1012,8 +998,13 @@ <h3>WebGLBuffer</h3>
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteBuffers.xml">man page</a>)</span>
.
</p>
<p>
Each <code>WebGLBuffer</code> has
an <b><a name="webgl-buffer-invalidated-flag">invalidated</a></b> flag, which is
initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn data-dfn-type="interface" id="WebGLBuffer">WebGLBuffer</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLBuffer">WebGLBuffer</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1030,8 +1021,13 @@ <h3><a name="WEBGL_FRAMEBUFFER">WebGLFramebuffer</a></h3>
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-4.4.1">OpenGL ES 2.0 &sect;4.4.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteFramebuffers.xml">man page</a>)</span>
.
</p>
<p>
Each <code>WebGLFramebuffer</code> has
an <b><a name="webgl-framebuffer-invalidated-flag">invalidated</a></b> flag, which is
initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn data-dfn-type="interface" id="WebGLFramebuffer">WebGLFramebuffer</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLFramebuffer">WebGLFramebuffer</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1048,8 +1044,13 @@ <h3>WebGLProgram</h3>
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteProgram.xml">man page</a>)</span>
.
</p>
<p>
Each <code>WebGLProgram</code> has
an <b><a name="webgl-program-invalidated-flag">invalidated</a></b> flag, which is
initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn data-dfn-type="interface" id="WebGLProgram">WebGLProgram</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLProgram">WebGLProgram</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1066,8 +1067,13 @@ <h3>WebGLRenderbuffer</h3>
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteRenderbuffers.xml">man page</a>)</span>
.
</p>
<p>
Each <code>WebGLRenderbuffer</code> has
an <b><a name="webgl-renderbuffer-invalidated-flag">invalidated</a></b> flag, which
is initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn data-dfn-type="interface" id="WebGLRenderbuffer">WebGLRenderbuffer</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLRenderbuffer">WebGLRenderbuffer</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1084,8 +1090,13 @@ <h3>WebGLShader</h3>
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-2.10.1">OpenGL ES 2.0 &sect;2.10.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteShader.xml">man page</a>)</span>
.
</p>
<p>
Each <code>WebGLShader</code> has
an <b><a name="webgl-shader-invalidated-flag">invalidated</a></b> flag, which is
initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn data-dfn-type="interface" id="WebGLShader">WebGLShader</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLShader">WebGLShader</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand All @@ -1102,8 +1113,13 @@ <h3>WebGLTexture</h3>
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-3.7.13">OpenGL ES 2.0 &sect;3.7.13</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteTextures.xml">man page</a>)</span>
.
</p>
<p>
Each <code>WebGLTexture</code> has
an <b><a name="webgl-texture-invalidated-flag">invalidated</a></b> flag, which is
initially unset.
</p>
<pre class="idl">[Exposed=(Window,Worker)]
interface <dfn data-dfn-type="interface" id="WebGLTexture">WebGLTexture</dfn> : WebGLObject {
interface <dfn data-dfn-type="interface" id="WebGLTexture">WebGLTexture</dfn> {
};</pre>

<!-- ======================================================================================================= -->
Expand Down Expand Up @@ -1306,10 +1322,10 @@ <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>

<ol class="nestedlist">

<li> Otherwise, if any argument to the method is a <code>WebGLObject</code> with
its <a href="#webgl-object-invalidated-flag">invalidated flag</a> set, generate
an <code>INVALID_OPERATION</code> error and let <em>use default return value</em> be
true. </li>
<li> Otherwise, if any argument to the method is a WebGL resource object
(<code>WebGLBuffer</code>, <code>WebGLFramebuffer</code>, etc.) with
its <b>invalidated flag</b> set, generate an <code>INVALID_OPERATION</code> error
and let <em>use default return value</em> be true. </li>

</ol>

Expand Down Expand Up @@ -2433,7 +2449,7 @@ <h4>Buffer objects</h4>
Returns false if the buffer was generated by a
different <code>WebGLRenderingContext</code> than this one. <br><br>

Returns false if the buffer's <a href="#webgl-object-invalidated-flag">invalidated
Returns false if the buffer's <a href="#webgl-buffer-invalidated-flag">invalidated
flag</a> is set.
</dl>

Expand Down Expand Up @@ -2523,7 +2539,7 @@ <h4>Framebuffer objects</h4>
Returns false if the framebuffer was generated by a
different <code>WebGLRenderingContext</code> than this one. <br><br>

Returns false if the framebuffer's <a href="#webgl-object-invalidated-flag">invalidated
Returns false if the framebuffer's <a href="#webgl-framebuffer-invalidated-flag">invalidated
flag</a> is set.
</dl>

Expand Down Expand Up @@ -2595,7 +2611,7 @@ <h4>Renderbuffer objects</h4>
Returns false if the renderbuffer was generated by a
different <code>WebGLRenderingContext</code> than this one. <br><br>

Returns false if the renderbuffer's <a href="#webgl-object-invalidated-flag">invalidated
Returns false if the renderbuffer's <a href="#webgl-renderbuffer-invalidated-flag">invalidated
flag</a> is set.
<dt class="idl-code">void renderbufferStorage(GLenum target, GLenum internalformat,
GLsizei width, GLsizei height)
Expand Down Expand Up @@ -2722,7 +2738,7 @@ <h4>Texture objects</h4>
Returns false if the texture was generated by a
different <code>WebGLRenderingContext</code> than this one. <br><br>

Returns false if the texture's <a href="#webgl-object-invalidated-flag">invalidated
Returns false if the texture's <a href="#webgl-texture-invalidated-flag">invalidated
flag</a> is set.
<dt class="idl-code"><a name="TEXIMAGE2D">void texImage2D</a>(GLenum target, GLint level, GLint internalformat,
GLsizei width, GLsizei height, GLint border, GLenum format,
Expand Down Expand Up @@ -3128,7 +3144,7 @@ <h4>Programs and Shaders</h4>

Returns false if the program was generated by a
different <code>WebGLRenderingContext</code> than this one. <br><br>
Returns false if the program's <a href="#webgl-object-invalidated-flag">invalidated
Returns false if the program's <a href="#webgl-program-invalidated-flag">invalidated
flag</a> is set.
<dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader)
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsShader.xml">man page</a>)</span>
Expand All @@ -3138,7 +3154,7 @@ <h4>Programs and Shaders</h4>
Returns false if the shader was generated by a
different <code>WebGLRenderingContext</code> than this one. <br><br>

Returns false if the shader's <a href="#webgl-object-invalidated-flag">invalidated
Returns false if the shader's <a href="#webgl-shader-invalidated-flag">invalidated
flag</a> is set.
<dt class="idl-code">void linkProgram(WebGLProgram program)
<span class="gl-spec">(<a href="http://registry.khronos.org/OpenGL/specs/es/2.0/es_full_spec_2.0.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glLinkProgram.xml">man page</a>)</span>
Expand Down Expand Up @@ -3255,7 +3271,7 @@ <h4>Uniforms and attributes</h4>
Returns -1 if the context's <a href="#webgl-context-lost-flag">webgl context lost
flag</a> is set. <br><br>

If the <a href="#webgl-object-invalidated-flag">invalidated flag</a> of the passed
If the <a href="#webgl-program-invalidated-flag">invalidated flag</a> of the passed
program is set, generates an <code>INVALID_OPERATION</code> error and returns
-1. <br><br>

Expand Down Expand Up @@ -3564,13 +3580,13 @@ <h4>Detecting and enabling extensions</h4>
</p>
<p>
Once an extension is enabled, it is only disabled if the WebGL rendering context is lost (see
below), with the exception of the "WEBGL_lose_context" extension which remains active through
any loss of context. Any objects referenced by a disabled extension, such as the object returned
below), with the exception of the "WEBGL_lose_context" extension which remains active through any
loss of context. Any objects referenced by a disabled extension, such as the object returned
by <code>getExtension</code>, are no longer associated with the WebGL rendering context. Any
extension objects that derive from <code>WebGLObject</code> have their
<a href="#webgl-object-invalidated-flag">invalidated</a> flag set to true. Behavior of
extensions' methods after context loss is defined by the steps in the
section <a href="#WEBGLRENDERINGCONTEXT">"The WebGL context"</a>.
extension objects representing graphics resources have their
<b>invalidated</b> flag set to true. Behavior of extensions' methods after context
loss is defined by the steps in the section <a href="#WEBGLRENDERINGCONTEXT">"The
WebGL context"</a>.
<p>
There are no other mechanisms to disable an extension.
</p>
Expand Down Expand Up @@ -3677,8 +3693,8 @@ <h4><a name="CONTEXT_LOST">The Context Lost Event</a></h4>
<li> Set <em>context's</em> <a href="#webgl-context-lost-flag">webgl context lost</a>
flag. </li>

<li> Set the <a href="#webgl-object-invalidated-flag">invalidated flag</a> of
each <code>WebGLObject</code> instance created by this context. </li>
<li> Set the <b>invalidated flag</b> of each WebGL resource object instance created by this
context. </li>

<li> Disable all extensions except "WEBGL_lose_context". </li>

Expand Down
Loading
Loading