mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Added Uniform1iv
This commit is contained in:
parent
0d0e08638d
commit
b48e0f2ba9
2 changed files with 23 additions and 1 deletions
|
@ -1008,6 +1008,27 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
.unwrap()
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||
fn Uniform1iv(&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::<i32>(data) {
|
||||
if data.len() < 1 {
|
||||
return self.webgl_error(InvalidOperation);
|
||||
}
|
||||
|
||||
self.Uniform1i(uniform, data[0]);
|
||||
} else {
|
||||
self.webgl_error(InvalidValue);
|
||||
}
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
|
||||
fn Uniform1fv(&self,
|
||||
uniform: Option<&WebGLUniformLocation>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue