| 1 | <?xml version="1.0"?> |
| 2 | |
| 3 | <ratified href="OES_vertex_array_object/"> |
| 4 | <name>OES_vertex_array_object</name> |
| 5 | <contact> |
| 6 | <a href="https://www.khronos.org/webgl/public-mailing-list/">WebGL working group</a> (public_webgl 'at' khronos.org) |
| 7 | </contact> |
| 8 | <contributors> |
| 9 | <contributor>Members of the WebGL working group</contributor> |
| 10 | </contributors> |
| 11 | <number>5</number> |
| 12 | <depends> |
| 13 | <api version="1.0"/> |
| 14 | <core version="2.0" /> |
| 15 | </depends> |
| 16 | <overview> |
| 17 | <mirrors href="http://www.khronos.org/registry/gles/extensions/OES/OES_vertex_array_object.txt" name="OES_vertex_array_object" /> |
| 18 | </overview> |
| 19 | <idl xml:space="preserve"> |
| 20 | [NoInterfaceObject] |
| 21 | interface WebGLVertexArrayObjectOES : WebGLObject { |
| 22 | }; |
| 23 | |
| 24 | [NoInterfaceObject] |
| 25 | interface OES_vertex_array_object { |
| 26 | const GLenum VERTEX_ARRAY_BINDING_OES = 0x85B5; |
| 27 | |
| 28 | WebGLVertexArrayObjectOES? createVertexArrayOES(); |
| 29 | void deleteVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); |
| 30 | [WebGLHandlesContextLoss] GLboolean isVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); |
| 31 | void bindVertexArrayOES(WebGLVertexArrayObjectOES? arrayObject); |
| 32 | }; |
| 33 | </idl> |
| 34 | |
| 35 | <newfun> |
| 36 | <function name="createVertexArrayOES" type="WebGLVertexArrayObjectOES?"> |
| 37 | </function> |
| 38 | </newfun> |
| 39 | |
| 40 | <newfun> |
| 41 | <function name="deleteVertexArrayOES" type="void"> |
| 42 | <param name="arrayObject" type="WebGLVertexArrayObjectOES?"/> |
| 43 | </function> |
| 44 | </newfun> |
| 45 | |
| 46 | <newfun> |
| 47 | <function name="isVertexArrayOES" type="GLboolean"> |
| 48 | <param name="arrayObject" type="WebGLVertexArrayObjectOES?"/> |
| 49 | Returns false if the vertex array object's <a |
| 50 | href="../../specs/1.0/#webgl-object-invalidated-flag">invalidated |
| 51 | flag</a> is set. |
| 52 | </function> |
| 53 | </newfun> |
| 54 | |
| 55 | <newfun> |
| 56 | <function name="bindVertexArrayOES" type="void"> |
| 57 | <param name="arrayObject" type="WebGLVertexArrayObjectOES?"/> |
| 58 | </function> |
| 59 | </newfun> |
| 60 | |
| 61 | <issues> |
| 62 | <p>The OES_vertex_array_object spec does not make it clear |
| 63 | what happens to buffers that are deleted when they are referenced |
| 64 | by vertex array objects. It is inferred that all buffers are |
| 65 | reference counted. |
| 66 | </p> |
| 67 | <p>Before OES_vertex_array_object there was no way to use a deleted |
| 68 | buffer in a single context as the spec states it would be unbound |
| 69 | from all bind points. After OES_vertex_array_object it is now |
| 70 | possible to use deleted buffers. |
| 71 | </p> |
| 72 | <p>Furthermore, the OpenGL ES 2.0 spec specifies that using a |
| 73 | deleted buffer has undefined results including possibly |
| 74 | corrupt rendering and generating GL errors. Undefined behavior |
| 75 | is unacceptable for WebGL. |
| 76 | </p> |
| 77 | <ul> |
| 78 | <li> |
| 79 | <p>RESOLVED: Buffers should be reference counted when attached to |
| 80 | a vertex array object. This is consistent with the OpenGL ES 3.0 |
| 81 | spec's implementation of Vertex Array Objects and matches the |
| 82 | behavior of other WebGL objects, such as textures that are attached |
| 83 | to framebuffers. |
| 84 | </p> |
| 85 | <p>This will require that most implementations do not call |
| 86 | glDeleteBuffer when the user calls deleteBuffer on the WebGL context. |
| 87 | Instead the implementation must wait for all references to be released |
| 88 | before calling glDeleteBuffer to prevent undefined behavior. |
| 89 | </p> |
| 90 | <p>If a buffer object is deleted while it is attached to the currently |
| 91 | bound vertex array object, then it is as if BindBuffer had been called, |
| 92 | with a buffer of 0, for each target to which this buffer was attached |
| 93 | in the currently bound vertex array object. In other words, this buffer |
| 94 | is first detached from all attachment points in the currently bound |
| 95 | vertex array object. Note that the buffer is specifically not detached |
| 96 | from any other vertex array object. Detaching the buffer from any other |
| 97 | vertex array objects is the responsibility of the application. |
| 98 | </p> |
| 99 | </li> |
| 100 | </ul> |
| 101 | </issues> |
| 102 | <history> |
| 103 | <revision date="2011/01/27"> |
| 104 | <change>Initial revision.</change> |
| 105 | </revision> |
| 106 | <revision date="2011/11/12"> |
| 107 | <change>Demotion to draft.</change> |
| 108 | </revision> |
| 109 | <revision date="2011/12/06"> |
| 110 | <change>Added vendor-specific name strings for draft extension per discussion on WebGL mailing list.</change> |
| 111 | </revision> |
| 112 | <revision date="2011/12/07"> |
| 113 | <change>Renamed "Name Strings" section to "Alias Name Strings".</change> |
| 114 | <change>Sorted Revision History in ascending order.</change> |
| 115 | </revision> |
| 116 | <revision date="2012/01/03"> |
| 117 | <change>Removed webgl module per changes to Web IDL spec.</change> |
| 118 | </revision> |
| 119 | <revision date="2012/09/24"> |
| 120 | <change>Added resolution to deleted buffer issue</change> |
| 121 | </revision> |
| 122 | <revision date="2012/10/16"> |
| 123 | <change>Based on feedback on public_webgl, moved from draft to community approved, and removed aliases.</change> |
| 124 | </revision> |
| 125 | <revision date="2013/05/08"> |
| 126 | <change>Made WebGLVertexArrayObjectOES return values and arguments nullable on feedback from Benoit Jacob.</change> |
| 127 | </revision> |
| 128 | <revision date="2013/05/14"> |
| 129 | <change>Based on pull request from J Kenneth King, added WebGLHandlesContextLoss extended attribute to isVertexArrayOES and added markup for new functions.</change> |
| 130 | </revision> |
| 131 | <revision date="2013/05/15"> |
| 132 | <change>Ratified by Khronos Board of Promoters.</change> |
| 133 | </revision> |
| 134 | <revision date="2014/07/15"> |
| 135 | <change>Added NoInterfaceObject extended attribute to extension and WebGLVertexArrayObjectOES interface.</change> |
| 136 | </revision> |
| 137 | </history> |
| 138 | </ratified> |