diff --git a/internal/shader/testdata/for3.expected.vs b/internal/shader/testdata/for3.expected.vs new file mode 100644 index 000000000..2e3b31231 --- /dev/null +++ b/internal/shader/testdata/for3.expected.vs @@ -0,0 +1,20 @@ +void F0(out vec2 l0); + +void F0(out vec2 l0) { + vec2 l1 = vec2(0); + vec2 l3 = vec2(0); + l1 = vec2(0.0); + for (int l2 = 0; l2 < 100; l2++) { + vec2 l5 = vec2(0); + l3 = vec2(0.0); + l1 = l3; + } + l3 = vec2(0.0); + for (int l4 = 0; l4 < 100; l4++) { + vec2 l5 = vec2(0); + l5 = vec2(0.0); + l3 = l5; + } + l0 = l1; + return; +} diff --git a/internal/shader/testdata/for3.go b/internal/shader/testdata/for3.go new file mode 100644 index 000000000..da12a17b3 --- /dev/null +++ b/internal/shader/testdata/for3.go @@ -0,0 +1,15 @@ +package main + +func Foo() vec2 { + v := vec2(0) + for i := 0; i < 100; i++ { + v2 := vec2(0) + v = v2 + } + v3 := vec2(0) + for i := 0; i < 100; i++ { + v4 := vec2(0) + v3 = v4 + } + return v +}