mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Added Uniform2fv
This commit is contained in:
parent
4ff131e14e
commit
36522ba9c3
2 changed files with 22 additions and 0 deletions
|
@ -1059,6 +1059,27 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
.unwrap()
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||
fn Uniform2fv(&self,
|
||||
_cx: *mut JSContext,
|
||||
uniform: Option<&WebGLUniformLocation>,
|
||||
data: Option<*mut JSObject>) {
|
||||
let data = match data {
|
||||
Some(data) => data,
|
||||
None => return self.webgl_error(InvalidValue),
|
||||
};
|
||||
|
||||
if let Some(data) = array_buffer_view_to_vec_checked::<f32>(data) {
|
||||
if data.len() < 2 {
|
||||
return self.webgl_error(InvalidOperation);
|
||||
}
|
||||
|
||||
self.Uniform2f(uniform, data[0], data[1]);
|
||||
} else {
|
||||
self.webgl_error(InvalidValue);
|
||||
}
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||
fn Uniform4i(&self,
|
||||
uniform: Option<&WebGLUniformLocation>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue