]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/constant_ternary_removal.glsl
Eliminate constant ternary expressions
[libs/gl.git] / tests / glsl / constant_ternary_removal.glsl
1 const bool use_color = false;
2
3 #pragma MSP stage(vertex)
4 layout(location=0) in vec4 position;
5 layout(location=1) in vec4 color;
6 void main()
7 {
8         gl_Position = position;
9         passthrough;
10 }
11
12 #pragma MSP stage(fragment)
13 layout(location=0) out vec4 frag_color;
14 void main()
15 {
16         frag_color = (use_color ? color : vec4(1.0));
17 }
18
19 /* Expected output: vertex
20 layout(location=0) in vec4 position;
21 void main()
22 {
23         gl_Position = position;
24 }
25 */
26
27 /* Expected output: fragment
28 layout(location=0) out vec4 frag_color;
29 void main()
30 {
31         frag_color = vec4(1.0);
32 }
33 */