Skip to content

Commit

Permalink
Update ABV offset args in extensions from u32->u64.
Browse files Browse the repository at this point in the history
Updates the ArrayBufferView offset arguments in the following extensions:

  WEBGL_multi_draw
  WEBGL_multi_draw_instanced_base_vertex_base_instance
  WEBGL_shader_pixel_local_storage

to better support large WebAssembly heaps.

Follow-on to KhronosGroup#3586.
  • Loading branch information
kenrussell committed Sep 8, 2023
1 parent 419b3c6 commit 21a1221
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 44 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,
([AllowShared] Int32Array or sequence<GLint>) firstsList, GLuint firstsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLint>) firstsList, unsigned long long firstsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
GLsizei drawcount);
undefined multiDrawElementsWEBGL(
GLenum mode,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
GLenum type,
([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, GLuint offsetsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, unsigned long long offsetsOffset,
GLsizei drawcount);
undefined multiDrawArraysInstancedWEBGL(
GLenum mode,
([AllowShared] Int32Array or sequence<GLint>) firstsList, GLuint firstsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, GLuint instanceCountsOffset,
([AllowShared] Int32Array or sequence<GLint>) firstsList, unsigned long long firstsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, unsigned long long instanceCountsOffset,
GLsizei drawcount);
undefined multiDrawElementsInstancedWEBGL(
GLenum mode,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) countsList, unsigned long long countsOffset,
GLenum type,
([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, GLuint offsetsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, GLuint instanceCountsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) offsetsList, unsigned long long offsetsOffset,
([AllowShared] Int32Array or sequence<GLsizei>) instanceCountsList, unsigned long long instanceCountsOffset,
GLsizei drawcount);
};

Expand All @@ -98,39 +98,39 @@ interface WEBGL_multi_draw {
<function name="multiDrawArraysWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="firstsList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsOffset" type="GLuint"/>
<param name="firstsOffset" type="unsigned long long"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="countsOffset" type="unsigned long long"/>
<param name="drawcount" type="GLsizei"/>
</function>
<function name="multiDrawElementsWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="countsOffset" type="unsigned long long"/>
<param name="type" type="GLenum"/>
<param name="offsetsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsOffset" type="GLuint"/>
<param name="offsetsOffset" type="unsigned long long"/>
<param name="drawcount" type="GLsizei"/>
</function>
<function name="multiDrawArraysInstancedWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="firstsList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsOffset" type="GLuint"/>
<param name="firstsOffset" type="unsigned long long"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="countsOffset" type="unsigned long long"/>
<param name="instanceCountsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsOffset" type="GLuint"/>
<param name="instanceCountsOffset" type="unsigned long long"/>
<param name="drawcount" type="GLsizei"/>
</function>
<function name="multiDrawElementsInstancedWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="countsOffset" type="unsigned long long"/>
<param name="type" type="GLenum"/>
<param name="offsetsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsOffset" type="GLuint"/>
<param name="offsetsOffset" type="unsigned long long"/>
<param name="instanceCountsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsOffset" type="GLuint"/>
<param name="instanceCountsOffset" type="unsigned long long"/>
<param name="drawcount" type="GLsizei"/>
</function>
</newfun>
Expand Down Expand Up @@ -213,5 +213,8 @@ void main() {
<revision date="2021/05/18">
<change>Add [AllowShared] to all typed array arguments for compatibility with multi-threaded WebAssembly.</change>
</revision>
<revision date="2023/09/08">
<change>Changed offset arguments to "unsigned long long" for Wasm.</change>
</revision>
</history>
</extension>
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,20 @@
interface WEBGL_multi_draw_instanced_base_vertex_base_instance {
undefined multiDrawArraysInstancedBaseInstanceWEBGL(
GLenum mode,
([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,
([AllowShared] Int32Array or sequence&lt;GLint&gt;) firstsList, unsigned long long firstsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) countsList, unsigned long long countsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) instanceCountsList, unsigned long long instanceCountsOffset,
([AllowShared] Uint32Array or sequence&lt;GLuint&gt;) baseInstancesList, unsigned long long baseInstancesOffset,
GLsizei drawcount
);
undefined multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL(
GLenum mode,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) countsList, GLuint countsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) countsList, unsigned long long countsOffset,
GLenum type,
([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,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) offsetsList, unsigned long long offsetsOffset,
([AllowShared] Int32Array or sequence&lt;GLsizei&gt;) instanceCountsList, unsigned long long instanceCountsOffset,
([AllowShared] Int32Array or sequence&lt;GLint&gt;) baseVerticesList, unsigned long long baseVerticesOffset,
([AllowShared] Uint32Array or sequence&lt;GLuint&gt;) baseInstancesList, unsigned long long baseInstancesOffset,
GLsizei drawcount
);
};
Expand All @@ -113,28 +113,28 @@ interface WEBGL_multi_draw_instanced_base_vertex_base_instance {
<function name="multiDrawArraysInstancedBaseInstanceWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="firstsList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="firstsOffset" type="GLuint"/>
<param name="firstsOffset" type="unsigned long long"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="countsOffset" type="unsigned long long"/>
<param name="instanceCountsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsOffset" type="GLuint"/>
<param name="instanceCountsOffset" type="unsigned long long"/>
<param name="baseInstancesList" type="([AllowShared] Uint32Array or sequence&lt;GLuint&gt;)"/>
<param name="baseInstancesOffset" type="GLuint"/>
<param name="baseInstancesOffset" type="unsigned long long"/>
<param name="drawcount" type="GLsizei"/>
</function>
<function name="multiDrawElementsInstancedBaseVertexBaseInstanceWEBGL" type="undefined">
<param name="mode" type="GLenum"/>
<param name="countsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="countsOffset" type="GLuint"/>
<param name="countsOffset" type="unsigned long long"/>
<param name="type" type="GLenum"/>
<param name="offsetsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="offsetsOffset" type="GLuint"/>
<param name="offsetsOffset" type="unsigned long long"/>
<param name="instanceCountsList" type="([AllowShared] Int32Array or sequence&lt;GLsizei&gt;)"/>
<param name="instanceCountsOffset" type="GLuint"/>
<param name="instanceCountsOffset" type="unsigned long long"/>
<param name="baseVerticesList" type="([AllowShared] Int32Array or sequence&lt;GLint&gt;)"/>
<param name="baseVerticesOffset" type="GLuint"/>
<param name="baseVerticesOffset" type="unsigned long long"/>
<param name="baseInstancesList" type="([AllowShared] Uint32Array or sequence&lt;GLuint&gt;)"/>
<param name="baseInstancesOffset" type="GLuint"/>
<param name="baseInstancesOffset" type="unsigned long long"/>
<param name="drawcount" type="GLsizei"/>
</function>
</newfun>
Expand Down Expand Up @@ -216,5 +216,8 @@ void main() {
<revision date="2021/05/26">
<change>Removed GLSL extension and builtins.</change>
</revision>
<revision date="2023/09/08">
<change>Changed offset arguments to "unsigned long long" for Wasm.</change>
</revision>
</history>
</draft>
15 changes: 9 additions & 6 deletions extensions/WEBGL_shader_pixel_local_storage/extension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ interface WEBGL_shader_pixel_local_storage {
GLint layer);
undefined framebufferPixelLocalClearValuefvWEBGL(GLint plane,
Float32List value,
optional GLuint srcOffset = 0);
optional unsigned long long srcOffset = 0);
undefined framebufferPixelLocalClearValueivWEBGL(GLint plane,
Int32List value,
optional GLuint srcOffset = 0);
optional unsigned long long srcOffset = 0);
undefined framebufferPixelLocalClearValueuivWEBGL(GLint plane,
Uint32List value,
optional GLuint srcOffset = 0);
optional unsigned long long srcOffset = 0);
undefined beginPixelLocalStorageWEBGL(sequence&lt;GLenum&gt; loadops);
undefined endPixelLocalStorageWEBGL(sequence&lt;GLenum&gt; storeops);
undefined pixelLocalStorageBarrierWEBGL();
Expand Down Expand Up @@ -139,7 +139,7 @@ interface WEBGL_shader_pixel_local_storage {
<function name="framebufferPixelLocalClearValuefvWEBGL" type="undefined">
<param name="plane" type="GLint"/>
<param name="value" type="Float32List"/>
<param name="srcOffset" type="GLuint" default="0"/>
<param name="srcOffset" type="unsigned long long" default="0"/>
<p>
Sets the floating point clear value for the given plane.
</p>
Expand All @@ -154,7 +154,7 @@ interface WEBGL_shader_pixel_local_storage {
<function name="framebufferPixelLocalClearValueivWEBGL" type="undefined">
<param name="plane" type="GLint"/>
<param name="value" type="Int32List"/>
<param name="srcOffset" type="GLuint" default="0"/>
<param name="srcOffset" type="unsigned long long" default="0"/>
<p>
Sets the signed integer clear value for the given plane.
</p>
Expand All @@ -169,7 +169,7 @@ interface WEBGL_shader_pixel_local_storage {
<function name="framebufferPixelLocalClearValueuivWEBGL" type="undefined">
<param name="plane" type="GLint"/>
<param name="value" type="Uint32List"/>
<param name="srcOffset" type="GLuint" default="0"/>
<param name="srcOffset" type="unsigned long long" default="0"/>
<p>
Sets the unsigned integer clear value for the given plane.
</p>
Expand Down Expand Up @@ -279,5 +279,8 @@ interface WEBGL_shader_pixel_local_storage {
<revision date="2022/12/06">
<change>Initial Draft.</change>
</revision>
<revision date="2023/09/08">
<change>Changed srcOffset arguments to "unsigned long long" for Wasm.</change>
</revision>
</history>
</draft>

0 comments on commit 21a1221

Please sign in to comment.