From d9272412231cbe1d6a70b46f16d28d2a5b925a7d Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sun, 17 Feb 2019 11:16:40 +0900 Subject: [PATCH] graphicsdriver/opengl: Remove unnecessary function calls --- internal/graphicsdriver/opengl/program.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/graphicsdriver/opengl/program.go b/internal/graphicsdriver/opengl/program.go index 6943a0197..880e08927 100644 --- a/internal/graphicsdriver/opengl/program.go +++ b/internal/graphicsdriver/opengl/program.go @@ -284,12 +284,8 @@ func (d *Driver) useProgram(mode graphics.CompositeMode, colorM *affine.ColorM, }] if d.state.lastProgram != program { d.context.useProgram(program) - if d.state.lastProgram != zeroProgram { - theArrayBufferLayout.disable(&d.context, d.state.lastProgram) - } - theArrayBufferLayout.enable(&d.context, program) - if d.state.lastProgram == zeroProgram { + theArrayBufferLayout.enable(&d.context, program) d.context.bindBuffer(arrayBuffer, d.state.arrayBuffer) d.context.bindBuffer(elementArrayBuffer, d.state.elementArrayBuffer) d.context.uniformInt(program, "texture", 0)