internal/graphicsdriver/opengl: Avoid creating objects for debugging

This commit is contained in:
Hajime Hoshi 2021-10-30 00:04:03 +09:00
parent b1a442f86a
commit 76324254c1

View File

@ -270,7 +270,9 @@ func (g *Graphics) useProgram(program program, uniforms []uniformVariable, textu
for _, u := range uniforms {
if len(u.valueSlice) == 0 {
if got, expected := (&shaderir.Type{Main: shaderir.Float}), &u.typ; !got.Equal(expected) {
if u.typ.Main != shaderir.Float {
expected := &shaderir.Type{Main: shaderir.Float}
got := &u.typ
return fmt.Errorf("opengl: uniform variable %s type doesn't match: expected %s but %s", u.name, expected.String(), got.String())
}