mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
0415773b94
commit
99f003a17a
@ -113,10 +113,7 @@ func (cs *compileState) parseStmt(block *block, fname string, stmt ast.Stmt, inP
|
||||
// OK
|
||||
} else if op == shaderir.Mul && ((lts[0].Main == shaderir.Vec2 && rts[0].Main == shaderir.Mat2) ||
|
||||
(lts[0].Main == shaderir.Vec3 && rts[0].Main == shaderir.Mat3) ||
|
||||
(lts[0].Main == shaderir.Vec4 && rts[0].Main == shaderir.Mat4) ||
|
||||
(lts[0].Main == shaderir.Mat2 && rts[0].Main == shaderir.Vec2) ||
|
||||
(lts[0].Main == shaderir.Mat3 && rts[0].Main == shaderir.Vec3) ||
|
||||
(lts[0].Main == shaderir.Mat4 && rts[0].Main == shaderir.Vec4)) {
|
||||
(lts[0].Main == shaderir.Vec4 && rts[0].Main == shaderir.Mat4)) {
|
||||
// OK
|
||||
} else if rhs[0].Const != nil && rhs[0].Const.Kind() == gconstant.Int {
|
||||
rhs[0].Const = gconstant.ToFloat(rhs[0].Const)
|
||||
|
@ -1630,7 +1630,7 @@ func TestShaderOperatorMultiplyAssign(t *testing.T) {
|
||||
{stmt: "a := mat2(1); a *= 2", err: false},
|
||||
{stmt: "a := mat2(1); a *= 2.0", err: false},
|
||||
{stmt: "a := mat2(1); a *= int(2)", err: true},
|
||||
{stmt: "a := mat2(1); a *= vec2(2)", err: false},
|
||||
{stmt: "a := mat2(1); a *= vec2(2)", err: true},
|
||||
{stmt: "a := mat2(1); a += vec2(2)", err: true},
|
||||
{stmt: "a := mat2(1); a *= vec3(2)", err: true},
|
||||
{stmt: "a := mat2(1); a *= vec4(2)", err: true},
|
||||
|
Loading…
Reference in New Issue
Block a user