Merge pull request #3031 from rg3igalia/sub-group-size-arb-flat-fix
[platform/upstream/glslang.git] / Test / discard-dce.frag
1 #version 110\r
2 varying vec2 tex_coord;\r
3 \r
4 void main (void)\r
5 {\r
6     vec4 white = vec4(1.0);\r
7     vec4 black = vec4(0.2);\r
8     vec4 color = white;\r
9 \r
10     // First, cut out our circle\r
11     float x = tex_coord.x*2.0 - 1.0;\r
12     float y = tex_coord.y*2.0 - 1.0;\r
13 \r
14     float radius = sqrt(x*x + y*y);\r
15     if (radius > 1.0) {\r
16         if (radius > 1.1) {\r
17             ++color;\r
18         }\r
19 \r
20         gl_FragColor = color;\r
21 \r
22         if (radius > 1.2) {\r
23             ++color;\r
24         }\r
25 \r
26         discard;\r
27     }\r
28 \r
29     // If we're near an edge, darken us a tiny bit\r
30     if (radius >= 0.75)\r
31         color -= abs(pow(radius, 16.0)/2.0);\r
32 \r
33     gl_FragColor = color;\r
34 \r
35 }\r