Skip to content

Commit

Permalink
Call gl.getProgramInfoLog before gl.validateProgram (#1396)
Browse files Browse the repository at this point in the history
  • Loading branch information
unconed authored and ibgreen committed Aug 22, 2020
1 parent 7f06b69 commit 1a50f05
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion modules/webgl/src/classes/program.js
Expand Up @@ -338,11 +338,16 @@ export default class Program extends Resource {

// Avoid checking program linking error in production
if (gl.debug || log.level > 0) {
gl.validateProgram(this.handle);
const linked = gl.getProgramParameter(this.handle, gl.LINK_STATUS);
if (!linked) {
throw new Error(`Error linking: ${gl.getProgramInfoLog(this.handle)}`);
}

gl.validateProgram(this.handle);
const validated = gl.getProgramParameter(this.handle, gl.VALIDATE_STATUS);
if (!validated) {
throw new Error(`Error validating: ${gl.getProgramInfoLog(this.handle)}`);
}
}
}

Expand Down

0 comments on commit 1a50f05

Please sign in to comment.