Make gl.useProgram(null) do the right thing

This commit is contained in:
Anthony Ramine 2018-07-05 09:40:22 +02:00
parent fc593c68c5
commit 15389586d9
5 changed files with 9 additions and 23 deletions

View file

@ -826,8 +826,6 @@ impl WebGLImpl {
ctx.gl().uniform_matrix_3fv(uniform_id, transpose, v),
WebGLCommand::UniformMatrix4fv(uniform_id, transpose, ref v) =>
ctx.gl().uniform_matrix_4fv(uniform_id, transpose, v),
WebGLCommand::UseProgram(program_id) =>
ctx.gl().use_program(program_id.get()),
WebGLCommand::ValidateProgram(program_id) =>
ctx.gl().validate_program(program_id.get()),
WebGLCommand::VertexAttrib(attrib_id, x, y, z, w) =>
@ -965,6 +963,9 @@ impl WebGLImpl {
WebGLCommand::LinkProgram(program_id, ref sender) => {
return sender.send(Self::link_program(ctx.gl(), program_id)).unwrap();
}
WebGLCommand::UseProgram(program_id) => {
ctx.gl().use_program(program_id.map_or(0, |p| p.get()))
}
}
// TODO: update test expectations in order to enable debug assertions