internal/shader: bug fix: wrong test (int*float)

This commit is contained in:
Hajime Hoshi 2022-01-21 01:31:46 +09:00
parent 8d2bf6525c
commit 8b8b96c9e7
2 changed files with 24 additions and 42 deletions

View File

@ -1,42 +1,33 @@
void F0(out vec2 l0); void F0(out vec2 l0);
void F1(out vec2 l0); void F1(out vec2 l0);
void F2(out float l0); void F2(out float l0);
void F3(out int l0); void F3(in float l0);
void F4(in float l0); void F4(in int l0);
void F5(in int l0); void F5(void);
void F6(void);
void F0(out vec2 l0) { void F0(out vec2 l0) {
float l1 = float(0); float l1 = float(0);
int l2 = 0; float l2 = float(0);
float l3 = float(0); float l3 = float(0);
int l4 = 0; float l4 = float(0);
float l5 = float(0);
float l6 = float(0);
F2(l1); F2(l1);
F3(l2); l2 = (l1) * (1.0);
l3 = (l1) * (l2); F2(l3);
F3(l4); l4 = (1.0) * (l3);
F2(l5); l0 = vec2(l2, l4);
l6 = (l4) * (l5);
l0 = vec2(l3, l6);
return; return;
} }
void F1(out vec2 l0) { void F1(out vec2 l0) {
float l1 = float(0); float l1 = float(0);
int l2 = 0; float l2 = float(0);
float l3 = float(0); float l3 = float(0);
int l4 = 0; float l4 = float(0);
float l5 = float(0);
float l6 = float(0);
F2(l1); F2(l1);
F3(l2); l2 = (l1) * (1.0);
l3 = (l1) * (l2); F2(l3);
F3(l4); l4 = (1.0) * (l3);
F2(l5); l0 = vec2(l2, l4);
l6 = (l4) * (l5);
l0 = vec2(l3, l6);
return; return;
} }
@ -45,18 +36,13 @@ void F2(out float l0) {
return; return;
} }
void F3(out int l0) { void F3(in float l0) {
l0 = 1;
return;
} }
void F4(in float l0) { void F4(in int l0) {
} }
void F5(in int l0) { void F5(void) {
} F3(1.0);
F4(1);
void F6(void) {
F4(1.0);
F5(1);
} }

View File

@ -1,14 +1,14 @@
package main package main
func Foo() vec2 { func Foo() vec2 {
x := Float() * Int() x := Float() * 1
y := Int() * Float() y := 1 * Float()
return vec2(x, y) return vec2(x, y)
} }
func Foo2() vec2 { func Foo2() vec2 {
var x = Float() * Int() var x = Float() * 1
var y = Int() * Float() var y = 1 * Float()
return vec2(x, y) return vec2(x, y)
} }
@ -16,10 +16,6 @@ func Float() float {
return 1.0 return 1.0
} }
func Int() int {
return 1.0
}
func TakeFloat(x float) { func TakeFloat(x float) {
} }