shader: Add more tests

This commit is contained in:
Hajime Hoshi 2020-06-11 22:52:18 +09:00
parent f39c591252
commit d04fdbde61
6 changed files with 29 additions and 2 deletions

View File

@ -0,0 +1,7 @@
void F0(in vec2 l0, out vec4 l1) {
float l2 = 0.0;
l2 = 0.000000000e+00;
l2 = (l2) + (1.000000000e+00);
l1 = vec4(l0, l2, l2);
return;
}

8
internal/shader/testdata/assign.go vendored Normal file
View File

@ -0,0 +1,8 @@
package main
func Foo(foo vec2) vec4 {
var r1 float
r1 = 0.0
r1 += 1.0
return vec4(foo, r1, r1)
}

View File

@ -6,7 +6,7 @@ void F0(in vec2 l0, out vec4 l1) {
F1(l4, l5);
l2 = l4;
l3 = l5;
l1 = vec4(l0, l2, l2);
l1 = vec4(l0, l2, l3);
return;
}

View File

@ -3,7 +3,7 @@ package main
func Foo(foo vec2) vec4 {
var r1, r2 float
r1, r2 = Bar()
return vec4(foo, r1, r1)
return vec4(foo, r1, r2)
}
func Bar() (float, float) {

View File

@ -0,0 +1,6 @@
void F0(in vec2 l0, out vec4 l1) {
vec4 l2 = vec4(0.0);
l2 = (vec4(0.000000000e+00)) * (vec4(0.000000000e+00));
l1 = l2;
return;
}

View File

@ -0,0 +1,6 @@
package main
func Foo(foo vec2) vec4 {
r := vec4(0.0) * vec4(0.0)
return r
}