From 340ddfb63ac08bba99ac0a0e9be7853db9a73988 Mon Sep 17 00:00:00 2001 From: autokagami Date: Sun, 18 Oct 2020 19:49:16 +0200 Subject: [PATCH 1/2] [WEBGL_multi_draw] Align with Web IDL specification --- extensions/WEBGL_multi_draw/extension.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/WEBGL_multi_draw/extension.xml b/extensions/WEBGL_multi_draw/extension.xml index ec97ebf132..7e495b9acc 100644 --- a/extensions/WEBGL_multi_draw/extension.xml +++ b/extensions/WEBGL_multi_draw/extension.xml @@ -64,26 +64,26 @@ -[NoInterfaceObject] +[Exposed=Window, LegacyNoInterfaceObject] interface WEBGL_multi_draw { - void multiDrawArraysWEBGL( + undefined multiDrawArraysWEBGL( GLenum mode, (Int32Array or sequence<GLint>) firstsList, GLuint firstsOffset, (Int32Array or sequence<GLsizei>) countsList, GLuint countsOffset, GLsizei drawcount); - void multiDrawElementsWEBGL( + undefined multiDrawElementsWEBGL( GLenum mode, (Int32Array or sequence<GLint>) countsList, GLuint countsOffset, GLenum type, (Int32Array or sequence<GLsizei>) offsetsList, GLuint offsetsOffset, GLsizei drawcount); - void multiDrawArraysInstancedWEBGL( + 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, GLsizei drawcount); - void multiDrawElementsInstancedWEBGL( + undefined multiDrawElementsInstancedWEBGL( GLenum mode, (Int32Array or sequence<GLint>) countsList, GLuint countsOffset, GLenum type, From c2b723590a154eba60d75674c4ac60c76790782d Mon Sep 17 00:00:00 2001 From: autokagami Date: Mon, 11 Jan 2021 09:51:56 +0100 Subject: [PATCH 2/2] [WEBGL_multi_draw] Align with Web IDL specification --- extensions/WEBGL_multi_draw/extension.xml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/extensions/WEBGL_multi_draw/extension.xml b/extensions/WEBGL_multi_draw/extension.xml index 7e495b9acc..899e30db9d 100644 --- a/extensions/WEBGL_multi_draw/extension.xml +++ b/extensions/WEBGL_multi_draw/extension.xml @@ -45,7 +45,7 @@ The multiDrawArraysWEBGL, multiDrawElementsWEBGL, multiDrawArraysInstancedWEBGL, and multiDrawElementsInstancedWEBGL entry points are added. These provide a counterpoint to instanced rendering and are more flexible for certain scenarios. They behave identically to multiple calls to drawArrays, drawElements, drawArraysInstanced, and drawElementsInstanced except they handle multiple lists of arguments in one call. The gl_DrawID builtin is added to the shading language. For any Multi* draw call variant, the index of the draw i may be read by the vertex shader as gl_DrawID. For non Multi* calls, the value of gl_DrawID is 0. - + When this extension is enabled, the following extensions are enabled implicitly: @@ -54,7 +54,7 @@ ANGLE_instanced_arrays - + @@ -143,6 +143,7 @@ interface WEBGL_multi_draw {
 var ext = gl.getExtension("WEBGL_multi_draw");
 
+
 {
   // multiDrawArrays variant.
   let firsts = new Int32Array(...);
@@ -152,12 +153,10 @@ var ext = gl.getExtension("WEBGL_multi_draw");
 
 {
   // multiDrawElements variant.
-  // Assumes that the indices which have been previously uploaded to the
-  // ELEMENT_ARRAY_BUFFER are to be treated as UNSIGNED_SHORT.
   let counts = new Int32Array(...);
   let offsets = new Int32Array(...);
   ext.multiDrawElementsWEBGL(
-      gl.TRIANGLES, counts, 0, gl.UNSIGNED_SHORT, offsets, 0, counts.length);
+      gl.TRIANGLES, counts, 0, gl.UNSIGNED_INT, offsets, 0, counts.length);
 }
 
 {
@@ -171,13 +170,11 @@ var ext = gl.getExtension("WEBGL_multi_draw");
 
 {
   // multiDrawElementsInstanced variant.
-  // Assumes that the indices which have been previously uploaded to the
-  // ELEMENT_ARRAY_BUFFER are to be treated as UNSIGNED_SHORT.
   let counts = new Int32Array(...);
   let offsets = new Int32Array(...);
   let instanceCounts = new Int32Array(...);
   ext.multiDrawElementsInstancedWEBGL(
-      gl.TRIANGLES, counts, 0, gl.UNSIGNED_SHORT, offsets, 0, instanceCounts, 0,
+      gl.POINTS, counts, 0, gl.UNSIGNED_SHORT, offsets, 0, instanceCounts, 0,
       counts.length);
 }