ebiten: Bug fix: zeroUniformValue panicked with vec2 or other vector/matrix types

This commit is contained in:
Hajime Hoshi 2021-10-30 04:30:29 +09:00
parent 06f4142ca0
commit 610ebbbab5

View File

@ -225,7 +225,7 @@ func zeroUniformValue(name string, t shaderir.Type) driver.Uniform {
return driver.Uniform{ return driver.Uniform{
Float32: 0, Float32: 0,
} }
case shaderir.Array: case shaderir.Array, shaderir.Vec2, shaderir.Vec3, shaderir.Vec4, shaderir.Mat2, shaderir.Mat3, shaderir.Mat4:
return driver.Uniform{ return driver.Uniform{
Float32s: make([]float32, t.FloatNum()), Float32s: make([]float32, t.FloatNum()),
} }