Store active uniforms on the DOM side

This commit is contained in:
Anthony Ramine 2018-07-11 11:55:25 +02:00
parent a5b800970a
commit cbac5d05be
5 changed files with 79 additions and 55 deletions

View file

@ -2693,12 +2693,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
Int32Value(program.attached_shaders().map(|shaders| shaders.len() as i32).unwrap_or(0))
}
constants::ACTIVE_ATTRIBUTES => Int32Value(program.active_attribs().len() as i32),
constants::ACTIVE_UNIFORMS => {
// FIXME(nox): We'll need to cache that on the DOM side at some point.
let (sender, receiver) = webgl_channel().unwrap();
self.send_command(WebGLCommand::GetProgramActiveUniforms(program.id(), sender));
Int32Value(receiver.recv().unwrap())
}
constants::ACTIVE_UNIFORMS => Int32Value(program.active_uniforms().len() as i32),
_ => {
self.webgl_error(InvalidEnum);
NullValue()