]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/keep_used_function.glsl
Resolve functions after inlining expressions
[libs/gl.git] / tests / glsl / keep_used_function.glsl
1 #pragma MSP stage(vertex)
2 layout(location=0) in vec4 position;
3 layout(location=1) in vec2 scale;
4 float square(float arg)
5 {
6         return arg*arg;
7 }
8 void main()
9 {
10         float x_sq = square(scale.x);
11         float y_sq = square(scale.y);
12         gl_Position = position*sqrt(x_sq+y_sq);
13 }
14
15 /* Expected output: vertex
16 layout(location=0) in vec4 position;
17 layout(location=1) in vec2 scale;
18 float square(float arg)
19 {
20         return arg*arg;
21 }
22 void main()
23 {
24         gl_Position = position*sqrt(square(scale.x)+square(scale.y));
25 }
26 */