graphicsdriver/opengl: Remove unnecessary function calls

This commit is contained in:
Hajime Hoshi 2019-02-17 11:16:40 +09:00
parent 3ecb00f717
commit d927241223

View File

@ -284,12 +284,8 @@ func (d *Driver) useProgram(mode graphics.CompositeMode, colorM *affine.ColorM,
}] }]
if d.state.lastProgram != program { if d.state.lastProgram != program {
d.context.useProgram(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 { if d.state.lastProgram == zeroProgram {
theArrayBufferLayout.enable(&d.context, program)
d.context.bindBuffer(arrayBuffer, d.state.arrayBuffer) d.context.bindBuffer(arrayBuffer, d.state.arrayBuffer)
d.context.bindBuffer(elementArrayBuffer, d.state.elementArrayBuffer) d.context.bindBuffer(elementArrayBuffer, d.state.elementArrayBuffer)
d.context.uniformInt(program, "texture", 0) d.context.uniformInt(program, "texture", 0)