Skip to content

Commit

Permalink
Add [AllowShared] to WEBGL_multi_draw APIs' typed array arguments. (K…
Browse files Browse the repository at this point in the history
…hronosGroup#3286)

Parallels changes made in KhronosGroup#2387 to the core WebGL 1.0 and 2.0
specifications to support SharedArrayBuffer, and implicitly,
multithreaded WebAssembly.

Fixes KhronosGroup#3219 .
  • Loading branch information
kenrussell authored May 18, 2021
1 parent 837205c commit 6eafd07
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 37 deletions.
43 changes: 23 additions & 20 deletions extensions/WEBGL_multi_draw/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,27 @@
interface WEBGL_multi_draw {
undefined multiDrawArraysWEBGL(
GLenum mode,
(Int32Array or sequence<GLint>) firstsList, GLuint firstsOffset,
(Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLint>) firstsList, GLuint firstsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
GLsizei drawcount);
undefined multiDrawElementsWEBGL(
GLenum mode,
(Int32Array or sequence<GLint>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLint>) countsList, GLuint countsOffset,
GLenum type,
(Int32Array or sequence<GLsizei>) offsetsList, GLuint offsetsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, GLuint offsetsOffset,
GLsizei drawcount);
undefined multiDrawArraysInstancedWEBGL(
GLenum mode,
(Int32Array or sequence<GLint>) firstsList, GLuint firstsOffset,
(Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
(Int32Array or sequence<GLsizei>) instanceCountsList, GLuint instanceCountsOffset,
([AllowShared] Int32Array or sequence<GLint>) firstsList, GLuint firstsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, GLuint instanceCountsOffset,
GLsizei drawcount);
undefined multiDrawElementsInstancedWEBGL(
GLenum mode,
(Int32Array or sequence<GLint>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLint>) countsList, GLuint countsOffset,
GLenum type,
(Int32Array or sequence<GLsizei>) offsetsList, GLuint offsetsOffset,
(Int32Array or sequence<GLsizei>) instanceCountsList, GLuint instanceCountsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, GLuint offsetsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, GLuint instanceCountsOffset,
GLsizei drawcount);
};

Expand All @@ -97,39 +97,39 @@ interface WEBGL_multi_draw {
<newfun>
<function name="multiDrawArraysWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="firstsList" type="(Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsOffset" type="GLuint"/>
<param name="countsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="drawCount" type="GLsizei"/>
</function>
<function name="multiDrawElementsWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="countsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="type" type="GLenum"/>
<param name="offsetsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsOffset" type="GLuint"/>
<param name="drawCount" type="GLsizei"/>
</function>
<function name="multiDrawArraysInstancedWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="firstsList" type="(Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsOffset" type="GLuint"/>
<param name="countsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="instanceCountsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsOffset" type="GLuint"/>
<param name="drawCount" type="GLsizei"/>
</function>
<function name="multiDrawElementsInstancedWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="countsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="type" type="GLenum"/>
<param name="offsetsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsOffset" type="GLuint"/>
<param name="instanceCountsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsOffset" type="GLuint"/>
<param name="drawCount" type="GLsizei"/>
</function>
Expand Down Expand Up @@ -210,5 +210,8 @@ void main() {
<revision date="2020/07/31">
<change>Moved to Community Approved.</change>
</revision>
<revision date="2021/05/18">
<change>Add [AllowShared] to all typed array arguments for compatibility with multi-threaded WebAssembly.</change>
</revision>
</history>
</extension>
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@
interface WEBGL_multi_draw_instanced_base_vertex_base_instance {
undefined multiDrawArraysInstancedBaseInstanceWEBGL(
GLenum mode,
(Int32Array or sequence&lt;GLint&gt;) firstsList, GLuint firstsOffset,
(Int32Array or sequence&lt;GLsizei&gt;) countsList, GLuint countsOffset,
(Int32Array or sequence&lt;GLsizei&gt;) instanceCountsList, GLuint instanceCountsOffset,
(Uint32Array or sequence&lt;GLuint&gt;) baseInstancesList, GLuint baseInstancesOffset,
([AllowShared] Int32Array or sequence&lt;GLint&gt;) firstsList, GLuint firstsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) instanceCountsList, GLuint instanceCountsOffset,
([AllowShared] Uint32Array or sequence&lt;GLuint&gt;) baseInstancesList, GLuint baseInstancesOffset,
GLsizei drawCount
);
undefined multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(
GLenum mode,
(Int32Array or sequence&lt;GLsizei&gt;) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) countsList, GLuint countsOffset,
GLenum type,
(Int32Array or sequence&lt;GLsizei&gt;) offsetsList, GLuint offsetsOffset,
(Int32Array or sequence&lt;GLsizei&gt;) instanceCountsList, GLuint instanceCountsOffset,
(Int32Array or sequence&lt;GLint&gt;) baseVerticesList, GLuint baseVerticesOffset,
(Uint32Array or sequence&lt;GLuint&gt;) baseInstancesList, GLuint baseInstancesOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) offsetsList, GLuint offsetsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) instanceCountsList, GLuint instanceCountsOffset,
([AllowShared] Int32Array or sequence&lt;GLint&gt;) baseVerticesList, GLuint baseVerticesOffset,
([AllowShared] Uint32Array or sequence&lt;GLuint&gt;) baseInstancesList, GLuint baseInstancesOffset,
GLsizei drawCount
);
};
Expand All @@ -113,26 +113,26 @@ interface WEBGL_multi_draw_instanced_base_vertex_base_instance {
<newfun>
<function name="multiDrawArraysInstancedBaseInstanceWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="firstsList" type="(Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsOffset" type="GLuint"/>
<param name="countsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="baseInstancesList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="baseInstancesList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="baseInstancesOffset" type="GLuint"/>
<param name="drawCount" type="GLsizei"/>
</function>
<function name="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="countsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="type" type="GLenum"/>
<param name="offsetsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsOffset" type="GLuint"/>
<param name="instanceCountsList" type="(Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsOffset" type="GLuint"/>
<param name="baseVerticesList" type="(Int32Array or sequence&lt;GLint&gt;)"/>
<param name="baseVerticesList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="baseVerticesOffset" type="GLuint"/>
<param name="baseInstancesList" type="(Uint32Array or sequence&lt;GLuint&gt;)"/>
<param name="baseInstancesList" type="([AllowShared] Uint32Array or sequence&lt;GLuint&gt;)"/>
<param name="baseInstancesOffset" type="GLuint"/>
<param name="drawCount" type="GLsizei"/>
</function>
Expand Down Expand Up @@ -209,5 +209,8 @@ void main() {
<revision date="2020/07/28">
<change>Add parentheses around union types in IDL</change>
</revision>
<revision date="2021/05/18">
<change>Add [AllowShared] to all typed array arguments for compatibility with multi-threaded WebAssembly.</change>
</revision>
</history>
</draft>

0 comments on commit 6eafd07

Please sign in to comment.