aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2020-01-17 12:55:14 -0500
committerGitHub <noreply@github.com>2020-01-17 12:55:14 -0500
commitf200e2106499d412890fdc750485d7e9c1d4dcf8 (patch)
tree251f8bc402e117367a89e75c6f4b2ad2ffa040c3
parent1de92906e8205e5e46ae947378dd916905fbbf7f (diff)
parent7d5048f8852df0de2a0a86cb16e2a54f493b6e7c (diff)
downloadservo-f200e2106499d412890fdc750485d7e9c1d4dcf8.tar.gz
servo-f200e2106499d412890fdc750485d7e9c1d4dcf8.zip
Auto merge of #25543 - szeged:mmatyas__webgl_fns_uniforms_p3, r=jdm
Add support for WebGL2 uniform matrix operations Adds support for the `uniformMatrix[234]x[234]fv` WebGL2 functions. See: https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8 <!-- Please describe your changes on the following line: --> Note: Similarly to #25538, some of the functions here also overlap with their WebGL 1 variant. cc @jdm @zakorgy @imiklos --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
-rw-r--r--Cargo.lock4
-rw-r--r--components/canvas/Cargo.toml2
-rw-r--r--components/canvas/webgl_thread.rs60
-rw-r--r--components/canvas_traits/webgl.rs12
-rw-r--r--components/script/dom/webgl2renderingcontext.rs221
-rw-r--r--components/script/dom/webglrenderingcontext.rs70
-rw-r--r--components/script/dom/webidls/WebGL2RenderingContext.webidl34
-rw-r--r--components/script/dom/webidls/WebGLRenderingContext.webidl9
-rw-r--r--tests/wpt/webgl/meta/conformance2/context/methods-2.html.ini70
-rw-r--r--tests/wpt/webgl/meta/conformance2/uniforms/gl-uniform-arrays-sub-source.html.ini77
10 files changed, 369 insertions, 190 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 56b40c0fb87..2e4269c87cd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5540,9 +5540,9 @@ dependencies = [
[[package]]
name = "sparkle"
-version = "0.1.14"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5ca7ee308d5e35a3b71728e17250778cf589a92ec56196e84380def310804309"
+checksum = "69ff56f232996280b7ac243ad746194fcd7a008104ffc70f0ed3494d07bc442a"
dependencies = [
"gl_generator 0.13.1",
]
diff --git a/components/canvas/Cargo.toml b/components/canvas/Cargo.toml
index 4ffb50b21f6..e35d2dd6a2f 100644
--- a/components/canvas/Cargo.toml
+++ b/components/canvas/Cargo.toml
@@ -34,7 +34,7 @@ num-traits = "0.2"
raqote = {git = "https://github.com/jrmuizel/raqote", optional = true}
pixels = {path = "../pixels"}
servo_config = {path = "../config"}
-sparkle = "0.1.14"
+sparkle = "0.1.16"
webrender = {git = "https://github.com/servo/webrender"}
webrender_api = {git = "https://github.com/servo/webrender"}
webrender_traits = {path = "../webrender_traits"}
diff --git a/components/canvas/webgl_thread.rs b/components/canvas/webgl_thread.rs
index d536b52d0bc..0919ebd387e 100644
--- a/components/canvas/webgl_thread.rs
+++ b/components/canvas/webgl_thread.rs
@@ -1343,6 +1343,24 @@ impl WebGLImpl {
WebGLCommand::UniformMatrix4fv(uniform_id, ref v) => {
gl.uniform_matrix_4fv(uniform_id, false, v)
},
+ WebGLCommand::UniformMatrix3x2fv(uniform_id, ref v) => {
+ gl.uniform_matrix_3x2fv(uniform_id, false, v)
+ },
+ WebGLCommand::UniformMatrix4x2fv(uniform_id, ref v) => {
+ gl.uniform_matrix_4x2fv(uniform_id, false, v)
+ },
+ WebGLCommand::UniformMatrix2x3fv(uniform_id, ref v) => {
+ gl.uniform_matrix_2x3fv(uniform_id, false, v)
+ },
+ WebGLCommand::UniformMatrix4x3fv(uniform_id, ref v) => {
+ gl.uniform_matrix_4x3fv(uniform_id, false, v)
+ },
+ WebGLCommand::UniformMatrix2x4fv(uniform_id, ref v) => {
+ gl.uniform_matrix_2x4fv(uniform_id, false, v)
+ },
+ WebGLCommand::UniformMatrix3x4fv(uniform_id, ref v) => {
+ gl.uniform_matrix_3x4fv(uniform_id, false, v)
+ },
WebGLCommand::ValidateProgram(program_id) => gl.validate_program(program_id.get()),
WebGLCommand::VertexAttrib(attrib_id, x, y, z, w) => {
gl.vertex_attrib_4f(attrib_id, x, y, z, w)
@@ -1783,6 +1801,48 @@ impl WebGLImpl {
}
sender.send(value).unwrap();
},
+ WebGLCommand::GetUniformFloat2x3(program_id, loc, ref sender) => {
+ let mut value = [0.; 2 * 3];
+ unsafe {
+ gl.get_uniform_fv(program_id.get(), loc, &mut value);
+ }
+ sender.send(value).unwrap()
+ },
+ WebGLCommand::GetUniformFloat2x4(program_id, loc, ref sender) => {
+ let mut value = [0.; 2 * 4];
+ unsafe {
+ gl.get_uniform_fv(program_id.get(), loc, &mut value);
+ }
+ sender.send(value).unwrap()
+ },
+ WebGLCommand::GetUniformFloat3x2(program_id, loc, ref sender) => {
+ let mut value = [0.; 3 * 2];
+ unsafe {
+ gl.get_uniform_fv(program_id.get(), loc, &mut value);
+ }
+ sender.send(value).unwrap()
+ },
+ WebGLCommand::GetUniformFloat3x4(program_id, loc, ref sender) => {
+ let mut value = [0.; 3 * 4];
+ unsafe {
+ gl.get_uniform_fv(program_id.get(), loc, &mut value);
+ }
+ sender.send(value).unwrap()
+ },
+ WebGLCommand::GetUniformFloat4x2(program_id, loc, ref sender) => {
+ let mut value = [0.; 4 * 2];
+ unsafe {
+ gl.get_uniform_fv(program_id.get(), loc, &mut value);
+ }
+ sender.send(value).unwrap()
+ },
+ WebGLCommand::GetUniformFloat4x3(program_id, loc, ref sender) => {
+ let mut value = [0.; 4 * 3];
+ unsafe {
+ gl.get_uniform_fv(program_id.get(), loc, &mut value);
+ }
+ sender.send(value).unwrap()
+ },
WebGLCommand::GetUniformBlockIndex(program_id, ref name, ref sender) => {
let name = to_name_in_compiled_shader(name);
let index = gl.get_uniform_block_index(program_id.get(), &name);
diff --git a/components/canvas_traits/webgl.rs b/components/canvas_traits/webgl.rs
index 077a2e737bc..6d3bd9bdc09 100644
--- a/components/canvas_traits/webgl.rs
+++ b/components/canvas_traits/webgl.rs
@@ -351,6 +351,12 @@ pub enum WebGLCommand {
UniformMatrix2fv(i32, Vec<f32>),
UniformMatrix3fv(i32, Vec<f32>),
UniformMatrix4fv(i32, Vec<f32>),
+ UniformMatrix3x2fv(i32, Vec<f32>),
+ UniformMatrix4x2fv(i32, Vec<f32>),
+ UniformMatrix2x3fv(i32, Vec<f32>),
+ UniformMatrix4x3fv(i32, Vec<f32>),
+ UniformMatrix2x4fv(i32, Vec<f32>),
+ UniformMatrix3x4fv(i32, Vec<f32>),
UseProgram(Option<WebGLProgramId>),
ValidateProgram(WebGLProgramId),
VertexAttrib(u32, f32, f32, f32, f32),
@@ -474,6 +480,12 @@ pub enum WebGLCommand {
GetUniformFloat4(WebGLProgramId, i32, WebGLSender<[f32; 4]>),
GetUniformFloat9(WebGLProgramId, i32, WebGLSender<[f32; 9]>),
GetUniformFloat16(WebGLProgramId, i32, WebGLSender<[f32; 16]>),
+ GetUniformFloat2x3(WebGLProgramId, i32, WebGLSender<[f32; 2 * 3]>),
+ GetUniformFloat2x4(WebGLProgramId, i32, WebGLSender<[f32; 2 * 4]>),
+ GetUniformFloat3x2(WebGLProgramId, i32, WebGLSender<[f32; 3 * 2]>),
+ GetUniformFloat3x4(WebGLProgramId, i32, WebGLSender<[f32; 3 * 4]>),
+ GetUniformFloat4x2(WebGLProgramId, i32, WebGLSender<[f32; 4 * 2]>),
+ GetUniformFloat4x3(WebGLProgramId, i32, WebGLSender<[f32; 4 * 3]>),
GetUniformBlockIndex(WebGLProgramId, String, WebGLSender<u32>),
GetUniformIndices(WebGLProgramId, Vec<String>, WebGLSender<Vec<u32>>),
GetActiveUniforms(WebGLProgramId, Vec<u32>, u32, WebGLSender<Vec<i32>>),
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs
index 2f847cebd3f..3b666f515e2 100644
--- a/components/script/dom/webgl2renderingcontext.rs
+++ b/components/script/dom/webgl2renderingcontext.rs
@@ -50,7 +50,7 @@ use js::jsapi::{JSObject, Type};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, UInt32Value};
use js::jsval::{JSVal, NullValue, ObjectValue, UndefinedValue};
use js::rust::CustomAutoRooterGuard;
-use js::typedarray::{ArrayBufferView, CreateWith, Uint32, Uint32Array};
+use js::typedarray::{ArrayBufferView, CreateWith, Float32, Uint32, Uint32Array};
use script_layout_interface::HTMLCanvasDataSource;
use std::cell::Cell;
use std::cmp;
@@ -1761,8 +1761,11 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
location: Option<&WebGLUniformLocation>,
transpose: bool,
v: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
- self.base.UniformMatrix2fv(location, transpose, v)
+ self.base
+ .UniformMatrix2fv(location, transpose, v, src_offset, src_length)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -1771,8 +1774,11 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
location: Option<&WebGLUniformLocation>,
transpose: bool,
v: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
- self.base.UniformMatrix3fv(location, transpose, v)
+ self.base
+ .UniformMatrix3fv(location, transpose, v, src_offset, src_length)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -1781,8 +1787,179 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
location: Option<&WebGLUniformLocation>,
transpose: bool,
v: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base
+ .UniformMatrix4fv(location, transpose, v, src_offset, src_length)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
+ fn UniformMatrix3x2fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
- self.base.UniformMatrix4fv(location, transpose, v)
+ self.base.with_location(location, |location| {
+ match location.type_() {
+ constants::FLOAT_MAT3x2 => {},
+ _ => return Err(InvalidOperation),
+ }
+ let val = self.base.uniform_matrix_section(
+ val,
+ src_offset,
+ src_length,
+ transpose,
+ 3 * 2,
+ location,
+ )?;
+ self.base
+ .send_command(WebGLCommand::UniformMatrix3x2fv(location.id(), val));
+ Ok(())
+ });
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
+ fn UniformMatrix4x2fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.with_location(location, |location| {
+ match location.type_() {
+ constants::FLOAT_MAT4x2 => {},
+ _ => return Err(InvalidOperation),
+ }
+ let val = self.base.uniform_matrix_section(
+ val,
+ src_offset,
+ src_length,
+ transpose,
+ 4 * 2,
+ location,
+ )?;
+ self.base
+ .send_command(WebGLCommand::UniformMatrix4x2fv(location.id(), val));
+ Ok(())
+ });
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
+ fn UniformMatrix2x3fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.with_location(location, |location| {
+ match location.type_() {
+ constants::FLOAT_MAT2x3 => {},
+ _ => return Err(InvalidOperation),
+ }
+ let val = self.base.uniform_matrix_section(
+ val,
+ src_offset,
+ src_length,
+ transpose,
+ 2 * 3,
+ location,
+ )?;
+ self.base
+ .send_command(WebGLCommand::UniformMatrix2x3fv(location.id(), val));
+ Ok(())
+ });
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
+ fn UniformMatrix4x3fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.with_location(location, |location| {
+ match location.type_() {
+ constants::FLOAT_MAT4x3 => {},
+ _ => return Err(InvalidOperation),
+ }
+ let val = self.base.uniform_matrix_section(
+ val,
+ src_offset,
+ src_length,
+ transpose,
+ 4 * 3,
+ location,
+ )?;
+ self.base
+ .send_command(WebGLCommand::UniformMatrix4x3fv(location.id(), val));
+ Ok(())
+ });
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
+ fn UniformMatrix2x4fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.with_location(location, |location| {
+ match location.type_() {
+ constants::FLOAT_MAT2x4 => {},
+ _ => return Err(InvalidOperation),
+ }
+ let val = self.base.uniform_matrix_section(
+ val,
+ src_offset,
+ src_length,
+ transpose,
+ 2 * 4,
+ location,
+ )?;
+ self.base
+ .send_command(WebGLCommand::UniformMatrix2x4fv(location.id(), val));
+ Ok(())
+ });
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
+ fn UniformMatrix3x4fv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ transpose: bool,
+ val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.with_location(location, |location| {
+ match location.type_() {
+ constants::FLOAT_MAT3x4 => {},
+ _ => return Err(InvalidOperation),
+ }
+ let val = self.base.uniform_matrix_section(
+ val,
+ src_offset,
+ src_length,
+ transpose,
+ 3 * 4,
+ location,
+ )?;
+ self.base
+ .send_command(WebGLCommand::UniformMatrix3x4fv(location.id(), val));
+ Ok(())
+ });
}
/// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
@@ -1814,6 +1991,42 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
constants::UNSIGNED_INT_VEC4 => unsafe {
uniform_typed::<Uint32>(*cx, &uniform_get(triple, WebGLCommand::GetUniformUint4))
},
+ constants::FLOAT_MAT2x3 => unsafe {
+ uniform_typed::<Float32>(
+ *cx,
+ &uniform_get(triple, WebGLCommand::GetUniformFloat2x3),
+ )
+ },
+ constants::FLOAT_MAT2x4 => unsafe {
+ uniform_typed::<Float32>(
+ *cx,
+ &uniform_get(triple, WebGLCommand::GetUniformFloat2x4),
+ )
+ },
+ constants::FLOAT_MAT3x2 => unsafe {
+ uniform_typed::<Float32>(
+ *cx,
+ &uniform_get(triple, WebGLCommand::GetUniformFloat3x2),
+ )
+ },
+ constants::FLOAT_MAT3x4 => unsafe {
+ uniform_typed::<Float32>(
+ *cx,
+ &uniform_get(triple, WebGLCommand::GetUniformFloat3x4),
+ )
+ },
+ constants::FLOAT_MAT4x2 => unsafe {
+ uniform_typed::<Float32>(
+ *cx,
+ &uniform_get(triple, WebGLCommand::GetUniformFloat4x2),
+ )
+ },
+ constants::FLOAT_MAT4x3 => unsafe {
+ uniform_typed::<Float32>(
+ *cx,
+ &uniform_get(triple, WebGLCommand::GetUniformFloat4x3),
+ )
+ },
_ => self.base.GetUniform(cx, program, location),
}
}
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index fdd04297446..460f50aaada 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -1322,6 +1322,25 @@ impl WebGLRenderingContext {
Ok(vec)
}
+
+ pub fn uniform_matrix_section(
+ &self,
+ vec: Float32ArrayOrUnrestrictedFloatSequence,
+ offset: u32,
+ length: u32,
+ transpose: bool,
+ uniform_size: usize,
+ uniform_location: &WebGLUniformLocation,
+ ) -> WebGLResult<Vec<f32>> {
+ let vec = match vec {
+ Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+ Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+ };
+ if transpose {
+ return Err(InvalidValue);
+ }
+ self.uniform_vec_section::<f32>(vec, offset, length, uniform_size, uniform_location)
+ }
}
#[cfg(not(feature = "webgl_backtrace"))]
@@ -3526,25 +3545,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
location: Option<&WebGLUniformLocation>,
transpose: bool,
val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
self.with_location(location, |location| {
match location.type_() {
constants::FLOAT_MAT2 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
- Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
- };
- if transpose {
- return Err(InvalidValue);
- }
- if val.len() < 4 || val.len() % 4 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 4 {
- return Err(InvalidOperation);
- }
+ let val =
+ self.uniform_matrix_section(val, src_offset, src_length, transpose, 4, location)?;
self.send_command(WebGLCommand::UniformMatrix2fv(location.id(), val));
Ok(())
});
@@ -3556,25 +3566,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
location: Option<&WebGLUniformLocation>,
transpose: bool,
val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
self.with_location(location, |location| {
match location.type_() {
constants::FLOAT_MAT3 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
- Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
- };
- if transpose {
- return Err(InvalidValue);
- }
- if val.len() < 9 || val.len() % 9 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 9 {
- return Err(InvalidOperation);
- }
+ let val =
+ self.uniform_matrix_section(val, src_offset, src_length, transpose, 9, location)?;
self.send_command(WebGLCommand::UniformMatrix3fv(location.id(), val));
Ok(())
});
@@ -3586,25 +3587,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
location: Option<&WebGLUniformLocation>,
transpose: bool,
val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
self.with_location(location, |location| {
match location.type_() {
constants::FLOAT_MAT4 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
- Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
- };
- if transpose {
- return Err(InvalidValue);
- }
- if val.len() < 16 || val.len() % 16 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 16 {
- return Err(InvalidOperation);
- }
+ let val =
+ self.uniform_matrix_section(val, src_offset, src_length, transpose, 16, location)?;
self.send_command(WebGLCommand::UniformMatrix4fv(location.id(), val));
Ok(())
});
diff --git a/components/script/dom/webidls/WebGL2RenderingContext.webidl b/components/script/dom/webidls/WebGL2RenderingContext.webidl
index 68ee72db8b6..859bfaf33c7 100644
--- a/components/script/dom/webidls/WebGL2RenderingContext.webidl
+++ b/components/script/dom/webidls/WebGL2RenderingContext.webidl
@@ -439,26 +439,20 @@ interface mixin WebGL2RenderingContextBase
void uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
optional GLuint srcLength = 0);
- // void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- // void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- // void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
-
- // void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- // void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- // void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
-
- // void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- // void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
- // void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
- // optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+
+ void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+
+ void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
/* Vertex attribs */
// void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
diff --git a/components/script/dom/webidls/WebGLRenderingContext.webidl b/components/script/dom/webidls/WebGLRenderingContext.webidl
index e56f08ccacf..a9af389b042 100644
--- a/components/script/dom/webidls/WebGLRenderingContext.webidl
+++ b/components/script/dom/webidls/WebGLRenderingContext.webidl
@@ -668,9 +668,12 @@ interface mixin WebGLRenderingContextBase
void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
optional GLuint srcLength = 0);
- void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
- void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
- void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
+ void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
+ void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
+ optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
void useProgram(WebGLProgram? program);
void validateProgram(WebGLProgram program);
diff --git a/tests/wpt/webgl/meta/conformance2/context/methods-2.html.ini b/tests/wpt/webgl/meta/conformance2/context/methods-2.html.ini
index c6e5ab11d50..bdd05f075a2 100644
--- a/tests/wpt/webgl/meta/conformance2/context/methods-2.html.ini
+++ b/tests/wpt/webgl/meta/conformance2/context/methods-2.html.ini
@@ -1,35 +1,26 @@
[methods-2.html]
- [WebGL test #33: Property either does not exist or is not a function: getIndexedParameter]
+ [WebGL test #16: Property either does not exist or is not a function: vertexAttribI4i]
expected: FAIL
- [WebGL test #34: Property either does not exist or is not a function: createVertexArray]
+ [WebGL test #19: Property either does not exist or is not a function: vertexAttribI4uiv]
expected: FAIL
- [WebGL test #36: Property either does not exist or is not a function: isVertexArray]
- expected: FAIL
-
- [WebGL test #18: Property either does not exist or is not a function: uniformMatrix2x4fv]
- expected: FAIL
-
- [WebGL test #25: Property either does not exist or is not a function: vertexAttribI4uiv]
- expected: FAIL
-
- [WebGL test #30: Property either does not exist or is not a function: clearBufferuiv]
+ [WebGL test #2: Property either does not exist or is not a function: framebufferTextureLayer]
expected: FAIL
- [WebGL test #26: Property either does not exist or is not a function: vertexAttribIPointer]
+ [WebGL test #18: Property either does not exist or is not a function: vertexAttribI4ui]
expected: FAIL
- [WebGL test #2: Property either does not exist or is not a function: framebufferTextureLayer]
+ [WebGL test #15: Property either does not exist or is not a function: getFragDataLocation]
expected: FAIL
- [WebGL test #19: Property either does not exist or is not a function: uniformMatrix4x2fv]
+ [WebGL test #17: Property either does not exist or is not a function: vertexAttribI4iv]
expected: FAIL
- [WebGL test #15: Property either does not exist or is not a function: getFragDataLocation]
+ [WebGL test #4: Property either does not exist or is not a function: invalidateFramebuffer]
expected: FAIL
- [WebGL test #4: Property either does not exist or is not a function: invalidateFramebuffer]
+ [WebGL test #30: Property either does not exist or is not a function: isVertexArray]
expected: FAIL
[WebGL test #7: Property either does not exist or is not a function: renderbufferStorageMultisample]
@@ -38,78 +29,69 @@
[WebGL test #10: Property either does not exist or is not a function: texStorage3D]
expected: FAIL
+ [WebGL test #29: Property either does not exist or is not a function: deleteVertexArray]
+ expected: FAIL
+
[WebGL test #1: Property either does not exist or is not a function: blitFramebuffer]
expected: FAIL
- [WebGL test #29: Property either does not exist or is not a function: clearBufferiv]
+ [WebGL test #11: Property either does not exist or is not a function: texSubImage3D]
expected: FAIL
- [WebGL test #17: Property either does not exist or is not a function: uniformMatrix3x2fv]
+ [WebGL test #20: Property either does not exist or is not a function: vertexAttribIPointer]
expected: FAIL
- [WebGL test #37: Property either does not exist or is not a function: bindVertexArray]
+ [WebGL test #27: Property either does not exist or is not a function: getIndexedParameter]
expected: FAIL
[WebGL test #3: Property either does not exist or is not a function: getInternalformatParameter]
expected: FAIL
- [WebGL test #24: Property either does not exist or is not a function: vertexAttribI4ui]
+ [WebGL test #23: Property either does not exist or is not a function: clearBufferiv]
expected: FAIL
- [WebGL test #32: Property either does not exist or is not a function: clearBufferfi]
+ [WebGL test #21: Property either does not exist or is not a function: drawRangeElements]
expected: FAIL
- [WebGL test #16: Property either does not exist or is not a function: uniformMatrix2x3fv]
+ [WebGL test #26: Property either does not exist or is not a function: clearBufferfi]
expected: FAIL
[WebGL test #13: Property either does not exist or is not a function: compressedTexImage3D]
expected: FAIL
- [WebGL test #22: Property either does not exist or is not a function: vertexAttribI4i]
- expected: FAIL
-
[WebGL test #12: Property either does not exist or is not a function: copyTexSubImage3D]
expected: FAIL
- [WebGL test #8: Property either does not exist or is not a function: texImage3D]
- expected: FAIL
-
- [WebGL test #0: Property either does not exist or is not a function: isContextLost]
+ [WebGL test #22: Property either does not exist or is not a function: drawBuffers]
expected: FAIL
- [WebGL test #31: Property either does not exist or is not a function: clearBufferfv]
+ [WebGL test #8: Property either does not exist or is not a function: texImage3D]
expected: FAIL
- [WebGL test #28: Property either does not exist or is not a function: drawBuffers]
+ [WebGL test #28: Property either does not exist or is not a function: createVertexArray]
expected: FAIL
- [WebGL test #23: Property either does not exist or is not a function: vertexAttribI4iv]
+ [WebGL test #0: Property either does not exist or is not a function: isContextLost]
expected: FAIL
- [WebGL test #21: Property either does not exist or is not a function: uniformMatrix4x3fv]
+ [WebGL test #25: Property either does not exist or is not a function: clearBufferfv]
expected: FAIL
- [WebGL test #11: Property either does not exist or is not a function: texSubImage3D]
+ [WebGL test #24: Property either does not exist or is not a function: clearBufferuiv]
expected: FAIL
[WebGL test #9: Property either does not exist or is not a function: texStorage2D]
expected: FAIL
- [WebGL test #27: Property either does not exist or is not a function: drawRangeElements]
- expected: FAIL
-
- [WebGL test #20: Property either does not exist or is not a function: uniformMatrix3x4fv]
- expected: FAIL
-
[WebGL test #6: Property either does not exist or is not a function: readBuffer]
expected: FAIL
- [WebGL test #35: Property either does not exist or is not a function: deleteVertexArray]
- expected: FAIL
-
[WebGL test #5: Property either does not exist or is not a function: invalidateSubFramebuffer]
expected: FAIL
[WebGL test #14: Property either does not exist or is not a function: compressedTexSubImage3D]
expected: FAIL
+ [WebGL test #31: Property either does not exist or is not a function: bindVertexArray]
+ expected: FAIL
+
diff --git a/tests/wpt/webgl/meta/conformance2/uniforms/gl-uniform-arrays-sub-source.html.ini b/tests/wpt/webgl/meta/conformance2/uniforms/gl-uniform-arrays-sub-source.html.ini
deleted file mode 100644
index a5c67c9ceb8..00000000000
--- a/tests/wpt/webgl/meta/conformance2/uniforms/gl-uniform-arrays-sub-source.html.ini
+++ /dev/null
@@ -1,77 +0,0 @@
-[gl-uniform-arrays-sub-source.html]
- expected: ERROR
- [WebGL test #1135: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix4fv with 0 data]
- expected: FAIL
-
- [WebGL test #1058: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix3fv with srcOffset + srcLength out-of-bounds]
- expected: FAIL
-
- [WebGL test #959: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix2fv with srcOffset = 3 / srcLength = 0]
- expected: FAIL
-
- [WebGL test #1121: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix4fv with srcOffset = 2 / srcLength = 16]
- expected: FAIL
-
- [WebGL test #1059: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix3fv with 0 data]
- expected: FAIL
-
- [WebGL test #1132: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix4fv with srcOffset out-of-bounds]
- expected: FAIL
-
- [WebGL test #972: value put in (16,15,14,13) matches value pulled out (0,0,0,16)]
- expected: FAIL
-
- [WebGL test #1133: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix4fv with srcLength out-of-bounds]
- expected: FAIL
-
- [WebGL test #1057: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix3fv with srcLength out-of-bounds]
- expected: FAIL
-
- [WebGL test #1137: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
- expected: FAIL
-
- [WebGL test #1111: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix4fv with srcOffset = 2 / srcLength = 0]
- expected: FAIL
-
- [WebGL test #1045: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix3fv with srcOffset = 3 / srcLength = 9]
- expected: FAIL
-
- [WebGL test #1056: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix3fv with srcOffset out-of-bounds]
- expected: FAIL
-
- [WebGL test #981: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix2fv with srcLength out-of-bounds]
- expected: FAIL
-
- [WebGL test #1101: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix4fv with srcOffset = 2]
- expected: FAIL
-
- [WebGL test #1134: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix4fv with srcOffset + srcLength out-of-bounds]
- expected: FAIL
-
- [WebGL test #978: value put in (99,99,99,99) matches value pulled out (11,10,9,0)]
- expected: FAIL
-
- [WebGL test #984: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix2fv with array length minus srcOffset not multiple of mat2]
- expected: FAIL
-
- [WebGL test #980: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix2fv with srcOffset out-of-bounds]
- expected: FAIL
-
- [WebGL test #1035: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix3fv with srcOffset = 3 / srcLength = 0]
- expected: FAIL
-
- [WebGL test #1025: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix3fv with srcOffset = 3]
- expected: FAIL
-
- [WebGL test #982: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix2fv with srcOffset + srcLength out-of-bounds]
- expected: FAIL
-
- [WebGL test #949: getError expected: NO_ERROR. Was INVALID_VALUE : can set an array of uniforms with gl.uniformMatrix2fv with srcOffset = 3]
- expected: FAIL
-
- [WebGL test #983: getError expected: INVALID_VALUE. Was NO_ERROR : gl.uniformMatrix2fv with 0 data]
- expected: FAIL
-
- [WebGL test #975: value put in (12,11,10,9) matches value pulled out (15,14,13,12)]
- expected: FAIL
-