]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/function_inline_in_iteration.glsl
Add a unit test framework and some tests for the GLSL compiler
[libs/gl.git] / tests / glsl / function_inline_in_iteration.glsl
1 #pragma MSP stage(vertex)
2 layout(location=0) in vec4 position;
3 layout(location=1) in float scale;
4 float func()
5 {
6         float s = scale*2.0;
7         return s*s;
8 }
9 void main()
10 {
11         float p = 1.0;
12         for(float i=func(); i<10.0; i+=2.0)
13                 p += i;
14         gl_Position = position*p;
15 }
16
17 /* Expected output: vertex
18 layout(location=0) in vec4 position;
19 layout(location=1) in float scale;
20 void main()
21 {
22         float p = 1.0;
23         float s = scale*2.0;
24         for(float i=s*s; i<10.0; i+=2.0)
25                 p += i;
26         gl_Position = position*p;
27 }
28 */