]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/function_inline_in_condition.glsl
Add a unit test framework and some tests for the GLSL compiler
[libs/gl.git] / tests / glsl / function_inline_in_condition.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         if(func()>1.0)
12                 gl_Position = position;
13 }
14
15 /* Expected output: vertex
16 layout(location=0) in vec4 position;
17 layout(location=1) in float scale;
18 void main()
19 {
20         float s = scale*2.0;
21         if(s*s>1.0)
22                 gl_Position = position;
23 }
24 */