shader: Use the loop counters in the test

This commit is contained in:
Hajime Hoshi 2020-07-13 01:48:00 +09:00
parent 2ca551cdc6
commit c02213e900
2 changed files with 4 additions and 4 deletions

View File

@ -3,11 +3,11 @@ void F0(out vec2 l0) {
vec2 l3 = vec2(0); vec2 l3 = vec2(0);
l1 = vec2(0.0); l1 = vec2(0.0);
for (int l2 = 0; l2 < 100; l2++) { for (int l2 = 0; l2 < 100; l2++) {
(l1).x = ((l1).x) + (1); (l1).x = ((l1).x) + (l2);
} }
l3 = vec2(0.0); l3 = vec2(0.0);
for (float l4 = 10.0; l4 >= 0.0; l4 -= 2.0) { for (float l4 = 10.0; l4 >= 0.0; l4 -= 2.0) {
(l3).x = ((l3).x) - (1); (l3).x = ((l3).x) + (l4);
} }
l0 = l1; l0 = l1;
return; return;

View File

@ -3,11 +3,11 @@ package main
func Foo() vec2 { func Foo() vec2 {
v := vec2(0) v := vec2(0)
for i := 0; i < 100; i++ { for i := 0; i < 100; i++ {
v.x++ v.x += i
} }
v2 := vec2(0) v2 := vec2(0)
for i := 10.0; i >= 0; i -= 2 { for i := 10.0; i >= 0; i -= 2 {
v2.x-- v2.x += i
} }
return v return v
} }