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
This commit is contained in:
Mátyás Mustoha 2020-01-16 12:34:45 +01:00
parent 0650fc3199
commit 7d5048f885
10 changed files with 398 additions and 219 deletions

4
Cargo.lock generated
View file

@ -5282,9 +5282,9 @@ dependencies = [
[[package]] [[package]]
name = "sparkle" name = "sparkle"
version = "0.1.14" version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca7ee308d5e35a3b71728e17250778cf589a92ec56196e84380def310804309" checksum = "69ff56f232996280b7ac243ad746194fcd7a008104ffc70f0ed3494d07bc442a"
dependencies = [ dependencies = [
"gl_generator 0.13.1", "gl_generator 0.13.1",
] ]

View file

@ -34,7 +34,7 @@ num-traits = "0.2"
raqote = {git = "https://github.com/jrmuizel/raqote", optional = true} raqote = {git = "https://github.com/jrmuizel/raqote", optional = true}
pixels = {path = "../pixels"} pixels = {path = "../pixels"}
servo_config = {path = "../config"} servo_config = {path = "../config"}
sparkle = "0.1.14" sparkle = "0.1.16"
webrender = {git = "https://github.com/servo/webrender"} webrender = {git = "https://github.com/servo/webrender"}
webrender_api = {git = "https://github.com/servo/webrender"} webrender_api = {git = "https://github.com/servo/webrender"}
webrender_traits = {path = "../webrender_traits"} webrender_traits = {path = "../webrender_traits"}

View file

@ -1343,6 +1343,24 @@ impl WebGLImpl {
WebGLCommand::UniformMatrix4fv(uniform_id, ref v) => { WebGLCommand::UniformMatrix4fv(uniform_id, ref v) => {
gl.uniform_matrix_4fv(uniform_id, false, 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::ValidateProgram(program_id) => gl.validate_program(program_id.get()),
WebGLCommand::VertexAttrib(attrib_id, x, y, z, w) => { WebGLCommand::VertexAttrib(attrib_id, x, y, z, w) => {
gl.vertex_attrib_4f(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(); 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) => { WebGLCommand::GetUniformBlockIndex(program_id, ref name, ref sender) => {
let name = to_name_in_compiled_shader(name); let name = to_name_in_compiled_shader(name);
let index = gl.get_uniform_block_index(program_id.get(), &name); let index = gl.get_uniform_block_index(program_id.get(), &name);

View file

@ -351,6 +351,12 @@ pub enum WebGLCommand {
UniformMatrix2fv(i32, Vec<f32>), UniformMatrix2fv(i32, Vec<f32>),
UniformMatrix3fv(i32, Vec<f32>), UniformMatrix3fv(i32, Vec<f32>),
UniformMatrix4fv(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>), UseProgram(Option<WebGLProgramId>),
ValidateProgram(WebGLProgramId), ValidateProgram(WebGLProgramId),
VertexAttrib(u32, f32, f32, f32, f32), VertexAttrib(u32, f32, f32, f32, f32),
@ -474,6 +480,12 @@ pub enum WebGLCommand {
GetUniformFloat4(WebGLProgramId, i32, WebGLSender<[f32; 4]>), GetUniformFloat4(WebGLProgramId, i32, WebGLSender<[f32; 4]>),
GetUniformFloat9(WebGLProgramId, i32, WebGLSender<[f32; 9]>), GetUniformFloat9(WebGLProgramId, i32, WebGLSender<[f32; 9]>),
GetUniformFloat16(WebGLProgramId, i32, WebGLSender<[f32; 16]>), 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>), GetUniformBlockIndex(WebGLProgramId, String, WebGLSender<u32>),
GetUniformIndices(WebGLProgramId, Vec<String>, WebGLSender<Vec<u32>>), GetUniformIndices(WebGLProgramId, Vec<String>, WebGLSender<Vec<u32>>),
GetActiveUniforms(WebGLProgramId, Vec<u32>, u32, WebGLSender<Vec<i32>>), GetActiveUniforms(WebGLProgramId, Vec<u32>, u32, WebGLSender<Vec<i32>>),

View file

@ -50,7 +50,7 @@ use js::jsapi::{JSObject, Type};
use js::jsval::{BooleanValue, DoubleValue, Int32Value, UInt32Value}; use js::jsval::{BooleanValue, DoubleValue, Int32Value, UInt32Value};
use js::jsval::{JSVal, NullValue, ObjectValue, UndefinedValue}; use js::jsval::{JSVal, NullValue, ObjectValue, UndefinedValue};
use js::rust::CustomAutoRooterGuard; 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 script_layout_interface::HTMLCanvasDataSource;
use std::cell::Cell; use std::cell::Cell;
use std::cmp; use std::cmp;
@ -1744,8 +1744,11 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
location: Option<&WebGLUniformLocation>, location: Option<&WebGLUniformLocation>,
transpose: bool, transpose: bool,
v: Float32ArrayOrUnrestrictedFloatSequence, 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 /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@ -1754,8 +1757,11 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
location: Option<&WebGLUniformLocation>, location: Option<&WebGLUniformLocation>,
transpose: bool, transpose: bool,
v: Float32ArrayOrUnrestrictedFloatSequence, 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 /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@ -1764,8 +1770,179 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
location: Option<&WebGLUniformLocation>, location: Option<&WebGLUniformLocation>,
transpose: bool, transpose: bool,
v: Float32ArrayOrUnrestrictedFloatSequence, v: Float32ArrayOrUnrestrictedFloatSequence,
src_offset: u32,
src_length: u32,
) { ) {
self.base.UniformMatrix4fv(location, transpose, v) 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.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 /// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
@ -1797,6 +1974,42 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
constants::UNSIGNED_INT_VEC4 => unsafe { constants::UNSIGNED_INT_VEC4 => unsafe {
uniform_typed::<Uint32>(*cx, &uniform_get(triple, WebGLCommand::GetUniformUint4)) 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), _ => self.base.GetUniform(cx, program, location),
} }
} }

View file

@ -1322,6 +1322,25 @@ impl WebGLRenderingContext {
Ok(vec) 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"))] #[cfg(not(feature = "webgl_backtrace"))]
@ -3526,25 +3545,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
location: Option<&WebGLUniformLocation>, location: Option<&WebGLUniformLocation>,
transpose: bool, transpose: bool,
val: Float32ArrayOrUnrestrictedFloatSequence, val: Float32ArrayOrUnrestrictedFloatSequence,
src_offset: u32,
src_length: u32,
) { ) {
self.with_location(location, |location| { self.with_location(location, |location| {
match location.type_() { match location.type_() {
constants::FLOAT_MAT2 => {}, constants::FLOAT_MAT2 => {},
_ => return Err(InvalidOperation), _ => return Err(InvalidOperation),
} }
let val = match val { let val =
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(), self.uniform_matrix_section(val, src_offset, src_length, transpose, 4, location)?;
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);
}
self.send_command(WebGLCommand::UniformMatrix2fv(location.id(), val)); self.send_command(WebGLCommand::UniformMatrix2fv(location.id(), val));
Ok(()) Ok(())
}); });
@ -3556,25 +3566,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
location: Option<&WebGLUniformLocation>, location: Option<&WebGLUniformLocation>,
transpose: bool, transpose: bool,
val: Float32ArrayOrUnrestrictedFloatSequence, val: Float32ArrayOrUnrestrictedFloatSequence,
src_offset: u32,
src_length: u32,
) { ) {
self.with_location(location, |location| { self.with_location(location, |location| {
match location.type_() { match location.type_() {
constants::FLOAT_MAT3 => {}, constants::FLOAT_MAT3 => {},
_ => return Err(InvalidOperation), _ => return Err(InvalidOperation),
} }
let val = match val { let val =
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(), self.uniform_matrix_section(val, src_offset, src_length, transpose, 9, location)?;
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);
}
self.send_command(WebGLCommand::UniformMatrix3fv(location.id(), val)); self.send_command(WebGLCommand::UniformMatrix3fv(location.id(), val));
Ok(()) Ok(())
}); });
@ -3586,25 +3587,16 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
location: Option<&WebGLUniformLocation>, location: Option<&WebGLUniformLocation>,
transpose: bool, transpose: bool,
val: Float32ArrayOrUnrestrictedFloatSequence, val: Float32ArrayOrUnrestrictedFloatSequence,
src_offset: u32,
src_length: u32,
) { ) {
self.with_location(location, |location| { self.with_location(location, |location| {
match location.type_() { match location.type_() {
constants::FLOAT_MAT4 => {}, constants::FLOAT_MAT4 => {},
_ => return Err(InvalidOperation), _ => return Err(InvalidOperation),
} }
let val = match val { let val =
Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(), self.uniform_matrix_section(val, src_offset, src_length, transpose, 16, location)?;
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);
}
self.send_command(WebGLCommand::UniformMatrix4fv(location.id(), val)); self.send_command(WebGLCommand::UniformMatrix4fv(location.id(), val));
Ok(()) Ok(())
}); });

View file

@ -439,26 +439,20 @@ interface mixin WebGL2RenderingContextBase
void uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0, void uniform4uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
optional GLuint srcLength = 0); optional GLuint srcLength = 0);
// void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
// optional GLuint srcOffset = 0, optional GLuint srcLength = 0); optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
// void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
// optional GLuint srcOffset = 0, optional GLuint srcLength = 0); 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, void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
// optional GLuint srcOffset = 0, optional GLuint srcLength = 0); optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
// void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
// optional GLuint srcOffset = 0, optional GLuint srcLength = 0); 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, void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
// optional GLuint srcOffset = 0, optional GLuint srcLength = 0); optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
// void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data, void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
// optional GLuint srcOffset = 0, optional GLuint srcLength = 0); optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
// void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
// optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
/* Vertex attribs */ /* Vertex attribs */
// void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w); // void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);

View file

@ -668,9 +668,12 @@ interface mixin WebGLRenderingContextBase
void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0, void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
optional GLuint srcLength = 0); optional GLuint srcLength = 0);
void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data,
void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); optional GLuint srcOffset = 0, optional GLuint srcLength = 0);
void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value); 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 useProgram(WebGLProgram? program);
void validateProgram(WebGLProgram program); void validateProgram(WebGLProgram program);

