Merge pull request #2892 from greg-lunarg/mb
[platform/upstream/glslang.git] / Test / vk.relaxed.stagelink.frag
1 #version 460\r
2 \r
3 layout (location = 0) in vec4 io;\r
4 \r
5 out vec4 o;\r
6 \r
7 // default uniforms will be gathered into a uniform block\r
8 // final global block will merge uniforms from all linked files\r
9 uniform vec4 a;     // declared in both stages\r
10 uniform vec2 b1;    // declaration order swapped in other stage\r
11 uniform vec2 b2;\r
12 uniform vec4 c1;    // not delcared in other file\r
13 uniform vec4 d;\r
14 \r
15 // final global buffer will berge buffers from all linked files\r
16 layout (binding = 0) uniform atomic_uint counter1;\r
17 layout (binding = 0) uniform atomic_uint counter2;\r
18 \r
19 vec4 foo() {\r
20     uint j = atomicCounterIncrement(counter1) + atomicCounterDecrement(counter2);\r
21     vec4 v = a + vec4(b1.x, b1.y, b2.x, b2.y) + c1 + d;\r
22 \r
23     return float(j) * v;\r
24 }\r
25 \r
26 void main() {\r
27     o = io + foo();\r
28 }