1#version 450 core
2
3in float in1;
4in vec2 in2;
5in vec3 in3;
6in vec4 in4;
7
8void main()
9{
10    vec2 v2 = dFdxFine(in2);
11    vec3 v3 = dFdyCoarse(in3);
12    vec4 v4 = fwidth(in4);
13    v4 = dFdyFine(in4);
14    v3 = dFdyFine(in3);
15    float f = dFdx(in1) + dFdxFine(in1) + dFdxCoarse(in1);
16    v4 = fwidthCoarse(in4) + fwidthFine(in4);
17
18    float cull = gl_CullDistance[2];
19    float consts = gl_MaxCullDistances + gl_MaxCombinedClipAndCullDistances + gl_MaxSamples;
20
21    if (gl_HelperInvocation)
22        ++v4;
23
24    int sum = gl_MaxVertexImageUniforms +
25              gl_MaxFragmentImageUniforms +
26              gl_MaxComputeImageUniforms +
27              gl_MaxCombinedImageUniforms +
28              gl_MaxCombinedShaderOutputResources;
29
30    bool b1, b3, b;
31    uint uin;
32    bvec2 b2 = mix(bvec2(b1), bvec2(b3), bvec2(b));
33    uint um = mix(uin, uin, b);
34    ivec3 im3 = mix(ivec3(uin), ivec3(uin), bvec3(b));
35}
36
37uniform sampler2DMS s2dms;
38uniform usampler2DMSArray us2dmsa;
39layout(rgba32i) uniform iimage2DMS ii2dms;
40layout(rgba32f) uniform image2DMSArray i2dmsa;
41
42void foo()
43{
44    int s = textureSamples(s2dms);
45    s += textureSamples(us2dmsa);
46    s += imageSamples(ii2dms);
47    s += imageSamples(i2dmsa);
48    float f = imageAtomicExchange(i2dmsa, ivec3(in3), 2, 4.5);
49}
50
51in float gl_CullDistance[6];
52
53float cull(int i)
54{
55    return (i >= 6) ? gl_CullDistance[5] : gl_CullDistance[i];
56}
57
58layout(location = 6) in bName1 {
59    float f;
60    layout(location = 7) float g;
61    mat4 m;
62} bInst1;
63layout(location = 12) in bName2 {
64    float f;
65    layout(location = 13) float g;  // ERROR, location on array
66} bInst2[3];
67
68layout(early_fragment_tests) in float f; // ERROR, must be standalone
69