Fix gl.linkProgram() signature

This commit is contained in:
Anthony Ramine 2018-06-25 10:02:39 +02:00
parent cde6023ed4
commit 0e2e834d18
3 changed files with 5 additions and 8 deletions

View file

@ -594,7 +594,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
fn LinkProgram(&self, program: Option<&WebGLProgram>) {
fn LinkProgram(&self, program: &WebGLProgram) {
self.base.LinkProgram(program)
}

View file

@ -2947,12 +2947,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
fn LinkProgram(&self, program: Option<&WebGLProgram>) {
if let Some(program) = program {
if let Err(e) = program.link() {
self.webgl_error(e);
}
}
fn LinkProgram(&self, program: &WebGLProgram) {
// FIXME(nox): INVALID_OPERATION if program comes from a different context.
handle_potential_webgl_error!(self, program.link());
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9

View file

@ -597,7 +597,7 @@ interface WebGLRenderingContextBase
[WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
[WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
void lineWidth(GLfloat width);
void linkProgram(WebGLProgram? program);
void linkProgram(WebGLProgram program);
void pixelStorei(GLenum pname, GLint param);
void polygonOffset(GLfloat factor, GLfloat units);