mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
parent
1cdc6ea72b
commit
77b51e4707
@ -642,7 +642,7 @@ func (cs *compileState) assign(block *block, fname string, pos token.Pos, lhs, r
|
||||
}
|
||||
t := rhsTypes[i]
|
||||
if t.Main == shaderir.None {
|
||||
// TODO: This is to determine a type when the rhs is a constant,
|
||||
// TODO: This is to determine a type when the rhs values are constants (not literals),
|
||||
// but there are no actual cases when len(lhs) != len(rhs). Is this correct?
|
||||
t = toDefaultType(rhsExprs[i].Const)
|
||||
}
|
||||
|
14
internal/shader/testdata/assign_multiple2.expected.vs
vendored
Normal file
14
internal/shader/testdata/assign_multiple2.expected.vs
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
void F0(out vec2 l0);
|
||||
|
||||
void F0(out vec2 l0) {
|
||||
float l1 = float(0);
|
||||
float l2 = float(0);
|
||||
float l3 = float(0);
|
||||
float l4 = float(0);
|
||||
l2 = 1.0;
|
||||
l1 = l2;
|
||||
l4 = 2.0;
|
||||
l3 = l4;
|
||||
l0 = vec2(l1, l3);
|
||||
return;
|
||||
}
|
6
internal/shader/testdata/assign_multiple2.go
vendored
Normal file
6
internal/shader/testdata/assign_multiple2.go
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
package main
|
||||
|
||||
func Foo() vec2 {
|
||||
r1, r2 := 1.0, 2.0
|
||||
return vec2(r1, r2)
|
||||
}
|
Loading…
Reference in New Issue
Block a user