From b8694aa66af06714fb7fedd96ffed2f4320842c5 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 26 Jan 2021 00:45:17 +0900 Subject: [PATCH] internal/graphicsdriver/opengl: Optimization --- internal/graphicsdriver/opengl/program.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/graphicsdriver/opengl/program.go b/internal/graphicsdriver/opengl/program.go index 70c160494..1b2c350c0 100644 --- a/internal/graphicsdriver/opengl/program.go +++ b/internal/graphicsdriver/opengl/program.go @@ -259,7 +259,9 @@ func (g *Graphics) useProgram(program program, uniforms []uniformVariable, textu } g.state.lastProgram = program - g.state.lastUniforms = map[string]interface{}{} + for k := range g.state.lastUniforms { + delete(g.state.lastUniforms, k) + } g.state.lastActiveTexture = 0 g.context.activeTexture(0) }