Bug 1048745 - Uniform array with Uint32Array. r=jgilbert, r=smaug
authorDan Glastonbury <dglastonbury@mozilla.com>
Mon, 23 Mar 2015 11:21:17 +1000
changeset 266102 ddf60eb38236d036ae1efa0765a57037eb52742f
parent 266101 6516456a0a6307f96fc366c8b8f3b596ff4a1019
child 266103 d245389ba33c820583371691b3f23b7b3cad46e7
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert, smaug
bugs1048745
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1048745 - Uniform array with Uint32Array. r=jgilbert, r=smaug
dom/canvas/WebGL2Context.h
dom/webidl/WebGL2RenderingContext.webidl
--- a/dom/canvas/WebGL2Context.h
+++ b/dom/canvas/WebGL2Context.h
@@ -117,26 +117,42 @@ public:
 private:
     void Uniform1uiv_base(WebGLUniformLocation* loc, size_t arrayLength, const GLuint* data);
     void Uniform2uiv_base(WebGLUniformLocation* loc, size_t arrayLength, const GLuint* data);
     void Uniform3uiv_base(WebGLUniformLocation* loc, size_t arrayLength, const GLuint* data);
     void Uniform4uiv_base(WebGLUniformLocation* loc, size_t arrayLength, const GLuint* data);
 
 public:
     void Uniform1uiv(WebGLUniformLocation* loc, const dom::Sequence<GLuint>& arr) {
-        Uniform1uiv_base(loc,arr.Length(), arr.Elements());
+        Uniform1uiv_base(loc, arr.Length(), arr.Elements());
     }
     void Uniform2uiv(WebGLUniformLocation* loc, const dom::Sequence<GLuint>& arr) {
-        Uniform2uiv_base(loc,arr.Length(), arr.Elements());
+        Uniform2uiv_base(loc, arr.Length(), arr.Elements());
     }
     void Uniform3uiv(WebGLUniformLocation* loc, const dom::Sequence<GLuint>& arr) {
-        Uniform3uiv_base(loc,arr.Length(), arr.Elements());
+        Uniform3uiv_base(loc, arr.Length(), arr.Elements());
     }
     void Uniform4uiv(WebGLUniformLocation* loc, const dom::Sequence<GLuint>& arr) {
-        Uniform4uiv_base(loc,arr.Length(), arr.Elements());
+        Uniform4uiv_base(loc, arr.Length(), arr.Elements());
+    }
+    void Uniform1uiv(WebGLUniformLocation* loc, const dom::Uint32Array& arr) {
+        arr.ComputeLengthAndData();
+        Uniform1uiv_base(loc, arr.Length(), arr.Data());
+    }
+    void Uniform2uiv(WebGLUniformLocation* loc, const dom::Uint32Array& arr) {
+        arr.ComputeLengthAndData();
+        Uniform2uiv_base(loc, arr.Length(), arr.Data());
+    }
+    void Uniform3uiv(WebGLUniformLocation* loc, const dom::Uint32Array& arr) {
+        arr.ComputeLengthAndData();
+        Uniform3uiv_base(loc, arr.Length(), arr.Data());
+    }
+    void Uniform4uiv(WebGLUniformLocation* loc, const dom::Uint32Array& arr) {
+        arr.ComputeLengthAndData();
+        Uniform4uiv_base(loc, arr.Length(), arr.Data());
     }
 
 private:
     void UniformMatrix2x3fv_base(WebGLUniformLocation* loc, bool transpose,
                                  size_t arrayLength, const GLfloat* data);
     void UniformMatrix3x2fv_base(WebGLUniformLocation* loc, bool transpose,
                                  size_t arrayLength, const GLfloat* data);
     void UniformMatrix2x4fv_base(WebGLUniformLocation* loc, bool transpose,
--- a/dom/webidl/WebGL2RenderingContext.webidl
+++ b/dom/webidl/WebGL2RenderingContext.webidl
@@ -370,19 +370,23 @@ interface WebGL2RenderingContext : WebGL
     /* Programs and shaders */
     [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram? program, DOMString name);
 
     /* Uniforms and attributes */
     void uniform1ui(WebGLUniformLocation? location, GLuint v0);
     void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
     void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
     void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+    void uniform1uiv(WebGLUniformLocation? location, Uint32Array value);
     void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+    void uniform2uiv(WebGLUniformLocation? location, Uint32Array value);
     void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+    void uniform3uiv(WebGLUniformLocation? location, Uint32Array value);
     void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> value);
+    void uniform4uiv(WebGLUniformLocation? location, Uint32Array value);
     void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> value);
     void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
     void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
     void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
     void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
     void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
     void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
     void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);