]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/nested_ternary.glsl
Check the flat qualifier from the correct member
[libs/gl.git] / tests / glsl / nested_ternary.glsl
1 uniform Colors
2 {
3         vec4 top_left;
4         vec4 top_right;
5         vec4 bottom_left;
6         vec4 bottom_right;
7 };
8
9 #pragma MSP stage(vertex)
10 layout(location=0) in vec4 position;
11 void main()
12 {
13         gl_Position = position;
14         passthrough;
15 }
16
17 #pragma MSP stage(fragment)
18 layout(location=0) out vec4 frag_color;
19 void main()
20 {
21         frag_color = (position.x>0 ? position.y>0 ? top_right : bottom_right :
22                 position.y>0 ? top_left : bottom_left);
23 }
24
25 // Target API: Vulkan
26
27 /* Expected output: vertex
28 layout(location=0) in vec4 position;
29 layout(location=0) out vec4 _vs_out_position;
30 void main()
31 {
32         gl_Position = position;
33         _vs_out_position = position;
34 }
35 */
36
37 /* Expected output: fragment
38 layout(set=0, binding=23) uniform Colors
39 {
40         vec4 top_left;
41         vec4 top_right;
42         vec4 bottom_left;
43         vec4 bottom_right;
44 };
45 layout(location=0) out vec4 frag_color;
46 layout(location=0) in vec4 _vs_out_position;
47 void main()
48 {
49         frag_color = _vs_out_position.x>0.0?(_vs_out_position.y>0.0?top_right:bottom_right):_vs_out_position.y>0.0?top_left:bottom_left;
50 }
51 */