View file

@ -1,115 +1,97 @@
[methods-2.html] [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 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]
expected: FAIL
[WebGL test #26: Property either does not exist or is not a function: vertexAttribIPointer]
expected: FAIL expected: FAIL
[WebGL test #2: Property either does not exist or is not a function: framebufferTextureLayer] [WebGL test #2: Property either does not exist or is not a function: framebufferTextureLayer]
expected: FAIL expected: FAIL
[WebGL test #19: Property either does not exist or is not a function: uniformMatrix4x2fv] [WebGL test #18: Property either does not exist or is not a function: vertexAttribI4ui]
expected: FAIL expected: FAIL
[WebGL test #15: Property either does not exist or is not a function: getFragDataLocation] [WebGL test #15: Property either does not exist or is not a function: getFragDataLocation]
expected: FAIL expected: FAIL
[WebGL test #17: Property either does not exist or is not a function: vertexAttribI4iv]
expected: FAIL
[WebGL test #4: Property either does not exist or is not a function: invalidateFramebuffer] [WebGL test #4: Property either does not exist or is not a function: invalidateFramebuffer]
expected: FAIL expected: FAIL
[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] [WebGL test #7: Property either does not exist or is not a function: renderbufferStorageMultisample]
expected: FAIL expected: FAIL
[WebGL test #10: Property either does not exist or is not a function: texStorage3D] [WebGL test #10: Property either does not exist or is not a function: texStorage3D]
expected: FAIL 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] [WebGL test #1: Property either does not exist or is not a function: blitFramebuffer]
expected: FAIL expected: FAIL
[WebGL test #29: Property either does not exist or is not a function: clearBufferiv]
expected: FAIL
[WebGL test #17: Property either does not exist or is not a function: uniformMatrix3x2fv]
expected: FAIL
[WebGL test #37: Property either does not exist or is not a function: bindVertexArray]
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]
expected: FAIL
[WebGL test #32: Property either does not exist or is not a function: clearBufferfi]
expected: FAIL
[WebGL test #16: Property either does not exist or is not a function: uniformMatrix2x3fv]
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]
expected: FAIL
[WebGL test #31: Property either does not exist or is not a function: clearBufferfv]
expected: FAIL
[WebGL test #28: Property either does not exist or is not a function: drawBuffers]
expected: FAIL
[WebGL test #23: Property either does not exist or is not a function: vertexAttribI4iv]
expected: FAIL
[WebGL test #21: Property either does not exist or is not a function: uniformMatrix4x3fv]
expected: FAIL
[WebGL test #11: Property either does not exist or is not a function: texSubImage3D] [WebGL test #11: Property either does not exist or is not a function: texSubImage3D]
expected: FAIL expected: FAIL
[WebGL test #20: Property either does not exist or is not a function: vertexAttribIPointer]
expected: FAIL
[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 #23: Property either does not exist or is not a function: clearBufferiv]
expected: FAIL
[WebGL test #21: Property either does not exist or is not a function: drawRangeElements]
expected: FAIL
[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 #12: Property either does not exist or is not a function: copyTexSubImage3D]
expected: FAIL
[WebGL test #22: Property either does not exist or is not a function: drawBuffers]
expected: FAIL
[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: createVertexArray]
expected: FAIL
[WebGL test #0: Property either does not exist or is not a function: isContextLost]
expected: FAIL
[WebGL test #25: Property either does not exist or is not a function: clearBufferfv]
expected: FAIL
[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] [WebGL test #9: Property either does not exist or is not a function: texStorage2D]
expected: FAIL 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] [WebGL test #6: Property either does not exist or is not a function: readBuffer]
expected: FAIL 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] [WebGL test #5: Property either does not exist or is not a function: invalidateSubFramebuffer]
expected: FAIL expected: FAIL
[WebGL test #14: Property either does not exist or is not a function: compressedTexSubImage3D] [WebGL test #14: Property either does not exist or is not a function: compressedTexSubImage3D]
expected: FAIL expected: FAIL
[WebGL test #31: Property either does not exist or is not a function: bindVertexArray]
expected: FAIL

View file

@ -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