webgl: Check shader compilation status on use_program.

This commit is contained in:
Emilio Cobos Álvarez 2016-01-04 14:17:10 +01:00
parent cf479a2b4f
commit 4092ffd245
3 changed files with 20 additions and 3 deletions

View file

@ -1004,8 +1004,10 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
fn UseProgram(&self, program: Option<&WebGLProgram>) {
if let Some(program) = program {
program.use_program();
self.current_program.set(Some(program));
match program.use_program() {
Ok(()) => self.current_program.set(Some(program)),
Err(e) => self.webgl_error(e),
}
}
}