mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
graphicsdriver/opengl: Do not allow nil value for uniform variables
This commit is contained in:
parent
da5642cd0e
commit
a50ef46ed0
@ -264,8 +264,6 @@ func (g *Graphics) useProgram(program program, uniforms []uniformVariable, textu
|
|||||||
|
|
||||||
for _, u := range uniforms {
|
for _, u := range uniforms {
|
||||||
switch v := u.value.(type) {
|
switch v := u.value.(type) {
|
||||||
case nil:
|
|
||||||
// Do nothing.
|
|
||||||
case float32:
|
case float32:
|
||||||
if got, expected := (&shaderir.Type{Main: shaderir.Float}), &u.typ; !got.Equal(expected) {
|
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())
|
return fmt.Errorf("opengl: uniform variable type doesn't match: expected %s but %s", expected.String(), got.String())
|
||||||
|
Loading…
Reference in New Issue
Block a user