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

View File

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