graphicsdriver/opengl: Do not allow nil value for uniform variables

This commit is contained in:
Hajime Hoshi 2020-07-31 02:01:38 +09:00
parent da5642cd0e
commit a50ef46ed0

View File

@ -264,8 +264,6 @@ func (g *Graphics) useProgram(program program, uniforms []uniformVariable, textu
for _, u := range uniforms {
switch v := u.value.(type) {
case nil:
// Do nothing.
case float32:
if got, expected := (&shaderir.Type{Main: shaderir.Float}), &u.typ; !got.Equal(expected) {
return fmt.Errorf("opengl: uniform variable type doesn't match: expected %s but %s", expected.String(), got.String())