]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/complex_constant_condition_removal.glsl
Allocate locations to interface variables
[libs/gl.git] / tests / glsl / complex_constant_condition_removal.glsl
1 const int lod = 1;
2 const int bias = 1;
3 const int threshold = 3;
4
5 #pragma MSP stage(vertex)
6 layout(location=0) in vec4 position;
7 layout(location=1) in vec4 color;
8 void main()
9 {
10         gl_Position = position;
11         passthrough;
12 }
13
14 #pragma MSP stage(fragment)
15 layout(location=0) out vec4 frag_color;
16 void main()
17 {
18         if(!(lod+bias>threshold))
19                 frag_color = color;
20         else
21                 frag_color = vec4(1.0);
22 }
23
24 /* Expected output: vertex
25 layout(location=0) in vec4 position;
26 layout(location=1) in vec4 color;
27 layout(location=0) out vec4 _vs_out_color;
28 void main()
29 {
30         gl_Position = position;
31         _vs_out_color = color;
32 }
33 */
34
35 /* Expected output: fragment
36 layout(location=0) out vec4 frag_color;
37 layout(location=0) in vec4 _vs_out_color;
38 void main()
39 {
40         frag_color = _vs_out_color;
41 }
42 */